aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtGui/qvariant_test.py
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-09-28 18:07:02 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2010-09-29 15:44:13 -0300
commiteabb9d37a78d1c584fe7e70928f0e820bd6e0afc (patch)
treecb94c7d95e2ff0112843e877008eadb5bcb9b5e2 /tests/QtGui/qvariant_test.py
parent6ad03f2a795563aec47d45d6426639323f981975 (diff)
Fix bug#372 - "DiagramScene (GraphicsView) Example not working"
The correct title would be "QVariant doesn't correct store a QGraphicsScene object."
Diffstat (limited to 'tests/QtGui/qvariant_test.py')
-rw-r--r--tests/QtGui/qvariant_test.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/QtGui/qvariant_test.py b/tests/QtGui/qvariant_test.py
new file mode 100644
index 000000000..faa755a18
--- /dev/null
+++ b/tests/QtGui/qvariant_test.py
@@ -0,0 +1,23 @@
+
+import unittest
+from PySide.QtCore import *
+from PySide.QtGui import *
+
+class MyDiagram(QGraphicsScene):
+ pass
+
+class MyItem(QGraphicsRectItem):
+ def itemChange(self, change, value):
+ return value;
+
+class QGraphicsSceneOnQVariantTest(unittest.TestCase):
+ """Test storage ot QGraphicsScene into QVariants"""
+ def testIt(self):
+ app = QApplication([])
+ s = MyDiagram()
+ i = MyItem()
+ s.addItem(i)
+ self.assertEqual(len(s.items()), 1)
+
+if __name__ == '__main__':
+ unittest.main()