aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cppgenerator.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp
index 23ce9ca38..2a70d94fc 100644
--- a/cppgenerator.cpp
+++ b/cppgenerator.cpp
@@ -530,7 +530,12 @@ void CppGenerator::writeVirtualMethodNative(QTextStream &s, const AbstractMetaFu
s << INDENT << '}' << endl;
s << INDENT << "// Check return type" << endl;
- s << INDENT << "bool typeIsValid = " << cpythonCheckFunction(func->type()) << "(" << PYTHON_RETURN_VAR << ");" << endl;
+ s << INDENT << "bool typeIsValid = ";
+ if (func->typeReplaced(0).isEmpty())
+ s << cpythonCheckFunction(func->type());
+ else
+ s << guessCPythonCheckFunction(func->typeReplaced(0));
+ s << "(" << PYTHON_RETURN_VAR << ");" << endl;
if (func->type()->isQObject() || func->type()->isObject() || func->type()->isValuePointer()) {
s << INDENT << "typeIsValid = typeIsValid || (" << PYTHON_RETURN_VAR << " == Py_None);" << endl;
}