diff options
author | Topi Reinio <topi.reinio@qt.io> | 2024-03-08 13:50:56 +0000 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2024-03-21 13:03:57 +0000 |
commit | dd934e4663aa220d8546326c453de725ec976a22 (patch) | |
tree | 2b20ed9632db7253216d51cfa0cea670093f0eb9 /src/qdoc/qdoc/src/qdoc/generator.h | |
parent | 5c3800b7ff94b36b2ca13fc23acfd9209ea4c50b (diff) |
qdoc: Support auto-generated values in QML docs from C++ enums
C++ classes registered to QML expose also enums to QML, with values
available under <RegisteredQmlName>.<value>.
Add a new meta-command, \qmlenumeratorsfrom, to use in \qmlproperty
documentation. This command is used for associating a documented
C++ enum with a QML property.
The command takes a fully qualified C++ enum as an argument.
When set, the enum values and their descriptions are retrieved from
C++ \enum documentation during generation of the QML property.
Instead of the '<namespace>::' prefix that's used in C++ enum
documentation, use '<RegisteredQmlName>.' as the prefix. By default,
the prefix is the parent QML type name, but a custom prefix can
be provided with the optional argument in brackets.
The auto-generated value table is appended at the end of the
documentation body.
Because QDoc cannot extract documentation from source files outside
the current project, restrict the search for the C++ enum to the
primary tree only. Make Tree::findNodeByNameAndType() a public
function to enable this.
Fixes: QTBUG-92450
Change-Id: If51c6f392e5f20c12a37c585bfd7ef93f23baa15
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/qdoc/qdoc/src/qdoc/generator.h')
-rw-r--r-- | src/qdoc/qdoc/src/qdoc/generator.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qdoc/qdoc/src/qdoc/generator.h b/src/qdoc/qdoc/src/qdoc/generator.h index 46e11bafe..8f2b34039 100644 --- a/src/qdoc/qdoc/src/qdoc/generator.h +++ b/src/qdoc/qdoc/src/qdoc/generator.h @@ -108,6 +108,7 @@ protected: QMap<QString, QString> &formattingRightMap(); const Atom *generateAtomList(const Atom *atom, const Node *relative, CodeMarker *marker, bool generate, int &numGeneratedAtoms); + void generateEnumValuesForQmlProperty(const Node *node, CodeMarker *marker); void generateRequiredLinks(const Node *node, CodeMarker *marker); void generateLinkToExample(const ExampleNode *en, CodeMarker *marker, const QString &exampleUrl); |