aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtGui/glue/qwidget_glue.h
diff options
context:
space:
mode:
Diffstat (limited to 'PySide/QtGui/glue/qwidget_glue.h')
-rw-r--r--PySide/QtGui/glue/qwidget_glue.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/PySide/QtGui/glue/qwidget_glue.h b/PySide/QtGui/glue/qwidget_glue.h
index a6cd3b7d4..948852240 100644
--- a/PySide/QtGui/glue/qwidget_glue.h
+++ b/PySide/QtGui/glue/qwidget_glue.h
@@ -1,3 +1,10 @@
+static QString retrieveObjectName(PyObject *obj)
+{
+ Shiboken::AutoDecRef objName(PyObject_Str(obj));
+ return QString(PyString_AsString(objName));
+}
+
+
/**
* Tranfer objects ownership from layout to widget
**/
@@ -26,6 +33,9 @@ qwidgetReparentLayout(QWidget *parent, QLayout *layout)
Shiboken::AutoDecRef pyChild(Shiboken::Converter<QLayout*>::toPython(layout));
Shiboken::setParent(pyParent, pyChild);
+
+ //remove previous references
+ Shiboken::keepReference(reinterpret_cast<Shiboken::SbkBaseWrapper*>(pyChild.object()), qPrintable(retrieveObjectName(pyChild)), Py_None);
}
static inline void