summaryrefslogtreecommitdiffstats
path: root/tests/QtDeclarative/bug_951.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/QtDeclarative/bug_951.py')
-rw-r--r--tests/QtDeclarative/bug_951.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/QtDeclarative/bug_951.py b/tests/QtDeclarative/bug_951.py
new file mode 100644
index 0000000..0cd8953
--- /dev/null
+++ b/tests/QtDeclarative/bug_951.py
@@ -0,0 +1,31 @@
+from PySide.QtDeclarative import QDeclarativeItem, qmlRegisterType, QDeclarativeView
+from PySide.QtCore import QUrl
+
+from helper import adjust_filename, TimedQApplication
+import unittest
+
+class MyItem(QDeclarativeItem):
+ COMPONENT_COMPLETE_CALLED = False
+ def __init__(self,parent=None):
+ super(MyItem, self).__init__(parent)
+ self.setObjectName("myitem")
+
+ def componentComplete(self):
+ MyItem.COMPONENT_COMPLETE_CALLED = True
+ super(MyItem, self).componentComplete()
+
+class TestRegisterQMLType(TimedQApplication):
+ def setup(self):
+ TimedQApplication.setup(self, 100 * 3) # 3s
+
+ def testSignalEmission(self):
+ qmlRegisterType(MyItem, "my.item", 1, 0, "MyItem")
+
+ view = QDeclarativeView()
+ view.setSource(QUrl.fromLocalFile(adjust_filename('bug_951.qml', __file__)))
+
+ self.app.exec_()
+ self.assertTrue(MyItem.COMPONENT_COMPLETE_CALLED)
+
+if __name__ == '__main__':
+ unittest.main()