diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2023-07-11 10:07:27 +0800 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2023-07-12 11:25:50 +0800 |
commit | f621aa484beeac373d352409c721a3af3928d737 (patch) | |
tree | de758f3c52d61ffcacfafd2e556bf7150d945c66 | |
parent | 53144f16c6bf5f69585f8227dc1bf7df6416e7d1 (diff) |
doc: mention C++ compiler benefits of compile-time style selection
Task-number: QTBUG-110827
Pick-to: 6.5 6.6
Change-Id: I419f37ffcc6a1487ccaa63ddc01adc9d5eb9352e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r-- | src/quickcontrols/doc/src/qtquickcontrols-styles.qdoc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/quickcontrols/doc/src/qtquickcontrols-styles.qdoc b/src/quickcontrols/doc/src/qtquickcontrols-styles.qdoc index ec8e371a01..037ca15081 100644 --- a/src/quickcontrols/doc/src/qtquickcontrols-styles.qdoc +++ b/src/quickcontrols/doc/src/qtquickcontrols-styles.qdoc @@ -109,12 +109,19 @@ import QtQuick.Controls.Basic auto \endcode - The benefit of compile-time style selection is that the QtQuick.Controls plugin - is not used and therefore does not need to be deployed with the application. + The benefit of compile-time style selection is that the + \l {The QML script compiler}{QML compiler} knows which specific style + is in use and can generate C++ code for bindings. + + Another benefit is that the QtQuick.Controls plugin is not used and + therefore does not need to be deployed with the application. Explicit imports are also necessary if your application is built \l {Static Builds}{statically}. + A disadvantage of compile-time style selection is that one executable + cannot support multiple styles, as each style requires its own. + \section2 Run-Time Style Selection Run-time style selection is a way of specifying a style to use by importing @@ -142,6 +149,12 @@ can support multiple styles, meaning that the end user can choose which style to run the application with. + A disadvantage of this approach is that \l {The QML script compiler} + {QML compiler} can't know which specific style is in use and therefore + cannot generate C++ code for bindings on properties of Qt Quick Controls + types. This does not affect the QML compiler's abilities to generate C++ + for bindings on types from other modules. + \section3 Using QQuickStyle in C++ \l[CPP]{QQuickStyle} provides C++ API for configuring a specific |