aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore/child_event_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/QtCore/child_event_test.py')
-rw-r--r--tests/QtCore/child_event_test.py55
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/QtCore/child_event_test.py b/tests/QtCore/child_event_test.py
new file mode 100644
index 000000000..ccc27c848
--- /dev/null
+++ b/tests/QtCore/child_event_test.py
@@ -0,0 +1,55 @@
+#!/usr/bin/python
+'''Test case for QObject.childEvent and QTimer.childEvent overloading'''
+
+import unittest
+from time import sleep
+from PySide.QtCore import QObject, QTimer, QCoreApplication
+
+from helper import UsesQCoreApplication
+
+class ExtQObject(QObject):
+ def __init__(self):
+ QObject.__init__(self)
+ self.child_event_received = False
+
+ def childEvent(self, event):
+ QObject.childEvent(self, event)
+ self.child_event_received = True
+
+class ExtQTimer(QTimer):
+ def __init__(self):
+ QTimer.__init__(self)
+ self.child_event_received = False
+
+ def childEvent(self, event):
+ QTimer.childEvent(self, event)
+ self.child_event_received = True
+
+
+class TestChildEvent(UsesQCoreApplication):
+ '''Test case for QObject::childEvent and QTimer::childEvent'''
+
+ def setUp(self):
+ UsesQCoreApplication.setUp(self)
+
+ def tearDown(self):
+ UsesQCoreApplication.tearDown(self)
+
+ def testQObject(self):
+ parent = ExtQObject()
+ child = QObject()
+ child.setParent(parent)
+ print "parent seted"
+ #self.assert_(parent.child_event_received)
+
+ """
+ def testQTimer(self):
+ parent = ExtQTimer()
+ child = QObject()
+ child.setParent(parent)
+ self.assert_(parent.child_event_received)
+ """
+
+if __name__ == '__main__':
+ unittest.main()
+