aboutsummaryrefslogtreecommitdiffstats
path: root/PySide
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-11-10 20:23:57 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-11-10 20:23:57 -0200
commit41b6f14acbde484cad2c8b670e5a3556ec62d7cf (patch)
treee65034254700a0510b801335b9da7155baba5d51 /PySide
parent23c1b92073a25e23e2c3bdb2e1a758cfbb64fe79 (diff)
parent2ef14fcc12f003620f85a30f6a4b00e8fee654d2 (diff)
Merge branch 1.0 into master
Conflicts: PySide/QtCore/qvariant_conversions.h
Diffstat (limited to 'PySide')
-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 6c7ebd7f4..a2ac42786 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -18,7 +18,12 @@ struct Converter<QVariant>
{
if (PyObject_TypeCheck(type, &SbkObjectType_Type)) {
SbkObjectType* sbkType = reinterpret_cast<SbkObjectType*>(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)) {
SbkObjectType* objType = reinterpret_cast<SbkObjectType*>(pyObj->ob_type);
int typeCode = 0;
QByteArray typeName = resolveMetaType(reinterpret_cast<PyTypeObject*>(objType), typeCode);