@@ -169,7 +169,9 @@ PythonQtSlotInfo* PythonQtClassInfo::recursiveFindDecoratorSlotsFromDecoratorPro
169
169
{
170
170
inputInfo = findDecoratorSlotsFromDecoratorProvider (memberName, inputInfo, found, memberCache, upcastingOffset);
171
171
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
+ }
173
175
}
174
176
return inputInfo;
175
177
}
@@ -382,14 +384,18 @@ void PythonQtClassInfo::recursiveCollectDecoratorObjects(QList<QObject*>& decora
382
384
decoratorObjects.append (deco);
383
385
}
384
386
Q_FOREACH (const ParentClassInfo& info, _parentClasses) {
385
- info._parent ->recursiveCollectDecoratorObjects (decoratorObjects);
387
+ if (this != info._parent ) {
388
+ info._parent ->recursiveCollectDecoratorObjects (decoratorObjects);
389
+ }
386
390
}
387
391
}
388
392
389
393
void PythonQtClassInfo::recursiveCollectClassInfos (QList<PythonQtClassInfo*>& classInfoObjects) {
390
394
classInfoObjects.append (this );
391
395
Q_FOREACH (const ParentClassInfo& info, _parentClasses) {
392
- info._parent ->recursiveCollectClassInfos (classInfoObjects);
396
+ if (this != info._parent ) {
397
+ info._parent ->recursiveCollectClassInfos (classInfoObjects);
398
+ }
393
399
}
394
400
}
395
401
@@ -584,7 +590,7 @@ bool PythonQtClassInfo::inherits(const char* name)
584
590
return true ;
585
591
}
586
592
Q_FOREACH (const ParentClassInfo& info, _parentClasses) {
587
- if (info._parent ->inherits (name)) {
593
+ if (info._parent != this && info. _parent ->inherits (name)) {
588
594
return true ;
589
595
}
590
596
}
@@ -597,7 +603,7 @@ bool PythonQtClassInfo::inherits(PythonQtClassInfo* classInfo)
597
603
return true ;
598
604
}
599
605
Q_FOREACH (const ParentClassInfo& info, _parentClasses) {
600
- if (info._parent ->inherits (classInfo)) {
606
+ if (info._parent != this && info. _parent ->inherits (classInfo)) {
601
607
return true ;
602
608
}
603
609
}
@@ -761,8 +767,11 @@ void* PythonQtClassInfo::recursiveCastDownIfPossible(void* ptr, const char** res
761
767
}
762
768
}
763
769
Q_FOREACH (const ParentClassInfo& info, _parentClasses) {
770
+ void * resultPtr = NULL ;
764
771
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
+ }
766
775
if (resultPtr) {
767
776
return resultPtr;
768
777
}
@@ -870,7 +879,9 @@ void PythonQtClassInfo::createEnumWrappers(const QObject* decoratorProvider)
870
879
Q_FOREACH (const ParentClassInfo& info, _parentClasses) {
871
880
// trigger decorator() instead of createEnumWrappers(),
872
881
// which will then call createEnumWrappers().
873
- info._parent ->decorator ();
882
+ if (info._parent != this ) {
883
+ info._parent ->decorator ();
884
+ }
874
885
}
875
886
}
876
887
}
@@ -889,7 +900,10 @@ PyObject* PythonQtClassInfo::findEnumWrapper(const char* name) {
889
900
}
890
901
}
891
902
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
+ }
893
907
if (p) return p;
894
908
}
895
909
return NULL ;
@@ -1004,6 +1018,10 @@ void PythonQtClassInfo::updateRefCountingCBs()
1004
1018
if (!_parentClasses.isEmpty ()) {
1005
1019
// we only search in single inheritance, using the first parent class
1006
1020
PythonQtClassInfo* parent = _parentClasses.at (0 )._parent ;
1021
+ if (parent == this ) {
1022
+ _searchRefCountCB = false ;
1023
+ return ;
1024
+ }
1007
1025
parent->updateRefCountingCBs ();
1008
1026
// propagate to ourself
1009
1027
_refCallback = parent->_refCallback ;
0 commit comments