diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-08-04 12:59:24 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-08-07 21:56:16 +0000 |
commit | c781403e5bfe898088dc922129810cc53ca8f6ef (patch) | |
tree | 641aa2b32dfd58c77f529a68e9af18bb9fb4f3dc | |
parent | f441778f045846f924819d05203c1faf151f085b (diff) |
shiboken6/Documentation: Generate modified return types of void functions
Do not bail out if the function is void.
Task-number: PYSIDE-2411
Change-Id: Iac870f1719a16c8faf815d01a4221f4306df4f83
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit 22d1beb745917f3c00a484ceea61980ee3a83012)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp index 39b3c5333..6d29ceec8 100644 --- a/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp +++ b/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp @@ -764,23 +764,17 @@ void QtDocGenerator::writeFunctionParametersType(TextStream &s, writeParameterType(s, cppClass, arg); } - if (!func->isConstructor() && !func->isVoid()) { - - QString retType; + QString retType; + if (!func->isConstructor()) { // check if the return type was modified - for (const auto &mod : func->modifications()) { - for (const ArgumentModification &argMod : mod.argument_mods()) { - if (argMod.index() == 0) { - retType = argMod.modifiedType(); - break; - } - } - } - - if (retType.isEmpty()) + retType = func->modifiedTypeName(); + if (retType.isEmpty() && !func->isVoid()) retType = translateToPythonType(func->type(), cppClass); - s << ":rtype: " << retType << '\n'; } + + if (!retType.isEmpty()) + s << ":rtype: " << retType << '\n'; + s << '\n'; } |