diff options
Diffstat (limited to 'src/imports/controls/doc/src')
8 files changed, 425 insertions, 151 deletions
diff --git a/src/imports/controls/doc/src/includes/qquickmaterialstyle.qdocinc b/src/imports/controls/doc/src/includes/qquickmaterialstyle.qdocinc new file mode 100644 index 00000000..c5d94279 --- /dev/null +++ b/src/imports/controls/doc/src/includes/qquickmaterialstyle.qdocinc @@ -0,0 +1,63 @@ +//! [conf] +\table + \header + \li Variable + \li Description + \row + \li \c Theme + \li Specifies the default \l {material-theme-attached-prop}{Material theme}. + The value can be one of the available themes, for example \c "Dark". + \row + \li \c Accent + \li Specifies the default \l {material-accent-attached-prop}{Material accent color}. + The value can be any \l {colorbasictypedocs}{color}, but it is recommended to use + one of the \l {pre-defined Material colors}, for example \c "Teal". + \row + \li \c Primary + \li Specifies the default \l {material-primary-attached-prop}{Material primary color}. + The value can be any \l {colorbasictypedocs}{color}, but it is recommended to use + one of the \l {pre-defined Material colors}, for example \c "BlueGrey". + \row + \li \c Foreground + \li Specifies the default \l {material-foreground-attached-prop}{Material foreground color}. + The value can be any \l {colorbasictypedocs}{color}, or one of the \l {pre-defined Material colors}, + for example \c "Brown". + \row + \li \c Background + \li Specifies the default \l {material-background-attached-prop}{Material background color}. + The value can be any \l {colorbasictypedocs}{color}, or one of the \l {pre-defined Material colors}, + for example \c "Grey". +\endtable +//! [conf] + +//! [env] +\table + \header + \li Variable + \li Description + \row + \li \c QT_QUICK_CONTROLS_MATERIAL_THEME + \li Specifies the default \l {material-theme-attached-prop}{Material theme}. + The value can be one of the available themes, for example \c "Dark". + \row + \li \c QT_QUICK_CONTROLS_MATERIAL_ACCENT + \li Specifies the default \l {material-accent-attached-prop}{Material accent color}. + The value can be any \l {colorbasictypedocs}{color}, but it is recommended to use + one of the \l {pre-defined Material colors}, for example \c "Teal". + \row + \li \c QT_QUICK_CONTROLS_MATERIAL_PRIMARY + \li Specifies the default \l {material-primary-attached-prop}{Material primary color}. + The value can be any \l {colorbasictypedocs}{color}, but it is recommended to use + one of the \l {pre-defined Material colors}, for example \c "BlueGrey". + \row + \li \c QT_QUICK_CONTROLS_MATERIAL_FOREGROUND + \li Specifies the default \l {material-foreground-attached-prop}{Material foreground color}. + The value can be any \l {colorbasictypedocs}{color}, or one of the \l {pre-defined Material colors}, + for example \c "Brown". + \row + \li \c QT_QUICK_CONTROLS_MATERIAL_BACKGROUND + \li Specifies the default \l {material-background-attached-prop}{Material background color}. + The value can be any \l {colorbasictypedocs}{color}, or one of the \l {pre-defined Material colors}, + for example \c "Grey". +\endtable +//! [env] diff --git a/src/imports/controls/doc/src/includes/qquickuniversalstyle.qdocinc b/src/imports/controls/doc/src/includes/qquickuniversalstyle.qdocinc new file mode 100644 index 00000000..a7ecbaef --- /dev/null +++ b/src/imports/controls/doc/src/includes/qquickuniversalstyle.qdocinc @@ -0,0 +1,53 @@ +//! [conf] +\table + \header + \li Variable + \li Description + \row + \li \c Theme + \li Specifies the default \l {universal-theme-attached-prop}{Universal theme}. + The value can be one of the available themes, for example \c "Dark". + \row + \li \c Accent + \li Specifies the default \l {universal-accent-attached-prop}{Universal accent color}. + The value can be any \l {colorbasictypedocs}{color}, but it is recommended to use + one of the \l {pre-defined Universal colors}, for example \c "Violet". + \row + \li \c Foreground + \li Specifies the default \l {universal-foreground-attached-prop}{Universal foreground color}. + The value can be any \l {colorbasictypedocs}{color}, or one of the \l {pre-defined Universal colors}, + for example \c "Brown". + \row + \li \c Background + \li Specifies the default \l {universal-background-attached-prop}{Universal background color}. + The value can be any \l {colorbasictypedocs}{color}, or one of the \l {pre-defined Universal colors}, + for example \c "Steel". +\endtable +//! [conf] + +//! [env] +\table + \header + \li Variable + \li Description + \row + \li \c QT_QUICK_CONTROLS_UNIVERSAL_THEME + \li Specifies the default \l {universal-theme-attached-prop}{Universal theme}. + The value can be one of the available themes, for example \c "Dark". + \row + \li \c QT_QUICK_CONTROLS_UNIVERSAL_ACCENT + \li Specifies the default \l {universal-accent-attached-prop}{Universal accent color}. + The value can be any \l {colorbasictypedocs}{color}, but it is recommended to use + one of the \l {pre-defined Universal colors}, for example \c "Violet". + \row + \li \c QT_QUICK_CONTROLS_UNIVERSAL_FOREGROUND + \li Specifies the default \l {universal-foreground-attached-prop}{Universal foreground color}. + The value can be any \l {colorbasictypedocs}{color}, or one of the \l {pre-defined Universal colors}, + for example \c "Brown". + \row + \li \c QT_QUICK_CONTROLS_UNIVERSAL_BACKGROUND + \li Specifies the default \l {universal-background-attached-prop}{Universal background color}. + The value can be any \l {colorbasictypedocs}{color}, or one of the \l {pre-defined Universal colors}, + for example \c "Steel". +\endtable +//! [env] diff --git a/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc new file mode 100644 index 00000000..d03f2325 --- /dev/null +++ b/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page qtquickcontrols2-configuration.html + \title Qt Quick Controls 2 Configuration File + + Qt Quick Controls 2 support a special configuration file, \c :/qtquickcontrols2.conf, + that is built into an application's resources. + + The configuration file can specify the preferred style and certain style-specific + attributes. The following example specifies that the preferred style is the \l {Material style}. + Furthermore, when the application is run with the Material style, its theme is light and the + accent and primary colors are teal and blue grey, respectively. However, if the application + is run with the \l {Universal style} instead, the accent color is red and the appropriate theme + is chosen based on the system theme colors. + + \code + [Controls] + Style=Material + + [Universal] + Theme=System + Accent=Red + + [Material] + Theme=Light + Accent=Teal + Primary=BlueGrey + \endcode + + \l {Material style} specific values that can be specified in a \c Material + section of the configuration file: + + \include qquickmaterialstyle.qdocinc conf + + \l {Universal style} specific values that can be specified in a \c Universal + section of the configuration file: + + \include qquickuniversalstyle.qdocinc conf + + In order to make it possible for Qt Quick Controls 2 to find the configuration file, + it must be built into application's resources using the \l {The Qt Resource System}. + Here's an example \c .qrc file: + + \code + <!DOCTYPE RCC><RCC version="1.0"> + <qresource prefix="/"> + <file>qtquickcontrols2.conf</file> + </qresource> + </RCC> + \endcode + + \note Qt Quick Controls 2 uses a file selector to load the configuration file. It + is possible to provide a different configuration file for different platforms and + locales. See \l QFileSelector documentation for more details. + + Finally, the \c .qrc file must be listed in the application's \c .pro file so that + the build system knows about it. For example: + + \code + RESOURCES = application.qrc + \endcode + + \section1 Related Information + + \list + \li \l{Styling Qt Quick Controls 2} + \li \l{Supported Environment Variables in Qt Quick Controls 2} + \endlist +*/ diff --git a/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc new file mode 100644 index 00000000..7c1b1c16 --- /dev/null +++ b/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \page qtquickcontrols2-environment.html + \title Supported Environment Variables in Qt Quick Controls 2 + + This page contains a list of all environment variables that Qt Quick Controls 2 + supports. The environment variables are primarily meant for testing purposes, but + they can also be used to set system-wide defaults. + + \table + \header + \li Variable + \li Description + \row + \li \c QT_QUICK_CONTROLS_STYLE + \li Specifies the default \l {Styling Qt Quick Controls 2}{Qt Quick Controls 2 style}. + The value can be either one of the built-in styles, for example \c "Material", + or the path to a custom style such as \c ":/mystyle". + \row + \li \c QT_QUICK_CONTROLS_CONF + \li Specifies the location of the \l {Qt Quick Controls 2 configuration file}. + By default, the configuration file is loaded from the application's + resources in \c ":/qtquickcontrols2.conf". + \endtable + + \l {Material style} specific environment variables: + + \include qquickmaterialstyle.qdocinc env + + \l {Universal style} specific environment variables: + + \include qquickuniversalstyle.qdocinc env + + \section1 Related Information + + \list + \li \l{Styling Qt Quick Controls 2} + \li \l{Qt Quick Controls 2 Configuration File} + \endlist +*/ diff --git a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc index b17462cd..d3f3ec52 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc @@ -70,6 +70,8 @@ \li \l{Using File Selectors with Qt Quick Controls 2} \li \l{Differences between Qt Quick Controls} \li \l{Deploying Qt Quick Controls 2 Applications} + \li \l{Qt Quick Controls 2 Configuration File} + \li \l{Supported Environment Variables in Qt Quick Controls 2} \endlist \section1 Reference diff --git a/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc index eed4efe8..d841c46d 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -79,28 +79,6 @@ \image qtquickcontrols2-material-attributes.png - The following example illustrates how to create a red \e stop button with light text: - - \table - \row - \li - \qml - import QtQuick 2.0 - import QtQuick.Controls 2.1 - import QtQuick.Controls.Material 2.1 - - Button { - text: "Stop" - highlighted: true - - Material.accent: Material.Red - Material.theme: Material.Dark - } - \endqml - \li - \image qtquickcontrols2-material-button.png - \endtable - All attributes can be specified for any window or item, and they automatically propagate to children in the same manner as \l {Control::font}{fonts}. In the following example, the window and all three radio buttons appear in the dark @@ -134,37 +112,22 @@ \endtable In addition to specifying the attributes in QML, it is also possible to - specify them via environment variables or in a \l {qtquickcontrols2-conf} - {configuration file}. Attributes specified in QML take precedence over all - other methods. + specify them via environment variables or in a configuration file. Attributes + specified in QML take precedence over all other methods. + + \section3 Configuration File + + \include qquickmaterialstyle.qdocinc conf + + See \l {Qt Quick Controls 2 Configuration File} for more details about the + configuration file. \section3 Environment Variables - \table - \header - \li Variable - \li Description - \row - \li \c QT_QUICK_CONTROLS_MATERIAL_THEME - \li The value can be one of the available \l {material-theme-attached-prop}{themes}, - for example \c "Dark". - \row - \li \c QT_QUICK_CONTROLS_MATERIAL_ACCENT - \li The value can be any \l {colorbasictypedocs}{color}, but it is recommended - to use one of the \l {pre-defined Material colors}, for example \c "Teal". - \row - \li \c QT_QUICK_CONTROLS_MATERIAL_PRIMARY - \li The value can be any \l {colorbasictypedocs}{color}, but it is recommended - to use one of the \l {pre-defined Material colors}, for example \c "BlueGrey". - \row - \li \c QT_QUICK_CONTROLS_MATERIAL_FOREGROUND - \li The value can be any \l {colorbasictypedocs}{color}, or one of the - \l {pre-defined Material colors}. - \row - \li \c QT_QUICK_CONTROLS_MATERIAL_BACKGROUND - \li The value can be any \l {colorbasictypedocs}{color}, or one of the - \l {pre-defined Material colors}. - \endtable + \include qquickmaterialstyle.qdocinc env + + See \l {Supported Environment Variables in Qt Quick Controls 2} for the full + list of supported environment variables. \section2 Dependency @@ -263,6 +226,17 @@ The default value is \c Material.Pink. + In the following example, the accent color of the highlighted button is + changed to \c Material.Orange: + + \table + \row + \li + \snippet qtquickcontrols2-material-accent.qml 1 + \li + \image qtquickcontrols2-material-accent.png + \endtable + \note Even though the accent can be any \l {colorbasictypedocs}{color}, it is recommended to use one of the \l {pre-defined Material colors} that have been designed to work well with the rest of the Material style palette. @@ -276,6 +250,17 @@ The default value is theme-specific (light or dark). + In the following example, the background color of the button is changed to + \c Material.Teal: + + \table + \row + \li + \snippet qtquickcontrols2-material-background.qml 1 + \li + \image qtquickcontrols2-material-background.png + \endtable + \endstyleproperty \styleproperty {Material.elevation} {int} {material-elevation-attached-prop} @@ -286,6 +271,18 @@ The default value is control-specific. + In the following example, the elevation of the pane is set to \c 6 + in order to achieve the look of an + \l {https://material.google.com/components/cards.html}{elevated card}: + + \table + \row + \li + \snippet qtquickcontrols2-material-elevation.qml 1 + \li + \image qtquickcontrols2-material-elevation.png + \endtable + \endstyleproperty \styleproperty {Material.foreground} {color} {material-foreground-attached-prop} @@ -295,6 +292,17 @@ The default value is theme-specific (light or dark). + In the following example, the foreground color of the button is set to \c + Material.Pink: + + \table + \row + \li + \snippet qtquickcontrols2-material-foreground.qml 1 + \li + \image qtquickcontrols2-material-foreground.png + \endtable + \endstyleproperty \styleproperty {Material.primary} {color} {material-primary-attached-prop} @@ -302,6 +310,8 @@ This attached property holds the primary color of the theme. The property can be attached to any window or item. The value is propagated to children. + The primary color is used as the background color of ToolBar by default. + The default value is \c Material.Indigo. \note Even though the primary can be any \l {colorbasictypedocs}{color}, it is @@ -324,6 +334,17 @@ on the system theme colors. However, when reading the value of the theme property, the value is never \c System, but the actual theme. + In the following example, the theme for both the pane and the button is set + to \c Material.Dark: + + \table + \row + \li + \snippet qtquickcontrols2-material-theme.qml 1 + \li + \image qtquickcontrols2-material-theme.png + \endtable + \endstyleproperty \section1 Attached Method Documentation @@ -336,9 +357,6 @@ defaults to \c Material.Shade500. \qml - import QtQuick 2.0 - import QtQuick.Controls.Material 2.1 - Rectangle { color: Material.color(Material.Red) } diff --git a/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc index a1c4eeef..d9c03ec3 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -83,28 +83,15 @@ \section2 Using QQuickStyle in C++ - \l QQuickStyle provides API for configuring a specific style. The following + \l QQuickStyle provides C++ API for configuring a specific style. The following example runs a Qt Quick Controls 2 application with the Material style: \code - #include <QGuiApplication> - #include <QQmlApplicationEngine> - #include <QQuickStyle> - - int main(int argc, char *argv[]) - { - QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QGuiApplication app(argc, argv); - - QQuickStyle::setStyle("Material"); - - QQmlApplicationEngine engine; - engine.load(QUrl("qrc:/main.qml")); - - return app.exec(); - } + QQuickStyle::setStyle("Material"); \endcode + See the detailed description of \l QQuickStyle for more details. + \section2 Command line argument Passing a \c -style command line argument is the convenient way to test different @@ -126,47 +113,25 @@ QT_QUICK_CONTROLS_STYLE=universal ./app \endcode + See \l {Supported Environment Variables in Qt Quick Controls 2} for the full list + of supported environment variables. + \section2 Configuration file - \target qtquickcontrols2-conf Qt Quick Controls 2 support a special configuration file, \c :/qtquickcontrols2.conf, that is built into an application's resources. The configuration file can specify the preferred style (may be overridden by either of the methods described earlier) and certain style-specific attributes. The following - example specifies that the preferred style is the Material style. Furthermore, when the - application is run with the Material style, its theme is light and the accent and primary - colors are teal and blue grey, respectively. However, if the application is run with the - Universal style instead, the accent color is red and the appropriate theme is chosen based - on the system theme colors. + example specifies that the preferred style is the Material style. \code [Controls] Style=Material - - [Universal] - Theme=System - Accent=Red - - [Material] - Theme=Light - Accent=Teal - Primary=BlueGrey \endcode - In order to make it possible for Qt Quick Controls 2 to find the configuration file, - it must be built into application's resources using the \l {The Qt Resource System}. - - \note Qt Quick Controls 2 uses a file selector to load the configuration file. It - is possible to provide a different configuration file for different platforms and - locales. See \l QFileSelector documentation for more details. - - Finally, the configuration file must be listed in the application's \c .pro file so - that the build system knows about it. For example: - - \code - RESOURCES += qtquickcontrols2.conf - \endcode + See \l {Qt Quick Controls 2 Configuration File} for more details about the + configuration file. \section1 Related Information \list @@ -175,5 +140,7 @@ \li \l {Universal Style} \li \l{Using File Selectors with Qt Quick Controls 2} \li \l {Deploying Qt Quick Controls 2 Applications} + \li \l {Qt Quick Controls 2 Configuration File} + \li \l {Supported Environment Variables in Qt Quick Controls 2} \endlist */ diff --git a/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc index c3e75185..104c682f 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -78,28 +78,6 @@ \image qtquickcontrols2-universal-attributes.png - The following example illustrates how to create a red \e stop button with light text: - - \table - \row - \li - \qml - import QtQuick 2.0 - import QtQuick.Controls 2.1 - import QtQuick.Controls.Universal 2.1 - - Button { - text: "Stop" - highlighted: true - - Universal.accent: Universal.Red - Universal.theme: Universal.Dark - } - \endqml - \li - \image qtquickcontrols2-universal-button.png - \endtable - Both attributes can be specified for any window or item, and they automatically propagate to children in the same manner as \l {Control::font}{fonts}. In the following example, the window and all three radio buttons appear in the dark @@ -133,33 +111,22 @@ \endtable In addition to specifying the attributes in QML, it is also possible to - specify them via environment variables or in a \l {qtquickcontrols2-conf} - {configuration file}. Attributes specified in QML take precedence over all - other methods. + specify them via environment variables or in a configuration file. Attributes + specified in QML take precedence over all other methods. + + \section3 Configuration File + + \include qquickuniversalstyle.qdocinc conf + + See \l {Qt Quick Controls 2 Configuration File} for more details about the + configuration file. \section3 Environment Variables - \table - \header - \li Variable - \li Description - \row - \li \c QT_QUICK_CONTROLS_UNIVERSAL_THEME - \li The value can be one of the available \l {universal-theme-attached-prop}{themes}, - for example \c "Dark". - \row - \li \c QT_QUICK_CONTROLS_UNIVERSAL_ACCENT - \li The value can be any \l {colorbasictypedocs}{color}, but it is recommended - to use one of the \l {pre-defined Universal colors}, for example \c "Violet". - \row - \li \c QT_QUICK_CONTROLS_UNIVERSAL_FOREGROUND - \li The value can be any \l {colorbasictypedocs}{color}, or one of the - \l {pre-defined Universal colors}. - \row - \li \c QT_QUICK_CONTROLS_UNIVERSAL_BACKGROUND - \li The value can be any \l {colorbasictypedocs}{color}, or one of the - \l {pre-defined Universal colors}. - \endtable + \include qquickuniversalstyle.qdocinc env + + See \l {Supported Environment Variables in Qt Quick Controls 2} for the full + list of supported environment variables. \section2 Dependency @@ -209,8 +176,21 @@ This attached property holds the accent color of the theme. The property can be attached to any window or item. The value is propagated to children. + The default value is \c Universal.Cobalt. + + In the following example, the accent color of the highlighted button is + changed to \c Universal.Orange: + + \table + \row + \li + \snippet qtquickcontrols2-universal-accent.qml 1 + \li + \image qtquickcontrols2-universal-accent.png + \endtable + \note Even though the accent can be any \l {colorbasictypedocs}{color}, it is - recommended to use one of the \l {pre-defined Universal colors} that have been + recommended to use one of the \l {pre-defined Universal colors} that have been designed to work well with the rest of the Universal style palette. \endstyleproperty @@ -222,6 +202,17 @@ The default value is theme-specific (light or dark). + In the following example, the background color of the pane is changed to + \c Universal.Steel: + + \table + \row + \li + \snippet qtquickcontrols2-universal-background.qml 1 + \li + \image qtquickcontrols2-universal-background.png + \endtable + \endstyleproperty \styleproperty {Universal.foreground} {color} {universal-foreground-attached-prop} @@ -231,6 +222,17 @@ The default value is theme-specific (light or dark). + In the following example, the foreground color of the button is set to \c + Universal.Pink: + + \table + \row + \li + \snippet qtquickcontrols2-universal-foreground.qml 1 + \li + \image qtquickcontrols2-universal-foreground.png + \endtable + \styleproperty {Universal.theme} {enumeration} {universal-theme-attached-prop} \target universal-theme-attached-prop This attached property holds whether the theme is light or dark. The property @@ -245,6 +247,17 @@ on the system theme colors. However, when reading the value of the theme property, the value is never \c System, but the actual theme. + In the following example, the theme for both the pane and the button is set + to \c Universal.Dark: + + \table + \row + \li + \snippet qtquickcontrols2-universal-theme.qml 1 + \li + \image qtquickcontrols2-universal-theme.png + \endtable + \endstyleproperty \section1 Attached Method Documentation @@ -255,9 +268,6 @@ \l {pre-defined Universal colors}{pre-defined Universal color}. \qml - import QtQuick 2.0 - import QtQuick.Controls.Universal 2.1 - Rectangle { color: Universal.color(Universal.Red) } |