Handle None being passed from Python for a QWidget pointer

This commit is contained in:
baldurk
2018-06-14 17:56:18 +01:00
parent 4b11dce193
commit bf70aeb64d
+5 -2
View File
@@ -39,8 +39,11 @@ TEMPLATE_ARRAY_DECLARE(rdcarray);
%}
%typemap(in) QWidget * {
$1 = QWidgetFromPy($input);
if($input && !$1)
if($input == Py_None)
$1 = NULL;
else
$1 = QWidgetFromPy($input);
if($input && $input != Py_None && !$1)
{
SWIG_exception_fail(SWIG_TypeError, "in method '$symname' QWidget expected for argument $argnum of type '$1_basetype'");
}