Fix bug#372 - "DiagramScene (GraphicsView) Example not working"

The correct title would be "QVariant doesn't correct store a QGraphicsScene object."
This commit is contained in:
Hugo Parente Lima 2010-09-28 18:07:02 -03:00
commit eabb9d37a7
3 changed files with 25 additions and 4 deletions

View file

@ -61,6 +61,7 @@ PYSIDE_TEST(qtextedit_test.py)
PYSIDE_TEST(qtextedit_signal_test.py)
PYSIDE_TEST(qtoolbar_test.py)
PYSIDE_TEST(qtoolbox_test.py)
PYSIDE_TEST(qvariant_test.py)
PYSIDE_TEST(qwidget_setlayout_test.py)
PYSIDE_TEST(qwidget_test.py)
PYSIDE_TEST(reference_count_test.py)

View file

@ -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()