summaryrefslogtreecommitdiff
path: root/src/extras/doc/src
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2015-02-17 13:53:44 +0100
committerCaroline Chao <caroline.chao@theqtcompany.com>2015-03-02 13:52:13 +0000
commitf0c227f8a9a5c5e3ed83f86702626092457175aa (patch)
tree9d5903b76206906a7dc5abff7a8c06bfcfc3f129 /src/extras/doc/src
parentb80076c53c045076afdba44a975a533d130a7b60 (diff)
downloadqtquickcontrols-f0c227f8a9a5c5e3ed83f86702626092457175aa.tar.gz
Merge Extras' styling system into Controls'.
- Removes the duplicated style settings functionality in Extras and simplifies the installed styles directory structure. - Extras' Base style is now part of Controls' Base style, eliminating the need for a separate QtQuick.Extras.Styles import. The cost of doing this should be negligible: a few QML files and two images. If we didn't merge Extras' Baste style into Controls', we'd need extras-specific code in qquickcontrolssettings, as the default style search path is: qml/QtQuick/Controls/Styles/ Whereas the Extras Base style would be in: qml/QtQuick/Extras/Styles/ The Extras Base style can't go into Controls' Base style directory, either, because otherwise we'd have two qmldir files there. The Flat style doesn't have this problem because it is all contained in one plugin and gets installed into its own Flat/ folder. - Documentation now lists the Extras controls as \since QtQuick.Extras 1.4. - Adds the customcontrolsstyle auto test to ensure that custom styling is tested. Change-Id: I19ca7a8b7e1c1daa85b272f4ccf9a2f05c76e0d9 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/extras/doc/src')
-rw-r--r--src/extras/doc/src/qtquickextras-index.qdoc4
-rw-r--r--src/extras/doc/src/qtquickextras-overview.qdoc4
-rw-r--r--src/extras/doc/src/qtquickextras.qdoc6
-rw-r--r--src/extras/doc/src/qtquickextrasstyles-index.qdoc130
-rw-r--r--src/extras/doc/src/styling-circulargauge.qdoc145
-rw-r--r--src/extras/doc/src/styling-gauge.qdoc129
6 files changed, 7 insertions, 411 deletions
diff --git a/src/extras/doc/src/qtquickextras-index.qdoc b/src/extras/doc/src/qtquickextras-index.qdoc
index 18e40711..63966614 100644
--- a/src/extras/doc/src/qtquickextras-index.qdoc
+++ b/src/extras/doc/src/qtquickextras-index.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \page index.html
+ \page qtquickextras-index.html
\title Qt Quick Extras
\brief The Qt Quick Extras module provides a set of UI controls for Qt
@@ -51,6 +51,6 @@
\li \l{Qt Quick Extras Overview}
\li \l{Qt Quick Extras QML Types}{Qt Quick Extras QML Types}
\li \l{Qt Quick Extras Examples}
- \li \l{Qt Quick Extras Styles}
+ \li \l{Qt Quick Controls Styles}
\endlist
*/
diff --git a/src/extras/doc/src/qtquickextras-overview.qdoc b/src/extras/doc/src/qtquickextras-overview.qdoc
index 63732c50..5d5edf7c 100644
--- a/src/extras/doc/src/qtquickextras-overview.qdoc
+++ b/src/extras/doc/src/qtquickextras-overview.qdoc
@@ -64,7 +64,7 @@
import statement in your \c {.qml} file.
\code
- import QtQuick.Extras 1.3
+ import QtQuick.Extras 1.4
\endcode
\section1 Interactive controls
@@ -81,7 +81,7 @@
\code
import QtQuick 2.2
- import QtQuick.Extras 1.3
+ import QtQuick.Extras 1.4
Rectangle {
DelayButton {
diff --git a/src/extras/doc/src/qtquickextras.qdoc b/src/extras/doc/src/qtquickextras.qdoc
index 835b14fd..39f81f06 100644
--- a/src/extras/doc/src/qtquickextras.qdoc
+++ b/src/extras/doc/src/qtquickextras.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \qmlmodule QtQuick.Extras 1.3
+ \qmlmodule QtQuick.Extras 1.4
\title Qt Quick Extras QML Types
\ingroup qmlmodules
\brief Provides QML types for user interfaces.
@@ -36,13 +36,13 @@
\l{Qt Quick} and \l{Qt Quick Controls}.
Controls can be styled using the
- \l{Qt Quick Extras Styles QML Types}{Styles QML Types}.
+ \l{Qt Quick Controls Styles QML Types}{Styles QML Types}.
The QML types can be imported into your application using the
following import statement in your .qml file.
\code
- import QtQuick.Extras 1.3
+ import QtQuick.Extras 1.4
\endcode
*/
diff --git a/src/extras/doc/src/qtquickextrasstyles-index.qdoc b/src/extras/doc/src/qtquickextrasstyles-index.qdoc
deleted file mode 100644
index 6af24bb7..00000000
--- a/src/extras/doc/src/qtquickextrasstyles-index.qdoc
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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$
-**
-****************************************************************************/
-
-/*!
- \group extrasstyling
- \title Styling Extras Controls
-*/
-
-/*!
- \page qtquickextrasstyles-index.html
- \title Qt Quick Extras Styles
- \brief The Qt Quick Extras Styles submodule provides custom
- styles for Qt Quick Extras.
-
- The Qt Quick Extras Styles module allows custom styling for
- \l {Qt Quick Extras}.
-
- The submodule requires \l{Qt Quick} 2.2.
-
- \section1 Getting started
-
- The QML types can be imported into your application using the following
- import statement in your \c {.qml} file.
-
- \code
- import QtQuick.Extras.Styles 1.3
- \endcode
-
- \section1 Styles
-
- \section2 Base Style
-
- The Base Style is the default style used when none is specified. It is also
- used as a fallback when the specified style cannot be found.
-
- \image tumbler.png
- \caption The Base Style Tumbler.
-
- \section2 Flat Style
-
- The Flat Style is designed for touch devices. It was introduced in Qt Quick
- Extras Controls 1.3 and requires Qt 5.4.
-
- \image tumbler-flat-style.png
- \caption The Flat Style Tumbler.
-
- \section2 Selecting Styles
-
- Qt Quick Extras follow Qt Quick Controls' styling system. You
- can apply a different style to the controls by setting the
- \e QT_QUICK_CONTROLS_STYLE environment variable to the name of the style.
- For example, to use the Flat style, you can do the following:
-
- \code
- QT_QUICK_CONTROLS_STYLE=Flat ./app
- \endcode
-
- This can also be done in C++, using qputenv():
-
- \code
- qputenv("QT_QUICK_CONTROLS_STYLE", "Flat");
- \endcode
-
- \section1 Control Styles
- \annotatedlist extrasstyles
-
- \section1 Styling Tutorials
- \annotatedlist extrasstyling
-
- \section1 Related information
-
- \list
- \li \l{Qt Quick}
- \li \l{Qt Quick Extras}
- \li \l{Qt Quick Extras Styles QML Types}
- \endlist
-*/
-
-/*!
- \page qtquickextrasstyles-structure.html
- \title Qt Quick Extras Styles Structure
- \list
- \li \l{Qt Quick Extras Styles}
- \list
- \li \l{Qt Quick Extras Styles QML Types}{Styles QMl Types}
- \endlist
- \endlist
-*/
-
-/*!
- \qmlmodule QtQuick.Extras.Styles 1.0
- \title Qt Quick Extras Styles QML Types
- \ingroup qmlmodules
- \brief Provides QML types for Qt Quick Extras styles.
-
- The \l{Qt Quick Extras} module provides a set of QML types for
- handling styles.
-
- Some of the controls allow custom styling similar to widget style sheets.
- A styling object is usually a collection of properties that control behavior
- and simple delegates that can be replaced with custom QML snippets.
-
- \code
- import QtQuick.Extras.Styles 1.3
- \endcode
-*/
diff --git a/src/extras/doc/src/styling-circulargauge.qdoc b/src/extras/doc/src/styling-circulargauge.qdoc
deleted file mode 100644
index 9cf94087..00000000
--- a/src/extras/doc/src/styling-circulargauge.qdoc
+++ /dev/null
@@ -1,145 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 styling-circulargauge.html
- \title Styling CircularGauge
- \brief Tutorial for styling CircularGauge.
- \ingroup extrasstyling
-
- \target styling-circulargauge-needle
- \section2 The Needle Component
-
- The \l {QtQuick.Extras.Styles::CircularGaugeStyle::}{needle}
- component is rotated around the gauge to represent the current value.
-
- Starting from the default style, we'll add a very basic white needle:
-
- \snippet circulargauge-background-range.qml needle
-
- \image styling-circulargauge-needle-example.png
-
- As mentioned in the documentation for \l {QtQuick.Extras.Styles::}
- {CircularGaugeStyle}, \c implicitWidth
- and \c implicitHeight properties need to be set. This is so that the needle
- can be positioned properly. We always scale items by the
- \l {QtQuick.Extras.Styles::CircularGaugeStyle::}{outerRadius}
- property of the style, ensuring the control resizes gracefully.
-
- We offset the needle vertically so that its back sits beyond the knob.
-
- \target styling-circulargauge-foreground
- \section2 The Foreground Component
-
- We've now changed the needle, but the default knob is still there; let's
- replace it. The \l {QtQuick.Extras.Styles::CircularGaugeStyle::}
- {foreground} component defines the default knob, so we can specify our own by
- overriding it (note that we could also set it to \c null if we didn't want a
- foreground):
-
- \snippet circulargauge-background-range.qml foreground
-
- \image styling-circulargauge-knob-example.png
-
- Firstly, we create a circle from the Rectangle item by setting the radius to
- be half the width (either width or height will work here; they are always
- equal in this case). We make it a child of the Item, because the foreground
- fills the gauge. We then center it within the Item.
-
- We set the color of the knob to the same white that we used before.
-
- \target styling-circulargauge-tickmarkLabel
- \section2 The Tickmark Label Component
-
- Suppose we want to caution the user if the value displayed by the gauge goes
- above or below a certain range. We could present this range to the user in
- several ways:
-
- \list A
- \li Change the color of the tickmarks depending on \c styleData.value
- \li Add an image to the background
- \li Draw it with \l {QtQuick::}{Canvas}
- \endlist
-
- We'll choose options 1 and 3, as they are more flexible than using an
- image.
-
- Firstly, let's change the color of the three highest tickmark labels:
-
- \snippet circulargauge-background-range.qml tickmarkLabel
-
- \image styling-circulargauge-tickmarkLabel-example.png tickmarkLabel
-
- We also change the color of the rest of the labels to the same white that
- we used for the needle and knob.
-
- \target styling-circulargauge-tickmark
- \section2 The Tickmark Component
-
- Now let's do the same for the three highest tickmarks:
-
- \snippet circulargauge-background-range.qml tickmark
-
- \image styling-circulargauge-tickmark-example.png tickmark
-
- \target styling-circulargauge-minorTickmark
- \section2 The Minor Tickmark Component
-
- For the minor tickmarks, we'll only show those which are not higher than
- \c 80:
-
- \snippet circulargauge-background-range.qml minorTickmark
-
- \image styling-circulargauge-minorTickmark-example.png minorTickmark
-
- This is because we'll draw something between that range in the next section.
-
- \target styling-circulargauge-background
- \section2 The Background Component
-
- We'll display the range that indicates caution with an orange arc:
-
- \snippet circulargauge-background-range.qml background
-
- We define a function to convert degrees to radians, which are the
- units used by \l {QtQuick::}{Canvas}.
-
- Next, we do the drawing of the range using Canvas. We draw an arc between
- \c 80 and \c 100, using the
- \l {QtQuick.Extras.Styles::CircularGaugeStyle::}{valueToAngle()}
- function provided by CircularGaugeStyle. Note that we subtract \c 90 degrees
- before converting to radians, as our origin is north and Canvas' is east.
-
- The finished product:
-
- \image styling-circulargauge-background-example.png background
-
- The complete code for this example is as follows:
-
- \snippet circulargauge-background-range.qml range
-*/
-
diff --git a/src/extras/doc/src/styling-gauge.qdoc b/src/extras/doc/src/styling-gauge.qdoc
deleted file mode 100644
index accdd425..00000000
--- a/src/extras/doc/src/styling-gauge.qdoc
+++ /dev/null
@@ -1,129 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 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 styling-gauge.html
- \title Styling Gauge
- \brief Tutorial for styling the Gauge control.
- \ingroup extrasstyling
-
- As GaugeStyle's documentation adequately covers common use cases, this
- tutorial will cover a different scenario: one where the gauge's tickmarks
- cover the value bar, instead of being aligned to the left or right of it.
-
- \target styling-gauge-valueBar
- \section2 The Value Bar Component
-
- The \l {QtQuick.Extras.Styles::GaugeStyle::}{valueBar}
- component is resized according to the gauge's value; if the value is low,
- the bar will be small, and vice versa.
-
- Starting from the default style, we'll change the color of the value bar to
- orange, and increase its width slightly:
-
- \snippet styling-gauge.qml valueBar
-
- \image styling-gauge-valueBar.png
-
- As mentioned in the documentation for GaugeStyle, \c implicitWidth needs to
- be set when defining your own value bar.
-
- \target styling-gauge-foreground
- \section2 The Foreground Component
-
- The \l {QtQuick.Extras.Styles::GaugeStyle::}{foreground}
- component covers the full width and height of the value bar, even when the
- value bar is not at its highest. By default, the foreground component
- provides a "sheen". We'll choose to discard this, and leave it empty
- instead:
-
- \snippet styling-gauge.qml foreground
-
- \image styling-gauge-foreground.png
-
- \target styling-gauge-tickmark
- \section2 The Tickmark Component
-
- The \l {QtQuick.Extras.Styles::GaugeStyle::}{tickmark}
- component sits to the left or right of the value bar, depending on the
- control's \l {Gauge::tickmarkAlignment}{tickmarkAlignment}. In order to
- have the tickmarks cover the width of the value bar instead, we need to do
- two things:
- \list 1
- \li Remove the space the tickmarks previously assumed so that there is
- just enough space for margins between the tickmarks and value bar.
- \li Position the tickmarks according to the control's orientation and
- tickmark alignment.
- \endlist
-
- \snippet styling-gauge.qml tickmark
-
- In this case we chose \c 8 pixel margins, so we set the \c implicitWidth of
- the tickmarks to that.
-
- We account for every possible orientation and tickmark alignment, something
- that is not necessary if the gauge will only ever have one orientation and
- alignment. For example, if the gauge will always be of a vertical
- orientation and the tickmarks left-aligned, then it is enough to set the
- \c x property of the \c Rectangle to the following:
-
- \code
- x: parent.implicitWidth
- \endcode
-
- The value bar is \c 28 pixels wide, so we give the same width to our
- tickmarks so that they cover the width of it.
-
- \image styling-gauge-tickmark.png
-
- \target styling-gauge-minorTickmark
- \section2 The Minor Tickmark Component
-
- The \l {QtQuick.Extras.Styles::GaugeStyle::}{minorTickmark}
- component is almost identical to its larger counterpart, except that its
- width does not affect the layout of the gauge's components. We'll do
- similar adjustments to the ones in the previous section - the only
- difference being the height:
-
- \snippet styling-gauge.qml minorTickmark
-
- \image styling-gauge-minorTickmark.png
-
- \target styling-gauge-font-size
- \section2 Adjusting Font Size
-
- Finally, we increase the \l {Gauge::font}{font} size to \c 15 pixels:
-
- \snippet styling-gauge.qml font-size
- \image styling-gauge-font-size.png
-
- \target styling-gauge-complete
- \section2 Complete Source Code
-
- \snippet styling-gauge.qml all
-*/
-