Fixing usage of tp_name in QVariant converter
Reviewed by Renato Araújo <renato.filho@openbossa.org>
This commit is contained in:
parent
eeb50b166b
commit
3e100626a5
1 changed files with 3 additions and 1 deletions
|
|
@ -41,7 +41,9 @@ inline QVariant Converter<QVariant>::toCpp(PyObject* pyobj)
|
||||||
if (SbkQVariant_Check(pyobj))
|
if (SbkQVariant_Check(pyobj))
|
||||||
return *Converter<QVariant*>::toCpp(pyobj);
|
return *Converter<QVariant*>::toCpp(pyobj);
|
||||||
// voodoo stuff to avoid linking qtcore bindings with qtgui bindings
|
// voodoo stuff to avoid linking qtcore bindings with qtgui bindings
|
||||||
uint typeCode = QMetaType::type(pyobj->ob_type->tp_name);
|
QString className(pyobj->ob_type->tp_name);
|
||||||
|
className = className.mid(className.lastIndexOf(".") + 1);
|
||||||
|
uint typeCode = QMetaType::type(className.toAscii());
|
||||||
if (!typeCode || typeCode > QVariant::UserType) {
|
if (!typeCode || typeCode > QVariant::UserType) {
|
||||||
|
|
||||||
// Check the implicit conversion stuff for most python-native types
|
// Check the implicit conversion stuff for most python-native types
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue