From 32fb36f97ac76ef23271049dbb6642bf7bfed557 Mon Sep 17 00:00:00 2001 From: Renato Filho Date: Fri, 11 Mar 2011 15:56:25 -0300 Subject: Fix QToolbar.clear parent policy. Fixes bug #711. Reviewer: Luciano Wolf Lauro Moura --- PySide/QtGui/typesystem_gui_common.xml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml index 8c2c0ed63..970447a6d 100644 --- a/PySide/QtGui/typesystem_gui_common.xml +++ b/PySide/QtGui/typesystem_gui_common.xml @@ -4601,6 +4601,26 @@ + + + QList<PyObject* > lst; + Shiboken::BindingManager& bm = Shiboken::BindingManager::instance(); + foreach(QToolButton* child, %CPPSELF.findChildren<QToolButton*>()) { + if (bm.hasWrapper(child)) { + PyObject* pyChild = %CONVERTTOPYTHON[QToolButton*](child); + Shiboken::Object::setParent(0, pyChild); + lst << pyChild; + } + } + + %CPPSELF.clear(); + + foreach(PyObject* obj, lst) { + Shiboken::Object::invalidate(reinterpret_cast<SbkObject* >(obj)); + Py_XDECREF(obj); + } + + -- cgit v1.2.3