diff options
-rw-r--r-- | PySide/QtCore/qvariant_conversions.h | 21 | ||||
-rw-r--r-- | PySide/QtGui/typesystem_gui_common.xml | 2 |
2 files changed, 12 insertions, 11 deletions
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h index 283cf4f4f..73e2aa462 100644 --- a/PySide/QtCore/qvariant_conversions.h +++ b/PySide/QtCore/qvariant_conversions.h @@ -82,16 +82,10 @@ struct Converter<QVariant> } else if (Shiboken::isShibokenEnum(pyObj)) { // QVariant(enum) return QVariant(Converter<int>::toCpp(pyObj)); - } else if (PyDict_Check(pyObj)) { - return convertToVariantMap(pyObj); - } else if (PySequence_Check(pyObj)) { - return convertToVariantList(pyObj); - } else { + } else if (Shiboken::Object::checkType(pyObj)) { // a class supported by QVariant? - if (Shiboken::Object::checkType(pyObj)) { int typeCode; const char* typeName = resolveMetaType(pyObj->ob_type, &typeCode); - if (typeCode && typeName) { Shiboken::TypeResolver* tr = Shiboken::TypeResolver::get(typeName); QVariant var(typeCode, (void*)0); @@ -99,10 +93,17 @@ struct Converter<QVariant> tr->toCpp(pyObj, args); return var; } - } - // Is a shiboken type not known by Qt - return QVariant::fromValue<PySide::PyObjectWrapper>(pyObj); } + + //sequence and dictornay + if (PyDict_Check(pyObj)) { + return convertToVariantMap(pyObj); + } else if (PySequence_Check(pyObj)) { + return convertToVariantList(pyObj); + } + + // Is a shiboken type not known by Qt + return QVariant::fromValue<PySide::PyObjectWrapper>(pyObj); } static PyObject* toPython(void* cppObj) diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml index e5d6281ec..fa484bc13 100644 --- a/PySide/QtGui/typesystem_gui_common.xml +++ b/PySide/QtGui/typesystem_gui_common.xml @@ -493,7 +493,7 @@ </inject-code> </add-function> - <!-- ### See bug 775 --> + <!-- ### Not necessary due the PySide QVariant conversion rules --> <modify-function signature="operator QVariant()const" remove="all"/> <!-- ### Obsolete --> <modify-function signature="operator int()const" remove="all"/> |