From 0dcd933258e03a647f26fed977ed47f9f4cee171 2013-01-29 08:56:43 From: florianlink Date: 2013-01-29 08:56:43 Subject: [PATCH] performance improvement (merged from MeVisLab PythonQt) git-svn-id: svn://svn.code.sf.net/p/pythonqt/code/trunk@239 ea8d5007-eb21-0410-b261-ccb3ea6e24a9 --- diff --git a/src/PythonQt.cpp b/src/PythonQt.cpp index bcbbdfb..f4bb729 100644 --- a/src/PythonQt.cpp +++ b/src/PythonQt.cpp @@ -416,8 +416,11 @@ PyObject* PythonQtPrivate::wrapPtr(void* ptr, const QByteArray& name) QObject* qptr = (QObject*)ptr; // if the object is a derived object, we want to switch the class info to the one of the derived class: if (name!=(qptr->metaObject()->className())) { - registerClass(qptr->metaObject()); info = _knownClassInfos.value(qptr->metaObject()->className()); + if (!info) { + registerClass(qptr->metaObject()); + info = _knownClassInfos.value(qptr->metaObject()->className()); + } } wrap = createNewPythonQtInstanceWrapper(qptr, info); // mlabDebugConst("MLABPython","new qobject wrapper added " << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());