@@ -169,7 +169,9 @@ PythonQtSlotInfo* PythonQtClassInfo::recursiveFindDecoratorSlotsFromDecoratorPro
169169{
170170 inputInfo = findDecoratorSlotsFromDecoratorProvider (memberName, inputInfo, found, memberCache, upcastingOffset);
171171 Q_FOREACH (const ParentClassInfo& info, _parentClasses) {
172- inputInfo = info._parent ->recursiveFindDecoratorSlotsFromDecoratorProvider (memberName, inputInfo, found, memberCache, upcastingOffset+info._upcastingOffset );
172+ if (this != info._parent ) {
173+ inputInfo = info._parent ->recursiveFindDecoratorSlotsFromDecoratorProvider (memberName, inputInfo, found, memberCache, upcastingOffset+info._upcastingOffset );
174+ }
173175 }
174176 return inputInfo;
175177}
@@ -382,14 +384,18 @@ void PythonQtClassInfo::recursiveCollectDecoratorObjects(QList<QObject*>& decora
382384 decoratorObjects.append (deco);
383385 }
384386 Q_FOREACH (const ParentClassInfo& info, _parentClasses) {
385- info._parent ->recursiveCollectDecoratorObjects (decoratorObjects);
387+ if (this != info._parent ) {
388+ info._parent ->recursiveCollectDecoratorObjects (decoratorObjects);
389+ }
386390 }
387391}
388392
389393void PythonQtClassInfo::recursiveCollectClassInfos (QList<PythonQtClassInfo*>& classInfoObjects) {
390394 classInfoObjects.append (this );
391395 Q_FOREACH (const ParentClassInfo& info, _parentClasses) {
392- info._parent ->recursiveCollectClassInfos (classInfoObjects);
396+ if (this != info._parent ) {
397+ info._parent ->recursiveCollectClassInfos (classInfoObjects);
398+ }
393399 }
394400}
395401
@@ -584,7 +590,7 @@ bool PythonQtClassInfo::inherits(const char* name)
584590 return true ;
585591 }
586592 Q_FOREACH (const ParentClassInfo& info, _parentClasses) {
587- if (info._parent ->inherits (name)) {
593+ if (info._parent != this && info. _parent ->inherits (name)) {
588594 return true ;
589595 }
590596 }
@@ -597,7 +603,7 @@ bool PythonQtClassInfo::inherits(PythonQtClassInfo* classInfo)
597603 return true ;
598604 }
599605 Q_FOREACH (const ParentClassInfo& info, _parentClasses) {
600- if (info._parent ->inherits (classInfo)) {
606+ if (info._parent != this && info. _parent ->inherits (classInfo)) {
601607 return true ;
602608 }
603609 }
@@ -761,8 +767,11 @@ void* PythonQtClassInfo::recursiveCastDownIfPossible(void* ptr, const char** res
761767 }
762768 }
763769 Q_FOREACH (const ParentClassInfo& info, _parentClasses) {
770+ void * resultPtr = NULL ;
764771 if (!info._parent ->isQObject ()) {
765- void * resultPtr = info._parent ->recursiveCastDownIfPossible ((char *)ptr + info._upcastingOffset , resultClassName);
772+ if (this != info._parent ) {
773+ resultPtr = info._parent ->recursiveCastDownIfPossible ((char *)ptr + info._upcastingOffset , resultClassName);
774+ }
766775 if (resultPtr) {
767776 return resultPtr;
768777 }
@@ -870,7 +879,9 @@ void PythonQtClassInfo::createEnumWrappers(const QObject* decoratorProvider)
870879 Q_FOREACH (const ParentClassInfo& info, _parentClasses) {
871880 // trigger decorator() instead of createEnumWrappers(),
872881 // which will then call createEnumWrappers().
873- info._parent ->decorator ();
882+ if (info._parent != this ) {
883+ info._parent ->decorator ();
884+ }
874885 }
875886 }
876887}
@@ -889,7 +900,10 @@ PyObject* PythonQtClassInfo::findEnumWrapper(const char* name) {
889900 }
890901 }
891902 Q_FOREACH (const ParentClassInfo& info, _parentClasses) {
892- PyObject* p = info._parent ->findEnumWrapper (name);
903+ PyObject* p = NULL ;
904+ if (info._parent != this ) {
905+ p = info._parent ->findEnumWrapper (name);
906+ }
893907 if (p) return p;
894908 }
895909 return NULL ;
@@ -1004,6 +1018,10 @@ void PythonQtClassInfo::updateRefCountingCBs()
10041018 if (!_parentClasses.isEmpty ()) {
10051019 // we only search in single inheritance, using the first parent class
10061020 PythonQtClassInfo* parent = _parentClasses.at (0 )._parent ;
1021+ if (parent == this ) {
1022+ _searchRefCountCB = false ;
1023+ return ;
1024+ }
10071025 parent->updateRefCountingCBs ();
10081026 // propagate to ourself
10091027 _refCallback = parent->_refCallback ;
0 commit comments