diff options
author | renatofilho <renato.filho@openbossa.org> | 2010-10-22 14:25:37 -0300 |
---|---|---|
committer | renatofilho <renato.filho@openbossa.org> | 2010-10-22 14:46:35 -0300 |
commit | 8e1e25a631d3e697ea795d66c8ed7e8fbbf7c6dd (patch) | |
tree | 2c78b3ec15c4b911224592cc719222dbcb9c0932 /libpyside | |
parent | d094064ffeec72eaf75fcaa9e23ecab6506d346b (diff) |
Fixed type translate on QProperty.
Fix bug #431
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'libpyside')
-rw-r--r-- | libpyside/qproperty.cpp | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/libpyside/qproperty.cpp b/libpyside/qproperty.cpp index 0a5b1c5ea..4c9eb93c6 100644 --- a/libpyside/qproperty.cpp +++ b/libpyside/qproperty.cpp @@ -28,33 +28,10 @@ #include "qproperty_p.h" #include "dynamicqmetaobject_p.h" #include "qsignal.h" +#include "qsignal_p.h" #define QPROPERTY_CLASS_NAME "Property" -char* translateTypeName(PyObject* type) -{ - if (PyType_Check(type)) { - char* typeName = 0; - if (type->ob_type == &Shiboken::SbkBaseWrapperType_Type) { - Shiboken::SbkBaseWrapperType* objType = reinterpret_cast<Shiboken::SbkBaseWrapperType*>(type); - typeName = strdup(objType->original_name); - } else { - //tp_name return the full name - Shiboken::AutoDecRef otypeName(PyObject_GetAttrString(type, "__name__")); - typeName = strdup(PyString_AS_STRING(otypeName.object())); - } - if (Shiboken::TypeResolver::getType(typeName) == Shiboken::TypeResolver::ObjectType) { - typeName = reinterpret_cast<char*>(realloc(typeName, strlen(typeName) + 1)); - typeName = strcat(typeName, "*"); - } - return typeName; - } else if (PyString_Check(type)) { - return strdup(PyString_AS_STRING(type)); - } - return 0; -} - - extern "C" { @@ -162,7 +139,7 @@ int qpropertyTpInit(PyObject* self, PyObject* args, PyObject* kwds) if (!pData->fset && pData->fget) pData->constant = true; - pData->typeName = translateTypeName(type); + pData->typeName = PySide::getTypeName(type); return 1; } |