@@ -512,8 +512,19 @@ static PyObject *PythonQtClassWrapper_getattro(PyObject *obj, PyObject *name)
512
512
Py_INCREF (enumWrapper);
513
513
return enumWrapper;
514
514
} else if (member._type == PythonQtMemberInfo::Slot) {
515
- // we return all slots, even the instance slots, since they are callable as unbound slots with self argument
516
- return PythonQtSlotFunction_New (member._slot , obj, NULL );
515
+ // NOTE: this does an extra lookup and string copy, it might be better to move this to
516
+ // PythonQtClassInfo and add a new cache for qualified class methods...
517
+ QByteArray qualifiedMemberName = " py_q_" ;
518
+ qualifiedMemberName += attributeName;
519
+ PythonQtMemberInfo qualifiedMember = wrapper->classInfo ()->member (qualifiedMemberName);
520
+ if (qualifiedMember._type == PythonQtMemberInfo::Slot) {
521
+ // return the qualified member, so that virtual calls on classes call the qualified member
522
+ return PythonQtSlotFunction_New (qualifiedMember._slot , obj, NULL );
523
+ }
524
+ else {
525
+ // we return all slots, even the instance slots, since they are callable as unbound slots with self argument
526
+ return PythonQtSlotFunction_New (member._slot , obj, NULL );
527
+ }
517
528
} else if (member._type == PythonQtMemberInfo::Signal) {
518
529
// we return all signals, even the instance signals, since they are callable as unbound signals with self argument
519
530
return PythonQtSignalFunction_New (member._slot , obj, NULL );
0 commit comments