Fix bug 768 - "Method "QGraphicsItemGroup* QGraphicsScene::createItemGroup(const QList<QGraphicsItem*>& items)" missing"
Fix bug 769 - "Method "QGraphicsScene::destroyItemGroup(QGraphicsItemGroup* group)" missing" Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
This commit is contained in:
parent
d7185772bc
commit
101671f474
2 changed files with 38 additions and 4 deletions
|
|
@ -148,5 +148,21 @@ class ItemRetrieve(UsesQApplication):
|
|||
self.assertEqual(self.scene.itemAt(50, 150), self.bottomleft)
|
||||
self.assertEqual(self.scene.itemAt(150, 150), self.bottomright)
|
||||
|
||||
class TestGraphicsGroup(UsesQApplication):
|
||||
def testIt(self):
|
||||
scene = QGraphicsScene()
|
||||
i1 = QGraphicsRectItem()
|
||||
scene.addItem(i1)
|
||||
i2 = QGraphicsRectItem(i1)
|
||||
i3 = QGraphicsRectItem()
|
||||
i4 = QGraphicsRectItem()
|
||||
group = scene.createItemGroup((i2, i3, i4))
|
||||
scene.removeItem(i1)
|
||||
del i1 # this shouldn't delete i2
|
||||
self.assertEqual(i2.scene(), scene)
|
||||
scene.destroyItemGroup(group)
|
||||
self.assertRaises(RuntimeError, group.type)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue