aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtCore/qvariant_type_conversions.h
diff options
context:
space:
mode:
authorrenatofilho <renato.filho@openbossa.org>2010-09-23 11:47:34 -0300
committerrenatofilho <renato.filho@openbossa.org>2010-09-24 16:44:45 -0300
commit88fd0c6e0bca1cf0a25a80ba367e6ee3d59b1862 (patch)
treef01ba5bea7f8b5be383d5b94199ec5ea5aee87db /PySide/QtCore/qvariant_type_conversions.h
parent3e0af488ee5820f35462f381c5a1676dc9560a5d (diff)
Fixed QVariant::Type convertions.
Fixed QItemEditorFactory ownership rules on typesystem. Fixes bug #373. Reviewer: Hugo Parente Lima <hugo.pl@gmail.com> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'PySide/QtCore/qvariant_type_conversions.h')
-rw-r--r--PySide/QtCore/qvariant_type_conversions.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/PySide/QtCore/qvariant_type_conversions.h b/PySide/QtCore/qvariant_type_conversions.h
index d1cf9f0ca..e5384cd8b 100644
--- a/PySide/QtCore/qvariant_type_conversions.h
+++ b/PySide/QtCore/qvariant_type_conversions.h
@@ -25,8 +25,12 @@ struct Converter<QVariant::Type>
typeName = "double"; // float is a UserType in QVariant.
else if (pyObj == reinterpret_cast<PyObject*>(&PyLong_Type))
typeName = "int"; // long is a UserType in QVariant.
- else if (PyType_Check(pyObj))
- typeName = reinterpret_cast<PyTypeObject*>(pyObj)->tp_name;
+ else if (PyType_Check(pyObj)) {
+ if (pyObj->ob_type == &Shiboken::SbkBaseWrapperType_Type)
+ typeName = reinterpret_cast<Shiboken::SbkBaseWrapperType*>(pyObj)->original_name;
+ else
+ typeName = reinterpret_cast<PyTypeObject*>(pyObj)->tp_name;
+ }
else if (PyString_Check(pyObj))
typeName = PyString_AS_STRING(pyObj);
else if (PyUnicode_Check(pyObj))