diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2022-07-26 14:38:57 +0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-07-27 10:49:52 +0000 |
commit | 219989d67a3577471fb0945d76ed0d5b8d57f876 (patch) | |
tree | 68f0859622c4f6b06636fc6bf4c7ee8eebfca5c8 | |
parent | 40f82b9b883567fc22ecfee66cc7858c98b76f3f (diff) |
Doc: explain which default styles are used on which platforms
Task-number: QTBUG-105149
Change-Id: I6af546330ee71bb43d7feb3e47936156e644f75a
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit 86582e456fd078ea107c3ddb9c820739d3ab3868)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/quickcontrols2/doc/src/qtquickcontrols2-styles.qdoc | 22 | ||||
-rw-r--r-- | src/quickcontrols2/qquickstyle.cpp | 3 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/quickcontrols2/doc/src/qtquickcontrols2-styles.qdoc b/src/quickcontrols2/doc/src/qtquickcontrols2-styles.qdoc index 12993fbf18..4273c47264 100644 --- a/src/quickcontrols2/doc/src/qtquickcontrols2-styles.qdoc +++ b/src/quickcontrols2/doc/src/qtquickcontrols2-styles.qdoc @@ -81,13 +81,24 @@ \section1 Using Styles in Qt Quick Controls - There are two ways of using styles in Qt Quick Controls: - run-time style selection and compile-time style selection. + \section2 Default Styles + + If no style is explicitly set, a default style will be used. The style that + is used depends on the operating system: + + \list + \li Android: \l {Material Style} + \li Linux: \l {Fusion Style} + \li macOS: \l {macOS Style} + \li Windows: \l {Windows Style} + \endlist + + For all other operating systems, the \l {Basic Style} is used. \section2 Compile-Time Style Selection - Compile-time style selection involves using QML imports to specify the - style. For example, to import the Material style: + Compile-time style selection is a way of specifying a style to use by + importing it in QML. For example, to import the Material style: \qml import QtQuick.Controls.Material @@ -115,7 +126,8 @@ \section2 Run-Time Style Selection - Run-time style selection involves importing \c QtQuick.Controls: + Run-time style selection is a way of specifying a style to use by importing + \c QtQuick.Controls: \qml import QtQuick.Controls diff --git a/src/quickcontrols2/qquickstyle.cpp b/src/quickcontrols2/qquickstyle.cpp index 0bab26b8a3..dc47dc4274 100644 --- a/src/quickcontrols2/qquickstyle.cpp +++ b/src/quickcontrols2/qquickstyle.cpp @@ -195,6 +195,9 @@ struct QQuickStyleSpec qCDebug(lcQtQuickControlsStyle) << "no style (or Default) was specified;" << "checking if we have an appropriate style for this platform"; + + // If these defaults are changed, ensure that the "Using Styles in Qt Quick Controls" + // section of qtquickcontrols2-styles.qdoc is updated. #if defined(Q_OS_MACOS) style = QLatin1String("macOS"); #elif defined(Q_OS_WINDOWS) |