Fix a PythonQt bug where it would incorrectly report an error trying to convert the return value of a void slot().
This commit is contained in:
parent
58b8af4d4a
commit
2dbf6a4871
21
3rdparty/pythonqt/patches/call-slot-returnvalue.patch
vendored
Normal file
21
3rdparty/pythonqt/patches/call-slot-returnvalue.patch
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
diff --git a/3rdparty/pythonqt/src/PythonQtSlot.cpp b/3rdparty/pythonqt/src/PythonQtSlot.cpp
|
||||
index 96f8e8d..43583be 100644
|
||||
--- a/3rdparty/pythonqt/src/PythonQtSlot.cpp
|
||||
+++ b/3rdparty/pythonqt/src/PythonQtSlot.cpp
|
||||
@@ -159,6 +159,7 @@ bool PythonQtCallSlot(PythonQtClassInfo* classInfo, QObject* objectToCall, PyObj
|
||||
QString e = QString("Called ") + info->fullSignature() + ", return type '" + returnValueParam.name + "' is ignored because it is unknown to PythonQt. Probably you should register it using qRegisterMetaType() or add a default constructor decorator to the class.";
|
||||
PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
|
||||
result = NULL;
|
||||
+ ok = false;
|
||||
}
|
||||
}
|
||||
recursiveEntry--;
|
||||
@@ -170,7 +171,7 @@ bool PythonQtCallSlot(PythonQtClassInfo* classInfo, QObject* objectToCall, PyObj
|
||||
|
||||
*pythonReturnValue = result;
|
||||
// NOTE: it is important to only return here, otherwise the stack will not be popped!!!
|
||||
- return result || (directReturnValuePointer && *directReturnValuePointer);
|
||||
+ return ok;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------
|
3
3rdparty/pythonqt/src/PythonQtSlot.cpp
vendored
3
3rdparty/pythonqt/src/PythonQtSlot.cpp
vendored
@ -159,6 +159,7 @@ bool PythonQtCallSlot(PythonQtClassInfo* classInfo, QObject* objectToCall, PyObj
|
||||
QString e = QString("Called ") + info->fullSignature() + ", return type '" + returnValueParam.name + "' is ignored because it is unknown to PythonQt. Probably you should register it using qRegisterMetaType() or add a default constructor decorator to the class.";
|
||||
PyErr_SetString(PyExc_ValueError, e.toLatin1().data());
|
||||
result = NULL;
|
||||
ok = false;
|
||||
}
|
||||
}
|
||||
recursiveEntry--;
|
||||
@ -170,7 +171,7 @@ bool PythonQtCallSlot(PythonQtClassInfo* classInfo, QObject* objectToCall, PyObj
|
||||
|
||||
*pythonReturnValue = result;
|
||||
// NOTE: it is important to only return here, otherwise the stack will not be popped!!!
|
||||
return result || (directReturnValuePointer && *directReturnValuePointer);
|
||||
return ok;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user