| a | b | |
|---|
| 0 | + | # Author: Tomi Saarinen, Rohea Oy |
|---|
| 0 | + | # Licence: Do what ever you like with this but we guarantee nothing |
|---|
| 0 | + | |
|---|
| 0 | + | import sys |
|---|
| 0 | + | from PySide.QtCore import * |
|---|
| 0 | + | from PySide.QtGui import * |
|---|
| 0 | + | from PySide.QtMaemo5 import QMaemo5KineticScroller |
|---|
| 0 | + | |
|---|
| 0 | + | class SimpleKinetic(QMainWindow): |
|---|
| 0 | + | def __init__(self): |
|---|
| 0 | + | QMainWindow.__init__(self) |
|---|
| 0 | + | self.items = ["1st item", "2nd item", "3rd item", "4th item", "5th item", "6th item", |
|---|
| 0 | + | "7th item", "8th item", "9th item", "10th item", "11th item", "12th item"] |
|---|
| 0 | + | self.listWidget = QListWidget(self) |
|---|
| 0 | + | for i in range(len(self.items)): |
|---|
| 0 | + | listItem = QListWidgetItem(QString(self.items[i])) |
|---|
| 0 | + | self.listWidget.addItem(listItem) |
|---|
| 0 | + | # Note that 'scroller' variable is very necessary here even if it doesn't seem to do much |
|---|
| 0 | + | self.scroller = QMaemo5KineticScroller(self.listWidget) |
|---|
| 0 | + | self.setCentralWidget(self.listWidget) |
|---|
| 0 | + | |
|---|
| 0 | + | if __name__ == '__main__': |
|---|
| 0 | + | app = QApplication(sys.argv) |
|---|
| 0 | + | sk = SimpleKinetic() |
|---|
| 0 | + | sk.show() |
|---|
| 0 | + | sys.exit(app.exec_()) |
|---|
| ... | |
|---|