Skip to content

Commit 38e01cd

Browse files
author
florianlink
committed
performance improvement (merged from MeVisLab PythonQt)
git-svn-id: https://pythonqt.svn.sourceforge.net/svnroot/pythonqt/trunk@239 ea8d5007-eb21-0410-b261-ccb3ea6e24a9
1 parent eeb7da2 commit 38e01cd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/PythonQt.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,11 @@ PyObject* PythonQtPrivate::wrapPtr(void* ptr, const QByteArray& name)
416416
QObject* qptr = (QObject*)ptr;
417417
// if the object is a derived object, we want to switch the class info to the one of the derived class:
418418
if (name!=(qptr->metaObject()->className())) {
419-
registerClass(qptr->metaObject());
420419
info = _knownClassInfos.value(qptr->metaObject()->className());
420+
if (!info) {
421+
registerClass(qptr->metaObject());
422+
info = _knownClassInfos.value(qptr->metaObject()->className());
423+
}
421424
}
422425
wrap = createNewPythonQtInstanceWrapper(qptr, info);
423426
// mlabDebugConst("MLABPython","new qobject wrapper added " << " " << wrap->_obj->className() << " " << wrap->classInfo()->wrappedClassName().latin1());

0 commit comments

Comments
 (0)