diff options
Diffstat (limited to 'PySide/typesystem_templates.xml')
-rw-r--r-- | PySide/typesystem_templates.xml | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml index c2c0474d7..a35602f72 100644 --- a/PySide/typesystem_templates.xml +++ b/PySide/typesystem_templates.xml @@ -246,10 +246,12 @@ %END_ALLOW_THREADS %PYARG_0 = Shiboken::makeTuple(retval_, %5); </template> - <template name="set_qapp_parent_for_orphan"> - SbkObject* _pySelf = reinterpret_cast<SbkObject*>(%PYARG_0); - if (!Shiboken::Object::hasParentInfo(_pySelf)) - Shiboken::Object::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_0); + <template name="set_qapp_parent_for_orphan"> + if (%PYARG_0 && (%PYARG_0 != Py_None)) { + SbkObject* _pySelf = reinterpret_cast<SbkObject*>(%PYARG_0); + if (!Shiboken::Object::hasParentInfo(_pySelf)) + Shiboken::Object::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_0); + } </template> <!-- templates for __repr__ --> <template name="repr_code"> |