blob: 7a2b657e1d75a3d5d952fbe1fbc848b60b689da8 (
plain)
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
27
28
29
30
|
'''Test cases for QDeclarativeView'''
import unittest
from PySide.QtCore import QUrl
from PySide.QtDeclarative import QDeclarativeView
from helper import adjust_filename, TimedQApplication
class TestQDeclarativeView(TimedQApplication):
def testQDeclarativeViewList(self):
view = QDeclarativeView()
dataList = ["Item 1", "Item 2", "Item 3", "Item 4"]
ctxt = view.rootContext()
ctxt.setContextProperty("myModel", dataList)
url = QUrl.fromLocalFile(adjust_filename('view.qml', __file__))
view.setSource(url)
view.show()
self.assertEqual(view.status(), QDeclarativeView.Ready)
self.app.exec_()
if __name__ == '__main__':
unittest.main()
|