mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Fix python object conversion for NULL QWidgets
This commit is contained in:
@@ -944,6 +944,9 @@ QWidget *PythonContext::QWidgetFromPy(PyObject *widget)
|
||||
if(!initialised())
|
||||
return NULL;
|
||||
|
||||
if(widget == Py_None || widget == NULL)
|
||||
return NULL;
|
||||
|
||||
if(!SbkPySide2_QtCoreTypes || !SbkPySide2_QtGuiTypes || !SbkPySide2_QtWidgetsTypes)
|
||||
return UnwrapBareQWidget(widget);
|
||||
|
||||
@@ -1042,6 +1045,11 @@ PyObject *PythonContext::QtObjectToPython(const char *typeName, QObject *object)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
if(object == NULL)
|
||||
{
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject *obj =
|
||||
Shiboken::Object::newObject(reinterpret_cast<SbkObjectType *>(Shiboken::SbkType<QObject>()),
|
||||
object, false, false, typeName);
|
||||
|
||||
Reference in New Issue
Block a user