summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-03-11 15:56:25 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-03-16 16:34:26 -0300
commit9a7733ef8cadc7cab88f420ee7dd1a504047b325 (patch)
tree8d2817a05cb470fe18c63654d8b064e7abfe95a6
parenta571d9bd9858e251268cd553db0cec1516888fe6 (diff)
downloadpyside-9a7733ef8cadc7cab88f420ee7dd1a504047b325.tar.gz
pyside-9a7733ef8cadc7cab88f420ee7dd1a504047b325.tar.xz
pyside-9a7733ef8cadc7cab88f420ee7dd1a504047b325.zip
Fix QToolbar.clear parent policy.
Fixes bug #711. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml20
1 files changed, 20 insertions, 0 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 8c2c0ed..970447a 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -4601,6 +4601,26 @@
<parent index="this" action="add"/>
</modify-argument>
</modify-function>
+ <modify-function signature="clear()">
+ <inject-code>
+ QList&lt;PyObject* &gt; lst;
+ Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();
+ foreach(QToolButton* child, %CPPSELF.findChildren&lt;QToolButton*&gt;()) {
+ if (bm.hasWrapper(child)) {
+ PyObject* pyChild = %CONVERTTOPYTHON[QToolButton*](child);
+ Shiboken::Object::setParent(0, pyChild);
+ lst &lt;&lt; pyChild;
+ }
+ }
+
+ %CPPSELF.clear();
+
+ foreach(PyObject* obj, lst) {
+ Shiboken::Object::invalidate(reinterpret_cast&lt;SbkObject* &gt;(obj));
+ Py_XDECREF(obj);
+ }
+ </inject-code>
+ </modify-function>
</object-type>
<object-type name="QPaintEngine">
<enum-type name="DirtyFlag" flags="QPaintEngine::DirtyFlags"/>