Updated to new shiboken API.
Reviewer: Hugo Parente Lima <hugo.pl@gmail.com>
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
0989462639
commit
5e0550446c
9 changed files with 34 additions and 37 deletions
|
|
@ -1129,7 +1129,7 @@
|
||||||
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME());
|
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME());
|
||||||
</inject-code>
|
</inject-code>
|
||||||
<modify-argument index="return">
|
<modify-argument index="return">
|
||||||
<parent index="this" action="add"/>
|
<reference-count action="add"/>
|
||||||
</modify-argument>
|
</modify-argument>
|
||||||
</modify-function>
|
</modify-function>
|
||||||
<modify-function signature="deleteLater()">
|
<modify-function signature="deleteLater()">
|
||||||
|
|
@ -1941,8 +1941,7 @@
|
||||||
%PYARG_2,
|
%PYARG_2,
|
||||||
%3)
|
%3)
|
||||||
);
|
);
|
||||||
// invalidate to avoid use of python object
|
Shiboken::Wrapper::invalidate((SbkObject*)pyTimer);
|
||||||
Shiboken::BindingManager::instance().destroyWrapper((SbkObject*)pyTimer);
|
|
||||||
timer->setSingleShot(true);
|
timer->setSingleShot(true);
|
||||||
timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
|
timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
|
||||||
timer->start(%1);
|
timer->start(%1);
|
||||||
|
|
@ -1980,7 +1979,7 @@
|
||||||
pyargs[1])
|
pyargs[1])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Shiboken::BindingManager::instance().destroyWrapper((SbkObject*)pyTimer);
|
Shiboken::Wrapper::invalidate((SbkObject*)pyTimer);
|
||||||
timer->start(%1);
|
timer->start(%1);
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</add-function>
|
</add-function>
|
||||||
|
|
@ -2568,7 +2567,7 @@
|
||||||
<inject-code class="target" position="beginning">
|
<inject-code class="target" position="beginning">
|
||||||
for(int counter = 0; counter < %CPPSELF.animationCount(); ++counter ) {
|
for(int counter = 0; counter < %CPPSELF.animationCount(); ++counter ) {
|
||||||
PyObject* obj = %CONVERTTOPYTHON[QAbstractAnimation*](%CPPSELF.animationAt(counter));
|
PyObject* obj = %CONVERTTOPYTHON[QAbstractAnimation*](%CPPSELF.animationAt(counter));
|
||||||
Shiboken::setParent(NULL, obj);
|
Shiboken::Wrapper::setParent(NULL, obj);
|
||||||
Py_DECREF(obj);
|
Py_DECREF(obj);
|
||||||
}
|
}
|
||||||
%CPPSELF.clear();
|
%CPPSELF.clear();
|
||||||
|
|
@ -2722,7 +2721,7 @@
|
||||||
%PYARG_0 = PySet_New(0);
|
%PYARG_0 = PySet_New(0);
|
||||||
foreach(QAbstractState* abs_state, %CPPSELF.configuration()) {
|
foreach(QAbstractState* abs_state, %CPPSELF.configuration()) {
|
||||||
Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractState*](abs_state));
|
Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractState*](abs_state));
|
||||||
Shiboken::setParent(self, obj);
|
Shiboken::Wrapper::setParent(self, obj);
|
||||||
PySet_Add(%PYARG_0, obj);
|
PySet_Add(%PYARG_0, obj);
|
||||||
}
|
}
|
||||||
</inject-code>
|
</inject-code>
|
||||||
|
|
@ -2733,7 +2732,7 @@
|
||||||
%PYARG_0 = PyList_New(0);
|
%PYARG_0 = PyList_New(0);
|
||||||
foreach(QAbstractAnimation* abs_anim, %CPPSELF.defaultAnimations()) {
|
foreach(QAbstractAnimation* abs_anim, %CPPSELF.defaultAnimations()) {
|
||||||
Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractAnimation*](abs_anim));
|
Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractAnimation*](abs_anim));
|
||||||
Shiboken::setParent(self, obj);
|
Shiboken::Wrapper::setParent(self, obj);
|
||||||
PyList_Append(%PYARG_0, obj);
|
PyList_Append(%PYARG_0, obj);
|
||||||
}
|
}
|
||||||
</inject-code>
|
</inject-code>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ inline void addLayoutOwnership(QLayout* layout, QWidget* widget)
|
||||||
} else {
|
} else {
|
||||||
Shiboken::AutoDecRef pyParent(Shiboken::Converter<QWidget*>::toPython(parent));
|
Shiboken::AutoDecRef pyParent(Shiboken::Converter<QWidget*>::toPython(parent));
|
||||||
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QWidget*>::toPython(widget));
|
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 pyParent(Shiboken::Converter<QLayout*>::toPython(layout));
|
||||||
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QLayout*>::toPython(other));
|
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 pyParent(Shiboken::Converter<QLayout*>::toPython(layout));
|
||||||
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QLayoutItem*>::toPython(item));
|
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QLayoutItem*>::toPython(item));
|
||||||
Shiboken::setParent(pyParent, pyChild);
|
Shiboken::Wrapper::setParent(pyParent, pyChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ static inline void qwidgetReparentLayout(QWidget *parent, QLayout *layout)
|
||||||
QWidget* pw = w->parentWidget();
|
QWidget* pw = w->parentWidget();
|
||||||
if (pw != parent) {
|
if (pw != parent) {
|
||||||
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QWidget*>::toPython(w));
|
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QWidget*>::toPython(w));
|
||||||
Shiboken::setParent(pyParent, pyChild);
|
Shiboken::Wrapper::setParent(pyParent, pyChild);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QLayout* l = item->layout();
|
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::AutoDecRef pyChild(Shiboken::Converter<QLayout*>::toPython(layout));
|
||||||
Shiboken::setParent(pyParent, pyChild);
|
Shiboken::Wrapper::setParent(pyParent, pyChild);
|
||||||
//remove previous references
|
//remove previous references
|
||||||
Shiboken::keepReference(reinterpret_cast<SbkObject*>(pyChild.object()), qPrintable(retrieveObjectName(pyChild)), Py_None);
|
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()) {
|
if (oldParent->isWidgetType()) {
|
||||||
// remove old parent policy
|
// remove old parent policy
|
||||||
Shiboken::AutoDecRef pyLayout(Shiboken::Converter<QLayout*>::toPython(layout));
|
Shiboken::AutoDecRef pyLayout(Shiboken::Converter<QLayout*>::toPython(layout));
|
||||||
Shiboken::setParent(Py_None, pyLayout);
|
Shiboken::Wrapper::setParent(Py_None, pyLayout);
|
||||||
} else {
|
} else {
|
||||||
PyErr_Format(PyExc_RuntimeError, "QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", when the QLayout already has a parent",
|
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()));
|
qPrintable(layout->objectName()), self->metaObject()->className(), qPrintable(self->objectName()));
|
||||||
|
|
|
||||||
|
|
@ -1621,7 +1621,7 @@
|
||||||
<reference-count action="add"/>
|
<reference-count action="add"/>
|
||||||
</modify-argument>
|
</modify-argument>
|
||||||
<inject-code>
|
<inject-code>
|
||||||
BindingManager::instance().transferOwnershipToCpp(%PYARG_2);
|
Shiboken::Wrapper::releaseOwnership(%PYARG_2);
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</modify-function>
|
</modify-function>
|
||||||
<modify-function signature="setDefaultFactory(QItemEditorFactory *)">
|
<modify-function signature="setDefaultFactory(QItemEditorFactory *)">
|
||||||
|
|
@ -1955,7 +1955,7 @@
|
||||||
<inject-code class="target" position="end">
|
<inject-code class="target" position="end">
|
||||||
Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "connect", "OsO", %PYSELF, SIGNAL(activated()), %PYARG_3));
|
Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "connect", "OsO", %PYSELF, SIGNAL(activated()), %PYARG_3));
|
||||||
if (!result.isNull())
|
if (!result.isNull())
|
||||||
Shiboken::setParent(%PYARG_2, %PYSELF);
|
Shiboken::Wrapper::setParent(%PYARG_2, %PYSELF);
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</add-function>
|
</add-function>
|
||||||
</object-type>
|
</object-type>
|
||||||
|
|
@ -2018,7 +2018,7 @@
|
||||||
QStandardItem* _i = %CPPSELF->child(%1, %2);
|
QStandardItem* _i = %CPPSELF->child(%1, %2);
|
||||||
if (_i) {
|
if (_i) {
|
||||||
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
|
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
|
||||||
Shiboken::setParent(0, _pyI);
|
Shiboken::Wrapper::setParent(0, _pyI);
|
||||||
}
|
}
|
||||||
</inject-code>
|
</inject-code>
|
||||||
<modify-argument index="3">
|
<modify-argument index="3">
|
||||||
|
|
@ -2031,7 +2031,7 @@
|
||||||
QStandardItem* _i = %CPPSELF->child(%1);
|
QStandardItem* _i = %CPPSELF->child(%1);
|
||||||
if (_i) {
|
if (_i) {
|
||||||
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
|
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
|
||||||
Shiboken::setParent(0, _pyI);
|
Shiboken::Wrapper::setParent(0, _pyI);
|
||||||
}
|
}
|
||||||
</inject-code>
|
</inject-code>
|
||||||
<modify-argument index="2">
|
<modify-argument index="2">
|
||||||
|
|
@ -2170,7 +2170,7 @@
|
||||||
QWidget *_widget = %CPPSELF.widget(%1);
|
QWidget *_widget = %CPPSELF.widget(%1);
|
||||||
if (_widget) {
|
if (_widget) {
|
||||||
Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](_widget));
|
Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](_widget));
|
||||||
Shiboken::setParent(0, pyWidget);
|
Shiboken::Wrapper::setParent(0, pyWidget);
|
||||||
}
|
}
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</modify-function>
|
</modify-function>
|
||||||
|
|
@ -3328,7 +3328,7 @@
|
||||||
QStyle *appStyle = qApp->style();
|
QStyle *appStyle = qApp->style();
|
||||||
if (appStyle == myStyle) {
|
if (appStyle == myStyle) {
|
||||||
Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication*](qApp));
|
Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication*](qApp));
|
||||||
Shiboken::setParent(pyApp, %PYARG_0);
|
Shiboken::Wrapper::setParent(pyApp, %PYARG_0);
|
||||||
Shiboken::Wrapper::releaseOwnership(%PYARG_0);
|
Shiboken::Wrapper::releaseOwnership(%PYARG_0);
|
||||||
} else {
|
} else {
|
||||||
Shiboken::keepReference(reinterpret_cast<SbkObject*>(%PYSELF), "__style__", %PYARG_0);
|
Shiboken::keepReference(reinterpret_cast<SbkObject*>(%PYSELF), "__style__", %PYARG_0);
|
||||||
|
|
@ -3586,7 +3586,7 @@
|
||||||
QWidget* tab = %CPPSELF.widget(%1);
|
QWidget* tab = %CPPSELF.widget(%1);
|
||||||
if (tab) {
|
if (tab) {
|
||||||
Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](tab));
|
Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](tab));
|
||||||
Shiboken::setParent(0, pyWidget);
|
Shiboken::Wrapper::setParent(0, pyWidget);
|
||||||
%CPPSELF.%FUNCTION_NAME(%1);
|
%CPPSELF.%FUNCTION_NAME(%1);
|
||||||
}
|
}
|
||||||
</inject-code>
|
</inject-code>
|
||||||
|
|
@ -3595,7 +3595,7 @@
|
||||||
<inject-code class="target" position="beginning">
|
<inject-code class="target" position="beginning">
|
||||||
for (int i=0; i < %CPPSELF.count(); i++) {
|
for (int i=0; i < %CPPSELF.count(); i++) {
|
||||||
Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](%CPPSELF.widget(i)));
|
Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](%CPPSELF.widget(i)));
|
||||||
Shiboken::setParent(0, pyWidget);
|
Shiboken::Wrapper::setParent(0, pyWidget);
|
||||||
}
|
}
|
||||||
%CPPSELF.%FUNCTION_NAME();
|
%CPPSELF.%FUNCTION_NAME();
|
||||||
</inject-code>
|
</inject-code>
|
||||||
|
|
@ -3853,7 +3853,7 @@
|
||||||
QStandardItem* _i = %CPPSELF->item(%1, %2);
|
QStandardItem* _i = %CPPSELF->item(%1, %2);
|
||||||
if (_i) {
|
if (_i) {
|
||||||
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
|
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
|
||||||
Shiboken::setParent(0, _pyI);
|
Shiboken::Wrapper::setParent(0, _pyI);
|
||||||
}
|
}
|
||||||
</inject-code>
|
</inject-code>
|
||||||
<modify-argument index="3">
|
<modify-argument index="3">
|
||||||
|
|
@ -3866,7 +3866,7 @@
|
||||||
QStandardItem* _i = %CPPSELF->item(%1);
|
QStandardItem* _i = %CPPSELF->item(%1);
|
||||||
if (_i) {
|
if (_i) {
|
||||||
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
|
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
|
||||||
Shiboken::setParent(0, _pyI);
|
Shiboken::Wrapper::setParent(0, _pyI);
|
||||||
}
|
}
|
||||||
</inject-code>
|
</inject-code>
|
||||||
<modify-argument index="2">
|
<modify-argument index="2">
|
||||||
|
|
@ -3885,7 +3885,7 @@
|
||||||
QStandardItem* _i = %CPPSELF->verticalHeaderItem(%1);
|
QStandardItem* _i = %CPPSELF->verticalHeaderItem(%1);
|
||||||
if (_i) {
|
if (_i) {
|
||||||
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
|
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
|
||||||
Shiboken::setParent(0, _pyI);
|
Shiboken::Wrapper::setParent(0, _pyI);
|
||||||
}
|
}
|
||||||
</inject-code>
|
</inject-code>
|
||||||
<modify-argument index="2">
|
<modify-argument index="2">
|
||||||
|
|
@ -3935,7 +3935,7 @@
|
||||||
QList<QStandardItem *> ri = %CPPSELF.takeRow(0);
|
QList<QStandardItem *> ri = %CPPSELF.takeRow(0);
|
||||||
|
|
||||||
PyObject *pyResult = %CONVERTTOPYTHON[QList<QStandardItem * >](ri);
|
PyObject *pyResult = %CONVERTTOPYTHON[QList<QStandardItem * >](ri);
|
||||||
Shiboken::setParent(Py_None, pyResult);
|
Shiboken::Wrapper::setParent(Py_None, pyResult);
|
||||||
Py_XDECREF(pyResult);
|
Py_XDECREF(pyResult);
|
||||||
}
|
}
|
||||||
</inject-code>
|
</inject-code>
|
||||||
|
|
@ -4554,7 +4554,7 @@
|
||||||
<!-- ownership control transfer to qApp -->
|
<!-- ownership control transfer to qApp -->
|
||||||
<modify-function signature="setStyle(QStyle*)">
|
<modify-function signature="setStyle(QStyle*)">
|
||||||
<inject-code class="target" position="end">
|
<inject-code class="target" position="end">
|
||||||
Shiboken::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_1);
|
Shiboken::Wrapper::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_1);
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</modify-function>
|
</modify-function>
|
||||||
<modify-function signature="style()">
|
<modify-function signature="style()">
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ _populate_parent(PyObject* pyParent, QObject *parent)
|
||||||
if (!has_attr)
|
if (!has_attr)
|
||||||
PyObject_SetAttrString(pyParent, qPrintable(name), pyChild);
|
PyObject_SetAttrString(pyParent, qPrintable(name), pyChild);
|
||||||
|
|
||||||
Shiboken::setParent(pyParent, pyChild);
|
Shiboken::Wrapper::setParent(pyParent, pyChild);
|
||||||
_populate_parent(pyChild, qobject_cast<QObject*>(child));
|
_populate_parent(pyChild, qobject_cast<QObject*>(child));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
<inject-code position="end">
|
<inject-code position="end">
|
||||||
SbkObject* _pyReturn = reinterpret_cast<SbkObject*>(%PYARG_0);
|
SbkObject* _pyReturn = reinterpret_cast<SbkObject*>(%PYARG_0);
|
||||||
if (!Shiboken::Wrapper::hasParentInfo(_pyReturn))
|
if (!Shiboken::Wrapper::hasParentInfo(_pyReturn))
|
||||||
Shiboken::setParent(%PYSELF, %PYARG_0);
|
Shiboken::Wrapper::setParent(%PYSELF, %PYARG_0);
|
||||||
</inject-code>
|
</inject-code>
|
||||||
</modify-function>
|
</modify-function>
|
||||||
<modify-function signature="print(QPrinter*)const" rename="print_" />
|
<modify-function signature="print(QPrinter*)const" rename="print_" />
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,9 @@
|
||||||
$CHILD_TYPE* oldChild = %CPPSELF.$FUNCTION_GET_OLD();
|
$CHILD_TYPE* oldChild = %CPPSELF.$FUNCTION_GET_OLD();
|
||||||
if (oldChild) {
|
if (oldChild) {
|
||||||
Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[$CHILD_TYPE*](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>
|
</template>
|
||||||
|
|
||||||
<!-- Templates to fix bool* parameters -->
|
<!-- Templates to fix bool* parameters -->
|
||||||
|
|
@ -184,7 +184,7 @@
|
||||||
<template name="set_qapp_parent_for_orphan">
|
<template name="set_qapp_parent_for_orphan">
|
||||||
SbkObject* _pySelf = reinterpret_cast<SbkObject*>(%PYARG_0);
|
SbkObject* _pySelf = reinterpret_cast<SbkObject*>(%PYARG_0);
|
||||||
if (!Shiboken::Wrapper::hasParentInfo(_pySelf))
|
if (!Shiboken::Wrapper::hasParentInfo(_pySelf))
|
||||||
Shiboken::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_0);
|
Shiboken::Wrapper::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_0);
|
||||||
</template>
|
</template>
|
||||||
<!-- templates for __reduce__ -->
|
<!-- templates for __reduce__ -->
|
||||||
<template name="reduce_code">
|
<template name="reduce_code">
|
||||||
|
|
|
||||||
|
|
@ -117,12 +117,10 @@ void destroyQCoreApplication()
|
||||||
foreach (SbkObject* pyObj, bm.getAllPyObjects()) {
|
foreach (SbkObject* pyObj, bm.getAllPyObjects()) {
|
||||||
if (pyObj != pyQApp && PyObject_TypeCheck(pyObj, pyQObjectType)) {
|
if (pyObj != pyQApp && PyObject_TypeCheck(pyObj, pyQObjectType)) {
|
||||||
if (Shiboken::Wrapper::hasOwnership(pyObj)) {
|
if (Shiboken::Wrapper::hasOwnership(pyObj)) {
|
||||||
bm.destroyWrapper(pyObj);
|
Shiboken::callCppDestructor<QObject*>(Shiboken::Wrapper::cppPointer(pyObj, Shiboken::SbkType<QObject*>()));
|
||||||
delete static_cast<QObject*>(Shiboken::Wrapper::cppPointer(pyObj, Shiboken::SbkType<QObject*>()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
app->flush();
|
|
||||||
delete app;
|
delete app;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,9 +117,9 @@ QWidget* PyCustomWidget::createWidget(QWidget* parent)
|
||||||
QWidget* widget = 0;
|
QWidget* widget = 0;
|
||||||
if (result) {
|
if (result) {
|
||||||
if (unkowParent) //if parent does not exists in python, transfer the ownership to cpp
|
if (unkowParent) //if parent does not exists in python, transfer the ownership to cpp
|
||||||
Shiboken::BindingManager::instance().transferOwnershipToCpp(result);
|
Shiboken::Wrapper::releaseOwnership(result);
|
||||||
else
|
else
|
||||||
Shiboken::setParent(pyParent, reinterpret_cast<PyObject*>(result));
|
Shiboken::Wrapper::setParent(pyParent, reinterpret_cast<PyObject*>(result));
|
||||||
|
|
||||||
widget = reinterpret_cast<QWidget*>(Shiboken::Wrapper::cppPointer(result, result->ob_type));
|
widget = reinterpret_cast<QWidget*>(Shiboken::Wrapper::cppPointer(result, result->ob_type));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue