summaryrefslogtreecommitdiffstats
path: root/PySide/QtCore/qvariant_conversions.h
diff options
context:
space:
mode:
Diffstat (limited to 'PySide/QtCore/qvariant_conversions.h')
-rw-r--r--PySide/QtCore/qvariant_conversions.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h
index b47e389..9363a25 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -18,7 +18,12 @@ struct Converter<QVariant>
{
if (PyObject_TypeCheck(type, &Shiboken::SbkBaseWrapperType_Type)) {
Shiboken::SbkBaseWrapperType *sbkType = reinterpret_cast<Shiboken::SbkBaseWrapperType*>(type);
- const char* typeName = sbkType->original_name;
+ QByteArray typeName(sbkType->original_name);
+ bool valueType = !typeName.endsWith("*");
+
+ // Do not convert user type of value
+ if (valueType && sbkType->is_user_type)
+ return QByteArray();
int obTypeId = QMetaType::type(typeName);
if (obTypeId) {
@@ -27,7 +32,7 @@ struct Converter<QVariant>
}
// Do not resolve types to value type
- if (!QByteArray(typeName).endsWith("*"))
+ if (valueType)
return QByteArray();
// find in base types
@@ -81,7 +86,7 @@ struct Converter<QVariant>
return convertToVariantList(pyObj);
} else {
// a class supported by QVariant?
- if (Shiboken::isShibokenType(pyObj) && !Shiboken::isUserType(pyObj)) {
+ if (Shiboken::isShibokenType(pyObj)) {
Shiboken::SbkBaseWrapperType *objType = reinterpret_cast<Shiboken::SbkBaseWrapperType*>(pyObj->ob_type);
int typeCode = 0;
QByteArray typeName = resolveMetaType(reinterpret_cast<PyTypeObject*>(objType), typeCode);