From 3a0b98ef4b495bb8eb0a8aa82f6f79bfdfad6c49 Mon Sep 17 00:00:00 2001 From: Renato Filho Date: Mon, 19 Sep 2011 16:01:42 -0300 Subject: Fix QLayout.itemAt and QGridLayout.itemAtPosition return policy. Fixes bug #1006. Reviewer: Luciano Wolf Marcelo Lira --- PySide/QtGui/glue/qlayout_help_functions.h | 3 +-- PySide/QtGui/typesystem_gui_common.xml | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/PySide/QtGui/glue/qlayout_help_functions.h b/PySide/QtGui/glue/qlayout_help_functions.h index 90c950a5f..6912fc8c6 100644 --- a/PySide/QtGui/glue/qlayout_help_functions.h +++ b/PySide/QtGui/glue/qlayout_help_functions.h @@ -63,9 +63,8 @@ inline void addLayoutOwnership(QLayout* layout, QLayoutItem* item) addLayoutOwnership(layout, l); } - Shiboken::AutoDecRef pyParent(Shiboken::Converter::toPython(layout)); Shiboken::AutoDecRef pyChild(Shiboken::Converter::toPython(item)); - Shiboken::Object::setParent(pyParent, pyChild); + Shiboken::Object::releaseOwnership(pyChild); } #endif diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml index 9d6898b03..c1628f362 100644 --- a/PySide/QtGui/typesystem_gui_common.xml +++ b/PySide/QtGui/typesystem_gui_common.xml @@ -3237,6 +3237,14 @@ + + + + + + addLayoutOwnership(%CPPSELF, %0); + + -- cgit v1.2.3