From 88fd0c6e0bca1cf0a25a80ba367e6ee3d59b1862 Mon Sep 17 00:00:00 2001 From: renatofilho Date: Thu, 23 Sep 2010 11:47:34 -0300 Subject: Fixed QVariant::Type convertions. Fixed QItemEditorFactory ownership rules on typesystem. Fixes bug #373. Reviewer: Hugo Parente Lima Luciano Wolf --- PySide/QtCore/qvariant_type_conversions.h | 8 ++++++-- PySide/QtGui/typesystem_gui_common.xml | 4 ++-- 2 files changed, 8 insertions(+), 4 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 typeName = "double"; // float is a UserType in QVariant. else if (pyObj == reinterpret_cast(&PyLong_Type)) typeName = "int"; // long is a UserType in QVariant. - else if (PyType_Check(pyObj)) - typeName = reinterpret_cast(pyObj)->tp_name; + else if (PyType_Check(pyObj)) { + if (pyObj->ob_type == &Shiboken::SbkBaseWrapperType_Type) + typeName = reinterpret_cast(pyObj)->original_name; + else + typeName = reinterpret_cast(pyObj)->tp_name; + } else if (PyString_Check(pyObj)) typeName = PyString_AS_STRING(pyObj); else if (PyUnicode_Check(pyObj)) diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml index 76afeccfc..4581e1f6c 100644 --- a/PySide/QtGui/typesystem_gui_common.xml +++ b/PySide/QtGui/typesystem_gui_common.xml @@ -1550,12 +1550,12 @@ - + - + -- cgit v1.2.3