aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtCore/qvariant_conversions.h
diff options
context:
space:
mode:
authorrenatofilho <renato.filho@openbossa.org>2010-11-09 22:36:11 -0300
committerrenatofilho <renato.filho@openbossa.org>2010-11-09 22:36:11 -0300
commit66ff08586178ffb601fe874d48b9847fb577f513 (patch)
tree1d22a50e13cfaec0c5ca71bae0047b0b744d00ea /PySide/QtCore/qvariant_conversions.h
parentc7f6b49e1e8df003f44528839f4b0438f155e8b1 (diff)
Fixed QVariant conversions for user type.
Diffstat (limited to 'PySide/QtCore/qvariant_conversions.h')
-rw-r--r--PySide/QtCore/qvariant_conversions.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h
index 3056bd9b6..b47e3892d 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -20,15 +20,16 @@ struct Converter<QVariant>
Shiboken::SbkBaseWrapperType *sbkType = reinterpret_cast<Shiboken::SbkBaseWrapperType*>(type);
const char* typeName = sbkType->original_name;
- // Do not resolve types to value type
- if (!QByteArray(typeName).endsWith("*"))
- return QByteArray();
-
int obTypeId = QMetaType::type(typeName);
if (obTypeId) {
typeId = obTypeId;
return QByteArray(typeName);
}
+
+ // Do not resolve types to value type
+ if (!QByteArray(typeName).endsWith("*"))
+ return QByteArray();
+
// find in base types
if (type->tp_base) {
return resolveMetaType(type->tp_base, typeId);
@@ -80,7 +81,7 @@ struct Converter<QVariant>
return convertToVariantList(pyObj);
} else {
// a class supported by QVariant?
- if (Shiboken::isShibokenType(pyObj)) {
+ if (Shiboken::isShibokenType(pyObj) && !Shiboken::isUserType(pyObj)) {
Shiboken::SbkBaseWrapperType *objType = reinterpret_cast<Shiboken::SbkBaseWrapperType*>(pyObj->ob_type);
int typeCode = 0;
QByteArray typeName = resolveMetaType(reinterpret_cast<PyTypeObject*>(objType), typeCode);