aboutsummaryrefslogtreecommitdiffstats
path: root/PySide
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
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')
-rw-r--r--PySide/QtCore/qvariant_type_conversions.h8
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml4
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<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))
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 @@
<object-type name="QItemEditorFactory">
<modify-function signature="registerEditor(QVariant::Type, QItemEditorCreatorBase *)">
<modify-argument index="2">
- <parent index="this" action="add"/>
+ <define-ownership owner="c++"/>
</modify-argument>
</modify-function>
<modify-function signature="setDefaultFactory(QItemEditorFactory *)">
<modify-argument index="1">
- <parent index="this" action="add"/>
+ <define-ownership owner="c++"/>
</modify-argument>
</modify-function>
</object-type>