diff options
-rw-r--r-- | sources/pyside2/tests/QtWidgets/bug_668.py | 2 | ||||
-rw-r--r-- | sources/shiboken2/generator/shiboken2/shibokengenerator.cpp | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/sources/pyside2/tests/QtWidgets/bug_668.py b/sources/pyside2/tests/QtWidgets/bug_668.py index 27c73c660..05cffa39d 100644 --- a/sources/pyside2/tests/QtWidgets/bug_668.py +++ b/sources/pyside2/tests/QtWidgets/bug_668.py @@ -42,6 +42,8 @@ class A(QMainWindow): v = QTreeView(self) v.setModel(a) self.setCentralWidget(v) + # Test index() method (see PYSIDE-570, PYSIDE-331) + index = a.index(0, 0, QModelIndex()) app = QApplication([]) m = A() diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp index 976b34141..315f10fcb 100644 --- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp @@ -2490,8 +2490,18 @@ QMap< QString, AbstractMetaFunctionList > ShibokenGenerator::getFunctionGroups(c QMap<QString, AbstractMetaFunctionList> results; for (AbstractMetaFunction *func : qAsConst(lst)) { - if (isGroupable(func)) - results[func->name()].append(func); + if (isGroupable(func)) { + AbstractMetaFunctionList &list = results[func->name()]; + // If there are virtuals methods in the mix (PYSIDE-570, + // QFileSystemModel::index(QString,int) and + // QFileSystemModel::index(int,int,QModelIndex)) override, make sure + // the overriding method of the most-derived class is seen first + // and inserted into the "seenSignatures" set. + if (func->isVirtual()) + list.prepend(func); + else + list.append(func); + } } return results; } |