From 3e100626a5e1676240f374275440d2ec1e191599 Mon Sep 17 00:00:00 2001 From: Lauro Neto Date: Wed, 24 Feb 2010 16:03:06 -0300 Subject: Fixing usage of tp_name in QVariant converter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed by Renato Araújo --- PySide/QtCore/qvariant_conversions.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'PySide/QtCore') diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h index f3a7dfa80..4834c08ce 100644 --- a/PySide/QtCore/qvariant_conversions.h +++ b/PySide/QtCore/qvariant_conversions.h @@ -41,7 +41,9 @@ inline QVariant Converter::toCpp(PyObject* pyobj) if (SbkQVariant_Check(pyobj)) return *Converter::toCpp(pyobj); // voodoo stuff to avoid linking qtcore bindings with qtgui bindings - uint typeCode = QMetaType::type(pyobj->ob_type->tp_name); + QString className(pyobj->ob_type->tp_name); + className = className.mid(className.lastIndexOf(".") + 1); + uint typeCode = QMetaType::type(className.toAscii()); if (!typeCode || typeCode > QVariant::UserType) { // Check the implicit conversion stuff for most python-native types -- cgit v1.2.3