aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtGui/typesystem_gui_common.xml
diff options
context:
space:
mode:
Diffstat (limited to 'PySide/QtGui/typesystem_gui_common.xml')
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml42
1 files changed, 42 insertions, 0 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 626c249bc..c35a759b2 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -2370,6 +2370,10 @@
<modify-argument index="3">
<replace-default-expression with="0" />
</modify-argument>
+ <modify-argument index="return">
+ <parent index="this" action="add"/>
+ </modify-argument>
+
<inject-code class="target" position="beginning">
%PYARG_0 = addActionWithPyObject(%CPPSELF, QIcon(), %1, %2, %3);
</inject-code>
@@ -2379,11 +2383,25 @@
<modify-argument index="4">
<replace-default-expression with="0" />
</modify-argument>
+ <modify-argument index="return">
+ <parent index="this" action="add"/>
+ </modify-argument>
+
<inject-code class="target" position="beginning">
%PYARG_0 = addActionWithPyObject(%CPPSELF, %1, %2, %3, %4);
</inject-code>
</add-function>
+ <modify-function signature="clear()">
+ <inject-code>
+ foreach(QAction *act, %CPPSELF.actions()) {
+ Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));
+ Shiboken::Object::setParent(NULL, pyAct);
+ Shiboken::Object::invalidate(pyAct);
+ }
+ </inject-code>
+ </modify-function>
+
</object-type>
<object-type name="QMenuBar">
@@ -2434,6 +2452,15 @@
<parent index="this" action="add"/>
</modify-argument>
</modify-function>
+ <modify-function signature="clear()">
+ <inject-code>
+ foreach(QAction *act, %CPPSELF.actions()) {
+ Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));
+ Shiboken::Object::setParent(NULL, pyAct);
+ Shiboken::Object::invalidate(pyAct);
+ }
+ </inject-code>
+ </modify-function>
</object-type>
<object-type name="QMotifStyle">
<!--### Obsolete in 4.3-->
@@ -5123,6 +5150,10 @@
<modify-argument index="4">
<remove-argument />
</modify-argument>
+ <modify-argument index="return">
+ <parent index="this" action="add"/>
+ </modify-argument>
+
<inject-code>
QAction* action = %CPPSELF.addAction(%1, %2);
%PYARG_0 = %CONVERTTOPYTHON[QAction*](action);
@@ -5136,6 +5167,9 @@
<modify-argument index="3">
<remove-argument />
</modify-argument>
+ <modify-argument index="return">
+ <parent index="this" action="add"/>
+ </modify-argument>
<inject-code>
QAction* action = %CPPSELF.addAction(%1);
%PYARG_0 = %CONVERTTOPYTHON[QAction*](action);
@@ -5189,6 +5223,14 @@
lst &lt;&lt; pyChild;
}
}
+
+ //Remove actions
+ foreach(QAction *act, %CPPSELF.actions()) {
+ Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));
+ Shiboken::Object::setParent(NULL, pyAct);
+ Shiboken::Object::invalidate(pyAct);
+ }
+
%CPPSELF.clear();
foreach(PyObject* obj, lst) {
Shiboken::Object::invalidate(reinterpret_cast&lt;SbkObject* &gt;(obj));