aboutsummaryrefslogtreecommitdiffstats
path: root/PySide
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2010-11-18 11:02:03 -0300
committerRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2010-11-19 15:15:12 -0300
commit5e0550446c3546beb4a7076a80a7475b394567f4 (patch)
tree4709c72e275bdc1c54c914ccedfa11ec07af200e /PySide
parent098946263932e115bdbca17eb51c3a27848435e2 (diff)
Updated to new shiboken API.
Reviewer: Hugo Parente Lima <hugo.pl@gmail.com> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'PySide')
-rw-r--r--PySide/QtCore/typesystem_core.xml15
-rw-r--r--PySide/QtGui/glue/qlayout_help_functions.h6
-rw-r--r--PySide/QtGui/glue/qwidget_glue.h6
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml26
-rw-r--r--PySide/QtUiTools/glue/uitools_loadui.h2
-rw-r--r--PySide/QtWebKit/typesystem_webkit.xml2
-rw-r--r--PySide/typesystem_templates.xml6
7 files changed, 31 insertions, 32 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index b048bf09d..83fd2ed81 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1129,7 +1129,7 @@
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME());
</inject-code>
<modify-argument index="return">
- <parent index="this" action="add"/>
+ <reference-count action="add"/>
</modify-argument>
</modify-function>
<modify-function signature="deleteLater()">
@@ -1941,8 +1941,7 @@
%PYARG_2,
%3)
);
- // invalidate to avoid use of python object
- Shiboken::BindingManager::instance().destroyWrapper((SbkObject*)pyTimer);
+ Shiboken::Wrapper::invalidate((SbkObject*)pyTimer);
timer->setSingleShot(true);
timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
timer->start(%1);
@@ -1952,7 +1951,7 @@
<inject-code class="target" position="beginning">
// %FUNCTION_NAME() - disable generation of c++ function call
Shiboken::AutoDecRef emptyTuple(PyTuple_New(0));
- PyObject* pyTimer = Shiboken::SbkType&lt;QTimer>()->tp_new(Shiboken::SbkType&lt;QTimer>(), emptyTuple, 0);
+ PyObject *pyTimer = Shiboken::SbkType&lt;QTimer>()->tp_new(Shiboken::SbkType&lt;QTimer>(), emptyTuple, 0);
Shiboken::SbkType&lt;QTimer>()->tp_init(pyTimer, emptyTuple, 0);
QTimer* timer = Converter&lt;QTimer*>::toCpp(pyTimer);
timer->setSingleShot(true);
@@ -1980,7 +1979,7 @@
pyargs[1])
);
}
- Shiboken::BindingManager::instance().destroyWrapper((SbkObject*)pyTimer);
+ Shiboken::Wrapper::invalidate((SbkObject*)pyTimer);
timer->start(%1);
</inject-code>
</add-function>
@@ -2568,7 +2567,7 @@
<inject-code class="target" position="beginning">
for(int counter = 0; counter &lt; %CPPSELF.animationCount(); ++counter ) {
PyObject* obj = %CONVERTTOPYTHON[QAbstractAnimation*](%CPPSELF.animationAt(counter));
- Shiboken::setParent(NULL, obj);
+ Shiboken::Wrapper::setParent(NULL, obj);
Py_DECREF(obj);
}
%CPPSELF.clear();
@@ -2722,7 +2721,7 @@
%PYARG_0 = PySet_New(0);
foreach(QAbstractState* abs_state, %CPPSELF.configuration()) {
Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractState*](abs_state));
- Shiboken::setParent(self, obj);
+ Shiboken::Wrapper::setParent(self, obj);
PySet_Add(%PYARG_0, obj);
}
</inject-code>
@@ -2733,7 +2732,7 @@
%PYARG_0 = PyList_New(0);
foreach(QAbstractAnimation* abs_anim, %CPPSELF.defaultAnimations()) {
Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractAnimation*](abs_anim));
- Shiboken::setParent(self, obj);
+ Shiboken::Wrapper::setParent(self, obj);
PyList_Append(%PYARG_0, obj);
}
</inject-code>
diff --git a/PySide/QtGui/glue/qlayout_help_functions.h b/PySide/QtGui/glue/qlayout_help_functions.h
index 452dbc181..8d899eab5 100644
--- a/PySide/QtGui/glue/qlayout_help_functions.h
+++ b/PySide/QtGui/glue/qlayout_help_functions.h
@@ -22,7 +22,7 @@ inline void addLayoutOwnership(QLayout* layout, QWidget* widget)
} else {
Shiboken::AutoDecRef pyParent(Shiboken::Converter<QWidget*>::toPython(parent));
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QWidget*>::toPython(widget));
- Shiboken::setParent(pyParent, pyChild);
+ Shiboken::Wrapper::setParent(pyParent, pyChild);
}
}
@@ -48,7 +48,7 @@ inline void addLayoutOwnership(QLayout* layout, QLayout* other)
Shiboken::AutoDecRef pyParent(Shiboken::Converter<QLayout*>::toPython(layout));
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QLayout*>::toPython(other));
- Shiboken::setParent(pyParent, pyChild);
+ Shiboken::Wrapper::setParent(pyParent, pyChild);
}
@@ -65,7 +65,7 @@ inline void addLayoutOwnership(QLayout* layout, QLayoutItem* item)
Shiboken::AutoDecRef pyParent(Shiboken::Converter<QLayout*>::toPython(layout));
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QLayoutItem*>::toPython(item));
- Shiboken::setParent(pyParent, pyChild);
+ Shiboken::Wrapper::setParent(pyParent, pyChild);
}
#endif
diff --git a/PySide/QtGui/glue/qwidget_glue.h b/PySide/QtGui/glue/qwidget_glue.h
index d067d9f39..33e8a7f55 100644
--- a/PySide/QtGui/glue/qwidget_glue.h
+++ b/PySide/QtGui/glue/qwidget_glue.h
@@ -22,7 +22,7 @@ static inline void qwidgetReparentLayout(QWidget *parent, QLayout *layout)
QWidget* pw = w->parentWidget();
if (pw != parent) {
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QWidget*>::toPython(w));
- Shiboken::setParent(pyParent, pyChild);
+ Shiboken::Wrapper::setParent(pyParent, pyChild);
}
} else {
QLayout* l = item->layout();
@@ -32,7 +32,7 @@ static inline void qwidgetReparentLayout(QWidget *parent, QLayout *layout)
}
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QLayout*>::toPython(layout));
- Shiboken::setParent(pyParent, pyChild);
+ Shiboken::Wrapper::setParent(pyParent, pyChild);
//remove previous references
Shiboken::keepReference(reinterpret_cast<SbkObject*>(pyChild.object()), qPrintable(retrieveObjectName(pyChild)), Py_None);
}
@@ -47,7 +47,7 @@ static inline void qwidgetSetLayout(QWidget *self, QLayout *layout)
if (oldParent->isWidgetType()) {
// remove old parent policy
Shiboken::AutoDecRef pyLayout(Shiboken::Converter<QLayout*>::toPython(layout));
- Shiboken::setParent(Py_None, pyLayout);
+ Shiboken::Wrapper::setParent(Py_None, pyLayout);
} else {
PyErr_Format(PyExc_RuntimeError, "QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", when the QLayout already has a parent",
qPrintable(layout->objectName()), self->metaObject()->className(), qPrintable(self->objectName()));
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 04ad22a8d..ca7bc27b2 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -1621,7 +1621,7 @@
<reference-count action="add"/>
</modify-argument>
<inject-code>
- BindingManager::instance().transferOwnershipToCpp(%PYARG_2);
+ Shiboken::Wrapper::releaseOwnership(%PYARG_2);
</inject-code>
</modify-function>
<modify-function signature="setDefaultFactory(QItemEditorFactory *)">
@@ -1955,7 +1955,7 @@
<inject-code class="target" position="end">
Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "connect", "OsO", %PYSELF, SIGNAL(activated()), %PYARG_3));
if (!result.isNull())
- Shiboken::setParent(%PYARG_2, %PYSELF);
+ Shiboken::Wrapper::setParent(%PYARG_2, %PYSELF);
</inject-code>
</add-function>
</object-type>
@@ -2018,7 +2018,7 @@
QStandardItem* _i = %CPPSELF->child(%1, %2);
if (_i) {
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::setParent(0, _pyI);
+ Shiboken::Wrapper::setParent(0, _pyI);
}
</inject-code>
<modify-argument index="3">
@@ -2031,7 +2031,7 @@
QStandardItem* _i = %CPPSELF->child(%1);
if (_i) {
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::setParent(0, _pyI);
+ Shiboken::Wrapper::setParent(0, _pyI);
}
</inject-code>
<modify-argument index="2">
@@ -2170,7 +2170,7 @@
QWidget *_widget = %CPPSELF.widget(%1);
if (_widget) {
Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](_widget));
- Shiboken::setParent(0, pyWidget);
+ Shiboken::Wrapper::setParent(0, pyWidget);
}
</inject-code>
</modify-function>
@@ -3328,7 +3328,7 @@
QStyle *appStyle = qApp->style();
if (appStyle == myStyle) {
Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication*](qApp));
- Shiboken::setParent(pyApp, %PYARG_0);
+ Shiboken::Wrapper::setParent(pyApp, %PYARG_0);
Shiboken::Wrapper::releaseOwnership(%PYARG_0);
} else {
Shiboken::keepReference(reinterpret_cast&lt;SbkObject*&gt;(%PYSELF), "__style__", %PYARG_0);
@@ -3586,7 +3586,7 @@
QWidget* tab = %CPPSELF.widget(%1);
if (tab) {
Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](tab));
- Shiboken::setParent(0, pyWidget);
+ Shiboken::Wrapper::setParent(0, pyWidget);
%CPPSELF.%FUNCTION_NAME(%1);
}
</inject-code>
@@ -3595,7 +3595,7 @@
<inject-code class="target" position="beginning">
for (int i=0; i &lt; %CPPSELF.count(); i++) {
Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](%CPPSELF.widget(i)));
- Shiboken::setParent(0, pyWidget);
+ Shiboken::Wrapper::setParent(0, pyWidget);
}
%CPPSELF.%FUNCTION_NAME();
</inject-code>
@@ -3853,7 +3853,7 @@
QStandardItem* _i = %CPPSELF->item(%1, %2);
if (_i) {
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::setParent(0, _pyI);
+ Shiboken::Wrapper::setParent(0, _pyI);
}
</inject-code>
<modify-argument index="3">
@@ -3866,7 +3866,7 @@
QStandardItem* _i = %CPPSELF->item(%1);
if (_i) {
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::setParent(0, _pyI);
+ Shiboken::Wrapper::setParent(0, _pyI);
}
</inject-code>
<modify-argument index="2">
@@ -3885,7 +3885,7 @@
QStandardItem* _i = %CPPSELF->verticalHeaderItem(%1);
if (_i) {
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
- Shiboken::setParent(0, _pyI);
+ Shiboken::Wrapper::setParent(0, _pyI);
}
</inject-code>
<modify-argument index="2">
@@ -3935,7 +3935,7 @@
QList&lt;QStandardItem *&gt; ri = %CPPSELF.takeRow(0);
PyObject *pyResult = %CONVERTTOPYTHON[QList&lt;QStandardItem * &gt;](ri);
- Shiboken::setParent(Py_None, pyResult);
+ Shiboken::Wrapper::setParent(Py_None, pyResult);
Py_XDECREF(pyResult);
}
</inject-code>
@@ -4554,7 +4554,7 @@
<!-- ownership control transfer to qApp -->
<modify-function signature="setStyle(QStyle*)">
<inject-code class="target" position="end">
- Shiboken::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_1);
+ Shiboken::Wrapper::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_1);
</inject-code>
</modify-function>
<modify-function signature="style()">
diff --git a/PySide/QtUiTools/glue/uitools_loadui.h b/PySide/QtUiTools/glue/uitools_loadui.h
index 8f6df633c..302c3e72b 100644
--- a/PySide/QtUiTools/glue/uitools_loadui.h
+++ b/PySide/QtUiTools/glue/uitools_loadui.h
@@ -20,7 +20,7 @@ _populate_parent(PyObject* pyParent, QObject *parent)
if (!has_attr)
PyObject_SetAttrString(pyParent, qPrintable(name), pyChild);
- Shiboken::setParent(pyParent, pyChild);
+ Shiboken::Wrapper::setParent(pyParent, pyChild);
_populate_parent(pyChild, qobject_cast<QObject*>(child));
}
}
diff --git a/PySide/QtWebKit/typesystem_webkit.xml b/PySide/QtWebKit/typesystem_webkit.xml
index b56a9097d..9ec7c7569 100644
--- a/PySide/QtWebKit/typesystem_webkit.xml
+++ b/PySide/QtWebKit/typesystem_webkit.xml
@@ -41,7 +41,7 @@
<inject-code position="end">
SbkObject* _pyReturn = reinterpret_cast&lt;SbkObject*&gt;(%PYARG_0);
if (!Shiboken::Wrapper::hasParentInfo(_pyReturn))
- Shiboken::setParent(%PYSELF, %PYARG_0);
+ Shiboken::Wrapper::setParent(%PYSELF, %PYARG_0);
</inject-code>
</modify-function>
<modify-function signature="print(QPrinter*)const" rename="print_" />
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index 968195fa1..6bc814d17 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -23,9 +23,9 @@
$CHILD_TYPE* oldChild = %CPPSELF.$FUNCTION_GET_OLD();
if (oldChild) {
Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[$CHILD_TYPE*](oldChild));
- Shiboken::setParent(NULL, pyChild);
+ Shiboken::Wrapper::setParent(NULL, pyChild);
}
- Shiboken::setParent(%PYSELF, $PYARG);
+ Shiboken::Wrapper::setParent(%PYSELF, $PYARG);
</template>
<!-- Templates to fix bool* parameters -->
@@ -184,7 +184,7 @@
<template name="set_qapp_parent_for_orphan">
SbkObject* _pySelf = reinterpret_cast&lt;SbkObject*&gt;(%PYARG_0);
if (!Shiboken::Wrapper::hasParentInfo(_pySelf))
- Shiboken::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_0);
+ Shiboken::Wrapper::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_0);
</template>
<!-- templates for __reduce__ -->
<template name="reduce_code">