diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-08-18 14:21:07 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-08-22 08:37:36 +0000 |
commit | 06b20fdd739ac0aa415d01429434be1b7d264ffc (patch) | |
tree | 380c3f3507a8245de0ece35ca4b7e5fa16995492 | |
parent | fdead8a17edc16f6607e0ff4b0e7d3435df48e7b (diff) |
Doc: Explain how DEPENDENCIES helps with type resolution
Fixes: QTBUG-110821
Change-Id: I506c7781d1b6b4d4c3b741e779702d184d442faf
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
(cherry picked from commit 5789ae5da56b4f17fd126154f8a55bc7fcd936d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/qml/doc/src/cppintegration/exposecppattributes.qdoc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc index e3b3288a98..4f669eb124 100644 --- a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc +++ b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc @@ -39,6 +39,14 @@ Registration is required for Q_GADGET types, as they don't derive from a known common base and can't be made available automatically. Without registration, their properties and methods are inaccessible. +You can make C++ types from a different module available in your own module by +adding a dependency to your \l{qt_add_qml_module} call using the \e DEPENDENCIES +option. You may, for example, want to depend on QtQuick so that your QML-exposed +C++ types can use \l QColor as method arguments and return values. QtQuick +exposes \l QColor as a \l {QML Value Types}{value type} \e color. Such +dependencies may be automatically inferred at run time, but you should not rely +on this. + Also note that a number of the important concepts covered in this document are demonstrated in the \l{Writing QML Extensions with C++} tutorial. |