summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-09-19 16:01:42 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-09-19 17:36:27 -0300
commit332770d140f2f610d433f64b0a6183c21e4f7293 (patch)
treeade1f11137c83c42ba925ea69f16959bf1aab48f
parent60f657f0174e8e95e1d30a605dd87d70d64f73cd (diff)
downloadpyside-332770d140f2f610d433f64b0a6183c21e4f7293.tar.gz
pyside-332770d140f2f610d433f64b0a6183c21e4f7293.tar.xz
pyside-332770d140f2f610d433f64b0a6183c21e4f7293.zip
Fix QLayout.itemAt and QGridLayout.itemAtPosition return policy.
Fixes bug #1006. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--PySide/QtGui/glue/qlayout_help_functions.h3
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml8
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 90c950a..6912fc8 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<QLayout*>::toPython(layout));
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QLayoutItem*>::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 9d6898b..c1628f3 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -3237,6 +3237,14 @@
<extra-includes>
<include file-name="glue/qlayout_help_functions.h" location="local"/>
</extra-includes>
+ <modify-function signature="itemAtPosition (int, int) const">
+ <modify-argument index="return">
+ <define-ownership owner="default"/>
+ </modify-argument>
+ <inject-code class="target" position="end">
+ addLayoutOwnership(%CPPSELF, %0);
+ </inject-code>
+ </modify-function>
<modify-function signature="addWidget(QWidget *, int, int, QFlags&lt;Qt::AlignmentFlag&gt;)">
<modify-argument index="4">
<rename to="alignment"/>