diff options
author | Topi Reinio <topi.reinio@qt.io> | 2022-12-07 22:17:08 +0000 |
---|---|---|
committer | Topi Reiniƶ <topi.reinio@qt.io> | 2022-12-12 08:11:09 +0000 |
commit | f003dd86a9b7a6edea2d0266ba8284871c480dd8 (patch) | |
tree | 2fea7debf84b04966c753da1aaa53a456947d6b5 /src/qdoc/qmlvisitor.cpp | |
parent | f443f635e942fab8770a8eff6884bc60accb7e1d (diff) | |
download | qttools-f003dd86a9b7a6edea2d0266ba8284871c480dd8.tar.gz |
qdoc: Unify handling of QML types and QML value types
QML value types, formerly known as basic types, are nowadays provided
by multiple modules and contain also properties and methods.
QDoc's support for value types was rather basic (pun intended):
No import/since statements nor sections for properties etc. was
generated, the reference page had essentially a flat structure
similar to a generic \page.
As QML and QML value types are closely related, eliminate the dedicated
Node subclass for value types (QmlValueTypeNode), handle both with
QmlTypeNode class, differentiating them only with NodeType enumeration.
Make Node::isQmlType() return true for both to provide similar behavior
for all QML types, with a few exceptions:
* Do not warn if \qmlvaluetype command is missing \inqmlmodule
info as many of the original value types do not document it
* Do not generate 'all members' file for value types as they're
not expected to inherit other types.
* Do not include the QML module name qualifier into the filenames
generated for value types. This is done in order to keep the
existing behavior for value types and to avoid creating
redirects for online documentation.
Related to the last point, remove code from
Generator::fullDocumentLocation() that was never executed as it was
a duplicate from Generator::fileBase().
Unifying the types under a single Node subclass allows for removal of
multiple functions and code paths related to value types. They have
some constraints compared to proper QML types, but QDoc does not
currently enforce them.
[ChangeLog][QDoc][QDoc now properly outputs documentation for QML
value types with properties and methods.]
Pick-to: 6.4
Fixes: QTBUG-109132
Change-Id: I418660b0a6e0461c82fd5cb67e4f955a0d9a712c
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/qmlvisitor.cpp')
-rw-r--r-- | src/qdoc/qmlvisitor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qdoc/qmlvisitor.cpp b/src/qdoc/qmlvisitor.cpp index ded3da8d4..a2d6c25af 100644 --- a/src/qdoc/qmlvisitor.cpp +++ b/src/qdoc/qmlvisitor.cpp @@ -480,7 +480,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiObjectDefinition *definition) if (candidate != nullptr) component = static_cast<QmlTypeNode *>(candidate); else - component = new QmlTypeNode(m_current, m_name); + component = new QmlTypeNode(m_current, m_name, Node::QmlType); component->setTitle(m_name); component->setImportList(m_importList); m_importList.clear(); |