diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-08-04 15:15:50 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-08-08 21:30:08 +0200 |
| commit | 6c03699b50f2597a1c150db86fed4bcb95b297bf (patch) | |
| tree | ee3c93aeb855999d27abc4b09f1be008993e782a | |
| parent | 1c7f5faabdfc3729a629e3c57f4ee77b63fb858d (diff) | |
shiboken6: Do not add removed arguments to the signature strings
This fixes some warnings of gen_pyi.
Task-number: PYSIDE-2013
Task-number: PYSIDE-2017
Change-Id: I7a15a535328b434727b980c169fda2799765a56f
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| -rw-r--r-- | sources/shiboken6/generator/shiboken/cppgenerator.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sources/shiboken6/generator/shiboken/cppgenerator.cpp b/sources/shiboken6/generator/shiboken/cppgenerator.cpp index 8ce6189b8..1878dd4d9 100644 --- a/sources/shiboken6/generator/shiboken/cppgenerator.cpp +++ b/sources/shiboken6/generator/shiboken/cppgenerator.cpp @@ -5471,14 +5471,17 @@ void CppGenerator::writeSignatureInfo(TextStream &s, const OverloadData &overloa args << u"self"_s; const auto &arguments = f->arguments(); for (qsizetype i = 0, size = arguments.size(); i < size; ++i) { - QString t = f->pyiTypeReplaced(i + 1); - if (t.isEmpty()) { - t = signatureParameter(arguments.at(i)); - } else { - t.prepend(u':'); - t.prepend(arguments.at(i).name()); + const auto n = i + 1; + if (!f->argumentRemoved(n)) { + QString t = f->pyiTypeReplaced(n); + if (t.isEmpty()) { + t = signatureParameter(arguments.at(i)); + } else { + t.prepend(u':'); + t.prepend(arguments.at(i).name()); + } + args.append(t); } - args.append(t); } // mark the multiple signatures as such, to make it easier to generate different code |
