Revision 363231323863 () - Diff

Link to this snippet: https://friendpaste.com/6D8cuZFXrVFFkqdUVK55x0
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Author: Tomi Saarinen, Rohea Oy
# Licence: Do what ever you like with this but we guarantee nothing

import sys
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtMaemo5 import QMaemo5KineticScroller

class SimpleKinetic(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
self.items = ["1st item", "2nd item", "3rd item", "4th item", "5th item", "6th item",
"7th item", "8th item", "9th item", "10th item", "11th item", "12th item"]
self.listWidget = QListWidget(self)
for i in range(len(self.items)):
listItem = QListWidgetItem(QString(self.items[i]))
self.listWidget.addItem(listItem)
# Note that 'scroller' variable is very necessary here even if it doesn't seem to do much
self.scroller = QMaemo5KineticScroller(self.listWidget)
self.setCentralWidget(self.listWidget)

if __name__ == '__main__':
app = QApplication(sys.argv)
sk = SimpleKinetic()
sk.show()
sys.exit(app.exec_())