Don't crash when a unknown type is given as a meta call argument.
This commit is contained in:
parent
67f0db5a2b
commit
a24e8ed281
1 changed files with 8 additions and 2 deletions
|
|
@ -324,8 +324,14 @@ static int PySide::callMethod(QObject* object, int id, void** args)
|
||||||
void* data = args[i+1];
|
void* data = args[i+1];
|
||||||
const char* dataType = paramTypes[i].constData();
|
const char* dataType = paramTypes[i].constData();
|
||||||
|
|
||||||
PyObject* arg = Shiboken::TypeResolver::get(dataType)->toPython(data);
|
Shiboken::TypeResolver* tr = Shiboken::TypeResolver::get(dataType);
|
||||||
PyTuple_SET_ITEM(preparedArgs, i, arg);
|
if (tr) {
|
||||||
|
PyObject* arg = tr->toPython(data);
|
||||||
|
PyTuple_SET_ITEM(preparedArgs, i, arg);
|
||||||
|
} else {
|
||||||
|
PyErr_Format(PyExc_TypeError, "Can't call meta function because I have no idea how to handle %s", dataType);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString methodName = method.signature();
|
QString methodName = method.signature();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue