aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2024-04-23 14:39:11 +0800
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-04-23 17:25:28 +0000
commit34f1dd6074c2a299bad46513337222071b6290c2 (patch)
tree4586d686379c80f99aec3ebf259e43887fd736fb
parentd150dd4702288a0cc8809c6aa0b4f9355a689c46 (diff)
Document all steps for subclassing QQuickAttachedPropertyPropagator
The process for exposing a C++ type as an attached type in QML is explained in the link at the top of the detailed description, but it could be missed, in which case the list below it would be missing important information. Pick-to: 6.5 Change-Id: Ied70de5f37acec338042541809097d352e03604b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c5b6beeff2e1ae2e18546f6bb39ebbed2e972b23) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/quickcontrols/qquickattachedpropertypropagator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quickcontrols/qquickattachedpropertypropagator.cpp b/src/quickcontrols/qquickattachedpropertypropagator.cpp
index fd0dcd00e8..de7d3c1e41 100644
--- a/src/quickcontrols/qquickattachedpropertypropagator.cpp
+++ b/src/quickcontrols/qquickattachedpropertypropagator.cpp
@@ -44,6 +44,9 @@ Q_LOGGING_CATEGORY(lcAttached, "qt.quick.controls.attachedpropertypropagator")
\li Call \l initialize() in the constructor
\li Define set/inherit/propagate/reset functions for each property as needed
\li Reimplement \l attachedParentChange() to handle property inheritance
+ \li Implement a static \c qmlAttachedProperties function and declare the
+ type as an attached QML type with \l QML_ELEMENT and \l QML_ATTACHED,
+ as detailed in \l {Providing Attached Properties}
\endlist
For an example that demonstrates this in depth, see