aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-05-30 15:50:55 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-06-02 08:49:51 +0000
commitaa30d9026c09e826f1f965bb4b1682debfc97df9 (patch)
tree6cd030a19e66c2e606f1fd83a23c066e8ede34dd /src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc
parent1af7f8a597138d57e4ea932572f0dd5c0832bcf0 (diff)
Add support for configurable palettes
A style's default palette is specified in qtquickcontrols2.conf in a "Palette" group under the style's section. QSettings supports the following two alternative syntaxes: [Fusion] Palette\Window=#dedede Palette\WindowText=#212121 or [Fusion\Palette] Window=#dedede WindowText=#212121 Change-Id: I01bf44d9e332064e955e95f619de634fcb79f010 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc')
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc
index 1e0a1e42..358b09ce 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc
@@ -110,6 +110,89 @@
Available values: \c StyleNormal, \c StyleItalic, \c StyleOblique.
\endtable
+ The default \l {Control::palette}{palette} can be specified in a \c Palette sub-group
+ in each style's section in the configuration file. The \c Palette sub-group can be
+ defined in two alternative ways:
+
+ \code
+ [Fusion]
+ Palette\Window=#dedede
+ Palette\WindowText=#212121
+ \endcode
+
+ or:
+ \code
+ [Fusion\Palette]
+ Window=#dedede
+ WindowText=#212121
+ \endcode
+
+ Supported palette attributes:
+ \table
+ \header
+ \li Variable
+ \li Description
+ \row
+ \li \l {QPalette::ColorRole}{\c Window}
+ \li A general background color.
+ \row
+ \li \l {QPalette::ColorRole}{\c WindowText}
+ \li A general foreground color.
+ \row
+ \li \l {QPalette::ColorRole}{\c Base}
+ \li Used mostly as the background color for text editor controls and items views.
+ It is usually white or another light color.
+ \row
+ \li \l {QPalette::ColorRole}{\c Text}
+ \li The foreground color used with \c Base. This is usually the same as the \c WindowText,
+ in which case it must provide good contrast with \c Window and \c Base.
+ \row
+ \li \l {QPalette::ColorRole}{\c Button}
+ \li The general button background color. This background can be different from \c Window
+ as some styles require a different background color for buttons.
+ \row
+ \li \l {QPalette::ColorRole}{\c ButtonText}
+ \li A foreground color used with the \c Button color.
+ \row
+ \li \l {QPalette::ColorRole}{\c BrightText}
+ \li A text color that is very different from \c WindowText, and contrasts well with e.g. \c Dark.
+ Typically used for text that needs to be drawn where \c Text, \c WindowText or \c ButtonText
+ would give poor contrast, such as on highlighted buttons.
+ \row
+ \li \l {QPalette::ColorRole}{\c ToolTipBase}
+ \li Used as the background color for tooltips.
+ \row
+ \li \l {QPalette::ColorRole}{\c ToolTipText}
+ \li Used as the foreground color for tooltips.
+
+ \row
+ \li \l {QPalette::ColorRole}{\c Light}
+ \li Lighter than \c Button.
+ \row
+ \li \l {QPalette::ColorRole}{\c Midlight}
+ \li Between \c Button and \c Light.
+ \row
+ \li \l {QPalette::ColorRole}{\c Dark}
+ \li Darker than \c Button.
+ \row
+ \li \l {QPalette::ColorRole}{\c Mid}
+ \li Between \c Button and \c Dark.
+ \row
+ \li \l {QPalette::ColorRole}{\c Shadow}
+ \li A very dark color.
+
+ \row
+ \li \l {QPalette::ColorRole}{\c Highlight}
+ \li A color to indicate a selected item or the current item.
+ \row
+ \li \l {QPalette::ColorRole}{\c HighlightedText}
+ \li A text color that contrasts with \c Highlight.
+
+ \row
+ \li \l {QPalette::ColorRole}{\c Link}
+ \li A text color used for hyperlinks.
+ \endtable
+
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: