aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtDeclarative/qdeclarativeview_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/QtDeclarative/qdeclarativeview_test.py')
-rw-r--r--tests/QtDeclarative/qdeclarativeview_test.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/QtDeclarative/qdeclarativeview_test.py b/tests/QtDeclarative/qdeclarativeview_test.py
new file mode 100644
index 000000000..8101c5f01
--- /dev/null
+++ b/tests/QtDeclarative/qdeclarativeview_test.py
@@ -0,0 +1,31 @@
+'''Test cases for QDeclarativeView'''
+
+import unittest
+
+from PySide.QtCore import QUrl, QStringList, QVariant
+from PySide.QtGui import QPushButton
+from PySide.QtDeclarative import QDeclarativeView
+
+from helper import adjust_filename, TimedQApplication
+
+
+class TestQDeclarativeView(TimedQApplication):
+
+ def testQDeclarativeViewList(self):
+ view = QDeclarativeView()
+
+ dataList = QStringList(["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()