diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-06-25 15:24:11 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-06-25 14:22:59 +0000 |
commit | 4d858949958e48fdffa136688f1eb82f85439404 (patch) | |
tree | 73a211458c40ac3c6c1dca629de8c7475b2191f4 /sources/shiboken2/generator/shiboken2 | |
parent | d30a4247a5253cdbd2b7f34d4fd0ac648850fbf1 (diff) |
Fix index() method of QAbstractItemModel-derived classes
Prepend virtual methods when creating function groups
so that overriding method the most-derived class is seen first.
Task-number: PYSIDE-570
Change-Id: I791e3da09783c4c31ac293060aed8bb2bc8472d5
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/generator/shiboken2')
-rw-r--r-- | sources/shiboken2/generator/shiboken2/shibokengenerator.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
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; } |