diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-10-21 15:07:58 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-11-03 15:24:46 +0000 |
commit | de778e6e044cd47d953fa4bb2e33a2c8eefeb8bc (patch) | |
tree | 96da56733eb50f81d75d10c21fa028a9634f7663 | |
parent | 574cafa3bb9f4ebd926ea395ed7b34888d1fa478 (diff) |
shiboken6/Documentation: Use the py:method directives
They allow for additional annotations like abstract or final.
Task-number: PYSIDE-1106
Change-Id: Ib72cc301f7e0ea58154ddd591228c7230f8749bd
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit 1ab21cc38197104ccaef0fd3049873e175b69b3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp index 5c81be1a5..441604058 100644 --- a/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp +++ b/sources/shiboken6/generator/qtdoc/qtdocgenerator.cpp @@ -247,9 +247,9 @@ void QtDocGenerator::generateClass(TextStream &s, const GeneratorContext &classC continue; if (func->isStatic()) - s << ".. staticmethod:: "; + s << ".. py:staticmethod:: "; else - s << ".. method:: "; + s << ".. py:method:: "; writeFunction(s, metaClass, func, !uniqueFunctions.contains(func->name())); uniqueFunctions.append(func->name()); @@ -685,6 +685,10 @@ void QtDocGenerator::writeFunction(TextStream& s, const AbstractMetaClass* cppCl Indentation indentation(s); if (!indexed) s << "\n:noindex:"; + if (func->attributes().testFlag(AbstractMetaFunction::Attribute::FinalCppMethod)) + s << "\n:final:"; + else if (func->isAbstract()) + s << "\n:abstractmethod:"; s << "\n\n"; writeFunctionParametersType(s, cppClass, func); const auto version = versionOf(func->typeEntry()); |