aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/QtWidgets
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-02-02 13:55:01 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-02-02 13:55:01 +0100
commit4b2ef72f0461fbce539d6a1bd69d8c0ed7041025 (patch)
tree6b311ffa86655f7c27aca88df59d125070bc32fb /sources/pyside2/PySide2/QtWidgets
parenta5bc27c463f40f6c984f99f81bb05e46699c7df1 (diff)
parenta18e81dd1311811eb1227cf46d253ae647a9fbdd (diff)
Merge remote-tracking branch 'origin/5.6' into 5.9
Diffstat (limited to 'sources/pyside2/PySide2/QtWidgets')
-rw-r--r--sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml7
1 files changed, 5 insertions, 2 deletions
diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
index 92ff3c08..d0c4877f 100644
--- a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
+++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml
@@ -2526,10 +2526,13 @@
</modify-function>
<modify-function signature="clear()">
<inject-code class="target" position="beginning">
+ Shiboken::BindingManager&amp; bm = Shiboken::BindingManager::instance();
for (int i = 0; i &lt; %CPPSELF.count(); i++) {
QWidget* widget = %CPPSELF.widget(i);
- Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](widget));
- Shiboken::Object::setParent(0, pyWidget);
+ if (bm.hasWrapper(widget)) {
+ Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](widget));
+ Shiboken::Object::releaseOwnership(pyWidget);
+ }
}
%CPPSELF.%FUNCTION_NAME();
</inject-code>