summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2010-12-28 19:43:51 -0300
committerRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2010-12-29 09:55:13 -0300
commitdb4d3244978510da9fe058596e2a52b651370986 (patch)
treededb770adb0cb61af05e50b5f4c91ec381dea6d2
parent7144634e350732901c8903b69febe417c2a9cb31 (diff)
downloadpyside-db4d3244978510da9fe058596e2a52b651370986.tar.gz
pyside-db4d3244978510da9fe058596e2a52b651370986.tar.xz
pyside-db4d3244978510da9fe058596e2a52b651370986.zip
Fixed MetaObject creation based on typename.
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
-rw-r--r--libpyside/pyside.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/libpyside/pyside.cpp b/libpyside/pyside.cpp
index da896ce..5cb107a 100644
--- a/libpyside/pyside.cpp
+++ b/libpyside/pyside.cpp
@@ -138,11 +138,7 @@ void destroyQCoreApplication()
void initDynamicMetaObject(SbkObjectType* type, const QMetaObject* base)
{
- const char* typeName = type->super.ht_type.tp_name;
- int len = strlen(typeName);
- for (int i = len-1; i >= 0; --i)
- if (typeName[i] == '.')
- typeName += i + 1;
+ QByteArray typeName = QByteArray(type->super.ht_type.tp_name).split('.').last();
DynamicQMetaObject* mo = new PySide::DynamicQMetaObject(typeName, base);
Shiboken::ObjectType::setTypeUserData(type, mo, &Shiboken::callCppDestructor<DynamicQMetaObject>);
}