diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-07-04 10:33:15 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:54:31 -0300 |
commit | d82b8dbd8d01e0c52491c8b801675acc9bc7a6c9 (patch) | |
tree | 800006fc293c43557ed6ded8de53b10792d5d242 /PySide | |
parent | da39716cc95ca03f20c32928709b092a1989ce26 (diff) |
Fixed QMainWindow ownership control.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'PySide')
-rw-r--r-- | PySide/QtGui/typesystem_gui_common.xml | 6 | ||||
-rw-r--r-- | PySide/typesystem_templates.xml | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml index d3473d450..c8ad97e14 100644 --- a/PySide/QtGui/typesystem_gui_common.xml +++ b/PySide/QtGui/typesystem_gui_common.xml @@ -2134,6 +2134,7 @@ <replace from="$FUNCTION_GET_OLD" to="centralWidget" /> <replace from="$CHILD_TYPE" to="QWidget" /> <replace from="$PYARG" to="%PYARG_1" /> + <replace from="$CPPARG" to="%1" /> </insert-template> </inject-code> </modify-function> @@ -2144,16 +2145,18 @@ <replace from="$FUNCTION_GET_OLD" to="menuBar" /> <replace from="$CHILD_TYPE" to="QMenuBar" /> <replace from="$PYARG" to="%PYARG_1" /> + <replace from="$CPPARG" to="%1" /> </insert-template> </inject-code> </modify-function> - <modify-function signature="setMenuWidget(QWidget*)"> + <modify-function signature="setMenuWidget(QWidget*)"> <inject-code class="target" position="beginning"> <insert-template name="replace_child"> <replace from="$FUNCTION_GET_OLD" to="menuWidget" /> <replace from="$CHILD_TYPE" to="QWidget" /> <replace from="$PYARG" to="%PYARG_1" /> + <replace from="$CPPARG" to="%1" /> </insert-template> </inject-code> </modify-function> @@ -2164,6 +2167,7 @@ <replace from="$FUNCTION_GET_OLD" to="statusBar" /> <replace from="$CHILD_TYPE" to="QStatusBar" /> <replace from="$PYARG" to="%PYARG_1" /> + <replace from="$CPPARG" to="%1" /> </insert-template> </inject-code> </modify-function> diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml index 3a46c620f..9c2be1e7f 100644 --- a/PySide/typesystem_templates.xml +++ b/PySide/typesystem_templates.xml @@ -21,9 +21,10 @@ <typesystem> <template name="replace_child"> $CHILD_TYPE* oldChild = %CPPSELF.$FUNCTION_GET_OLD(); - if (oldChild) { + if (oldChild && (oldChild != $CPPARG)) { Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[$CHILD_TYPE*](oldChild)); - Shiboken::Object::setParent(NULL, pyChild); + Shiboken::Object::setParent(0, pyChild); + Shiboken::Object::releaseOwnership(pyChild); } Shiboken::Object::setParent(%PYSELF, $PYARG); </template> |