diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-08-18 14:21:07 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-08-22 07:06:17 +0200 |
commit | 5789ae5da56b4f17fd126154f8a55bc7fcd936d8 (patch) | |
tree | 83e3566baa4423532b1846db18443b834d46cdcb | |
parent | 85987e81c89d6c03f5c9b9f5648db34af21414e1 (diff) |
Doc: Explain how DEPENDENCIES helps with type resolution
Pick-to: 6.5 6.6
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>
-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. |