summaryrefslogtreecommitdiffstats
path: root/PySide
diff options
context:
space:
mode:
authorrenatofilho <renato.filho@openbossa.org>2010-09-20 18:31:49 -0300
committerrenatofilho <renato.filho@openbossa.org>2010-09-20 19:05:16 -0300
commitf8a12b7577773f6a02804e1e60920a964f5e01ca (patch)
treee195bbc7f648a62bfadf9b0bd63448a901963e53 /PySide
parentae44c27bb06c721b783a311111efd66465f681fd (diff)
downloadpyside-f8a12b7577773f6a02804e1e60920a964f5e01ca.tar.gz
pyside-f8a12b7577773f6a02804e1e60920a964f5e01ca.tar.xz
pyside-f8a12b7577773f6a02804e1e60920a964f5e01ca.zip
Fixed ownership rules for QStandardItem functions.
Fixes bug #367. Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'PySide')
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml112
1 files changed, 105 insertions, 7 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 2237278..0ffdf90 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -2004,6 +2004,77 @@
<modify-function signature="write(QDataStream&amp;)const">
<modify-argument index="1" invalidate-after-use="yes"/>
</modify-function>
+
+ <modify-function signature="appendColumn(const QList&lt;QStandardItem *&gt; &amp;)">
+ <modify-argument index="1">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="appendRow(const QList&lt;QStandardItem *&gt; &amp;)">
+ <modify-argument index="1">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="appendRow(QStandardItem *)">
+ <modify-argument index="1">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="appendRows(const QList&lt;QStandardItem *&gt; &amp;)">
+ <modify-argument index="1">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+
+ <modify-function signature="insertColumn(int, const QList&lt;QStandardItem *&gt; &amp;)">
+ <modify-argument index="2">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="insertRow(int, const QList&lt;QStandardItem *&gt; &amp;)">
+ <modify-argument index="2">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="insertRows(int, const QList&lt;QStandardItem *&gt; &amp;)">
+ <modify-argument index="2">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+
+ <modify-function signature="setChild(int, int, QStandardItem *)">
+ <inject-code class="target" position="beginning">
+ // Clear parent from the old child
+ QStandardItem* _i = %CPPSELF->child(%1, %2);
+ if (_i) {
+ PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::setParent(0, _pyI);
+ }
+ </inject-code>
+ <modify-argument index="3">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="setChild(int, QStandardItem *)">
+ <inject-code class="target" position="beginning">
+ // Clear parent from the old child
+ QStandardItem* _i = %CPPSELF->child(%1);
+ if (_i) {
+ PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::setParent(0, _pyI);
+ }
+ </inject-code>
+ <modify-argument index="2">
+ <parent index="this" action="add"/>
+ </modify-argument>
+ </modify-function>
+
+ <modify-function signature="takeChild(int, int)">
+ <modify-argument index="return">
+ <parent index="this" action="remove"/>
+ </modify-argument>
+ </modify-function>
+
<modify-function signature="read(QDataStream &amp;)" remove="all"/>
<modify-function signature="write(QDataStream &amp;)const" remove="all"/>
<modify-function signature="operator&lt;(QStandardItem)const" remove="all"/>
@@ -3628,11 +3699,18 @@
<parent index="this" action="add" />
</modify-argument>
</modify-function>
- <modify-function signature="appendRow(QStandardItem *)">
+
+ <modify-function signature="appendRow(const QList&lt;QStandardItem *&gt;&amp;)">
<modify-argument index="1">
<parent index="this" action="add" />
</modify-argument>
</modify-function>
+ <modify-function signature="appendRow(QStandardItem *)">
+ <modify-argument index="1">
+ <parent index="this" action="add" />
+ </modify-argument>
+ </modify-function>
+
<modify-function signature="insertRow(int, QStandardItem *)">
<modify-argument index="2">
<parent index="this" action="add" />
@@ -3643,12 +3721,29 @@
<parent index="this" action="add" />
</modify-argument>
</modify-function>
+
<modify-function signature="setItem(int, int, QStandardItem *)">
+ <inject-code class="target" position="beginning">
+ // Clear parent from the old child
+ QStandardItem* _i = %CPPSELF->item(%1, %2);
+ if (_i) {
+ PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::setParent(0, _pyI);
+ }
+ </inject-code>
<modify-argument index="3">
<parent index="this" action="add" />
</modify-argument>
</modify-function>
<modify-function signature="setItem(int, QStandardItem *)">
+ <inject-code class="target" position="beginning">
+ // Clear parent from the old child
+ QStandardItem* _i = %CPPSELF->item(%1);
+ if (_i) {
+ PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::setParent(0, _pyI);
+ }
+ </inject-code>
<modify-argument index="2">
<parent index="this" action="add" />
</modify-argument>
@@ -3658,7 +3753,16 @@
<parent index="this" action="add" />
</modify-argument>
</modify-function>
+
<modify-function signature="setVerticalHeaderItem(int, QStandardItem *)">
+ <inject-code class="target" position="beginning">
+ // Clear parent from the old child
+ QStandardItem* _i = %CPPSELF->verticalHeaderItem(%1);
+ if (_i) {
+ PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ Shiboken::setParent(0, _pyI);
+ }
+ </inject-code>
<modify-argument index="2">
<parent index="this" action="add" />
</modify-argument>
@@ -3694,12 +3798,6 @@
</modify-argument>
</modify-function>
- <modify-function signature="appendRow(const QList&lt;QStandardItem *&gt;&amp;)">
- <modify-argument index="1">
- <parent index="this" action="add" />
- </modify-argument>
- </modify-function>
-
<modify-function signature="appendColumn(const QList&lt;QStandardItem *&gt;&amp;)">
<modify-argument index="1">
<parent index="this" action="add" />