diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-02-16 16:07:01 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:53:59 -0300 |
commit | 8550948818153625a4f23def6eb2ab1b7e63d30b (patch) | |
tree | a30ead73141d2842e24d243fe2e79c177b21d3f2 /PySide | |
parent | c8ecf9fea606679be567b9799fd6afb40a370564 (diff) |
Fix bug 674 - "QGraphicsScene::clear() is missing"
Diffstat (limited to 'PySide')
-rw-r--r-- | PySide/QtGui/typesystem_gui_common.xml | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml index b7b28734a..724ac1eca 100644 --- a/PySide/QtGui/typesystem_gui_common.xml +++ b/PySide/QtGui/typesystem_gui_common.xml @@ -3099,7 +3099,21 @@ <modify-function signature="createItemGroup(const QList<QGraphicsItem*>&)" remove="all"/> <modify-function signature="destroyItemGroup(QGraphicsItemGroup*)" remove="all"/> - <modify-function signature="clear()" remove="all"/> + <modify-function signature="clear()"> + <inject-code> + const QList<QGraphicsItem*> items = %CPPSELF.items(); + Shiboken::BindingManager& bm = Shiboken::BindingManager::instance(); + foreach (QGraphicsItem* item, items) { + SbkObject* obj = bm.retrieveWrapper(item); + if (obj) { + if (obj->ob_refcnt > 1) // If the refcnt is 1 the object will vannish anyway. + Shiboken::Object::invalidate(obj); + Shiboken::Object::removeParent(obj); + } + } + %CPPSELF.%FUNCTION_NAME(); + </inject-code> + </modify-function> <modify-function signature="removeItem(QGraphicsItem*)"> <modify-argument index="1"> |