diff options
author | Topi Reinio <topi.reinio@qt.io> | 2022-05-25 21:59:06 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-06-13 09:52:47 +0000 |
commit | aa20eefca427123e591ff05af452b3c0c4805589 (patch) | |
tree | c0039111574911426808e9606907eec36f682272 /tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index | |
parent | 7b52506eb739536867655692cc247fa9ac45cef7 (diff) |
qdoc: Automatically resolve read-only attribute for QML properties
QDoc had code for automatically resolving the writability of a QML
property for properties that have an associated C++ property
declaration. However, this code path was never executed as it was
behind a conditional statement that always resolved to false.
Enable the automatic resolution - note that in Qt, many QML types
are nowadays implemented so that the C++ type is exposed to QML
via a private class that modify/extend the public type listed in
the documentation using the \instantiates command. Relations
of these private implementations to QML types are not possible
for QDoc to resolve; therefore this feature does not produce
reliable results for all existing properties.
To address this, turn the previous documentation warnings into a
debug message; these can be used to find the properties for which
auto-resolution fails; the \readonly command can be then inserted
manually as needed, or the public \instantiates C++ type declaration
can be amended with a QDOC_PROPERTY() macro.
Fixes: QTBUG-103828
Change-Id: I41ff613650668aef336394582ccc6f2b860fe8e1
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
(cherry picked from commit 4be3d11129af9e26cd52b4a0b0c55c97f9a7b896)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index')
-rw-r--r-- | tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index b/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index index 4a6de7b7d..8b1afc762 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index +++ b/tests/auto/qdoc/generatedoutput/expected_output/properties/testcpp.index @@ -103,10 +103,14 @@ </property> </class> </namespace> + <qmlclass name="TheType" qml-module-name="TheType" href="qml-thetype.html" status="active" access="public" location="properties.qdoc" documented="true" title="TheType" fulltitle="TheType" subtitle=""> + <qmlproperty name="name" fullname="TheType::name" href="qml-thetype.html#name-prop" status="active" access="public" location="properties.qdoc" documented="true" type="string" attached="false" writable="false" brief="Read-only status of this property is resolved from Q_PROPERTY"/> + </qmlclass> <group name="testgroup" href="testgroup.html" status="internal" seen="false" title=""/> <module name="TestCPP" href="testcpp-module.html" status="active" documented="true" seen="true" title="QDoc Test C++ Classes" brief="A test module page"> <contents name="linking-to-function-like-things" title="Linking to function-like things" level="1"/> <contents name="section" title="section()" level="2"/> </module> + <qmlmodule name="TheModule" qml-module-name="TheModule" href="themodule-qmlmodule.html" status="internal" seen="false" title=""/> </namespace> </INDEX> |