summaryrefslogtreecommitdiff
path: root/src/extras
diff options
context:
space:
mode:
Diffstat (limited to 'src/extras')
-rw-r--r--src/extras/CircularGauge.qml26
-rw-r--r--src/extras/DelayButton.qml13
-rw-r--r--src/extras/Dial.qml24
-rw-r--r--src/extras/Gauge.qml16
-rw-r--r--src/extras/PieMenu.qml26
-rw-r--r--src/extras/Private/CircularButton.qml8
-rw-r--r--src/extras/Private/CircularButtonStyleHelper.qml2
-rw-r--r--src/extras/Private/CircularTickmarkLabel.qml4
-rw-r--r--src/extras/Private/Handle.qml4
-rw-r--r--src/extras/Private/PieMenuIcon.qml2
-rw-r--r--src/extras/Private/private.pri2
-rw-r--r--src/extras/Private/qquickstylesettings.cpp157
-rw-r--r--src/extras/Private/qquickstylesettings_p.h79
-rw-r--r--src/extras/StatusIndicator.qml14
-rw-r--r--src/extras/Styles/Base/Base.pro34
-rw-r--r--src/extras/Styles/Base/CircularButtonStyle.qml85
-rw-r--r--src/extras/Styles/Base/CircularGaugeStyle.qml498
-rw-r--r--src/extras/Styles/Base/CircularTickmarkLabelStyle.qml304
-rw-r--r--src/extras/Styles/Base/CommonStyleHelper.qml56
-rw-r--r--src/extras/Styles/Base/DelayButtonStyle.qml233
-rw-r--r--src/extras/Styles/Base/DialStyle.qml392
-rw-r--r--src/extras/Styles/Base/GaugeStyle.qml545
-rw-r--r--src/extras/Styles/Base/HandleStyle.qml73
-rw-r--r--src/extras/Styles/Base/HandleStyleHelper.qml91
-rw-r--r--src/extras/Styles/Base/PieMenuStyle.qml393
-rw-r--r--src/extras/Styles/Base/StatusIndicatorStyle.qml237
-rw-r--r--src/extras/Styles/Base/ToggleButtonStyle.qml294
-rw-r--r--src/extras/Styles/Base/TumblerStyle.qml330
-rw-r--r--src/extras/Styles/Base/basestyle.qrc19
-rw-r--r--src/extras/Styles/Base/basestyleplugin.cpp70
-rw-r--r--src/extras/Styles/Base/basestyleplugin.h58
-rw-r--r--src/extras/Styles/Base/images/knob.pngbin5495 -> 0 bytes
-rw-r--r--src/extras/Styles/Base/images/needle.pngbin4354 -> 0 bytes
-rw-r--r--src/extras/Styles/Base/qmldir4
-rw-r--r--src/extras/Styles/Flat/ApplicationWindowStyle.qml2
-rw-r--r--src/extras/Styles/Flat/CalendarStyle.qml2
-rw-r--r--src/extras/Styles/Flat/CircularButtonStyle.qml2
-rw-r--r--src/extras/Styles/Flat/CircularGaugeStyle.qml2
-rw-r--r--src/extras/Styles/Flat/CircularTickmarkLabelStyle.qml2
-rw-r--r--src/extras/Styles/Flat/DelayButtonStyle.qml4
-rw-r--r--src/extras/Styles/Flat/DialStyle.qml4
-rw-r--r--src/extras/Styles/Flat/GaugeStyle.qml4
-rw-r--r--src/extras/Styles/Flat/PieMenuStyle.qml2
-rw-r--r--src/extras/Styles/Flat/ProgressBarStyle.qml2
-rw-r--r--src/extras/Styles/Flat/RadioButtonStyle.qml2
-rw-r--r--src/extras/Styles/Flat/SliderStyle.qml2
-rw-r--r--src/extras/Styles/Flat/StatusIndicatorStyle.qml4
-rw-r--r--src/extras/Styles/Flat/ToggleButtonStyle.qml6
-rw-r--r--src/extras/Styles/Flat/TumblerStyle.qml4
-rw-r--r--src/extras/Styles/Flat/flatstyleplugin.cpp2
-rw-r--r--src/extras/Styles/styles.pro2
-rw-r--r--src/extras/ToggleButton.qml13
-rw-r--r--src/extras/Tumbler.qml20
-rw-r--r--src/extras/TumblerColumn.qml20
-rw-r--r--src/extras/doc/compat/qtquickextras.qdocconf5
-rw-r--r--src/extras/doc/images/circulargauge-angles.pngbin19719 -> 0 bytes
-rw-r--r--src/extras/doc/images/circulargauge-needle-example-2.pngbin12680 -> 0 bytes
-rw-r--r--src/extras/doc/images/circulargauge-needle.pngbin1561 -> 0 bytes
-rw-r--r--src/extras/doc/images/circulargauge-reversed.pngbin21836 -> 0 bytes
-rw-r--r--src/extras/doc/images/circulargauge-tickmark-indices-values.pngbin40132 -> 0 bytes
-rw-r--r--src/extras/doc/images/gauge-minorTickmark-example.pngbin4780 -> 0 bytes
-rw-r--r--src/extras/doc/images/gauge-temperature.pngbin6055 -> 0 bytes
-rw-r--r--src/extras/doc/images/gauge-tickmark-example.pngbin4882 -> 0 bytes
-rw-r--r--src/extras/doc/images/piemenu-menuitem-example.pngbin10606 -> 0 bytes
-rw-r--r--src/extras/doc/images/styling-circulargauge-background-example.pngbin13071 -> 0 bytes
-rw-r--r--src/extras/doc/images/styling-circulargauge-knob-example.pngbin13209 -> 0 bytes
-rw-r--r--src/extras/doc/images/styling-circulargauge-minorTickmark-example.pngbin11770 -> 0 bytes
-rw-r--r--src/extras/doc/images/styling-circulargauge-needle-example.pngbin13472 -> 0 bytes
-rw-r--r--src/extras/doc/images/styling-circulargauge-tickmark-example.pngbin12179 -> 0 bytes
-rw-r--r--src/extras/doc/images/styling-circulargauge-tickmarkLabel-example.pngbin12171 -> 0 bytes
-rw-r--r--src/extras/doc/images/styling-gauge-font-size.pngbin4410 -> 0 bytes
-rw-r--r--src/extras/doc/images/styling-gauge-foreground.pngbin3557 -> 0 bytes
-rw-r--r--src/extras/doc/images/styling-gauge-minorTickmark.pngbin3527 -> 0 bytes
-rw-r--r--src/extras/doc/images/styling-gauge-tickmark.pngbin3547 -> 0 bytes
-rw-r--r--src/extras/doc/images/styling-gauge-valueBar.pngbin3691 -> 0 bytes
-rw-r--r--src/extras/doc/qtquickextras-compat.qdocconf17
-rw-r--r--src/extras/doc/qtquickextras-project.qdocconf59
-rw-r--r--src/extras/doc/qtquickextras.qdocconf47
-rw-r--r--src/extras/doc/snippets/circulargauge-background-range.qml121
-rw-r--r--src/extras/doc/snippets/circulargauge-tickmark-indices-values.qml85
-rw-r--r--src/extras/doc/snippets/styling-gauge.qml93
-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
-rw-r--r--src/extras/extras.pro2
-rw-r--r--src/extras/plugin.cpp11
-rw-r--r--src/extras/plugin.h2
-rw-r--r--src/extras/qmldir2
-rw-r--r--src/extras/qquickpicture.cpp33
92 files changed, 180 insertions, 4909 deletions
diff --git a/src/extras/CircularGauge.qml b/src/extras/CircularGauge.qml
index 7a91f8bf..426d6e49 100644
--- a/src/extras/CircularGauge.qml
+++ b/src/extras/CircularGauge.qml
@@ -36,15 +36,15 @@
import QtQuick 2.2
// Workaround for QTBUG-37751; we need this import for RangeModel, although we shouldn't.
-import QtQuick.Controls 1.1
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
import QtQuick.Extras.Private 1.0
-import QtQuick.Extras.Styles 1.3
/*!
\qmltype CircularGauge
\inqmlmodule QtQuick.Extras
- \since QtQuick.Extras 1.0
+ \since 5.5
\ingroup extras
\ingroup extras-non-interactive
\brief A gauge that displays a value within a range along an arc.
@@ -58,9 +58,9 @@ import QtQuick.Extras.Styles 1.3
The minimum and maximum values displayable by the gauge can be set with the
\l minimumValue and \l maximumValue properties. The angle at which these
values are displayed can be set with the
- \l {QtQuick.Extras.Styles::CircularGaugeStyle::}{minimumValueAngle} and
- \l {QtQuick.Extras.Styles::CircularGaugeStyle::}{maximumValueAngle} properties of
- \l {QtQuick.Extras.Styles::}{CircularGaugeStyle}.
+ \l {QtQuick.Controls.Styles::CircularGaugeStyle::}{minimumValueAngle} and
+ \l {QtQuick.Controls.Styles::CircularGaugeStyle::}{maximumValueAngle} properties of
+ \l {QtQuick.Controls.Styles::}{CircularGaugeStyle}.
Example:
\code
@@ -89,13 +89,13 @@ import QtQuick.Extras.Styles 1.3
\endcode
You can create a custom appearance for a CircularGauge by assigning a
- \l {QtQuick.Extras.Styles::}{CircularGaugeStyle}.
+ \l {QtQuick.Controls.Styles::}{CircularGaugeStyle}.
*/
Control {
id: circularGauge
- style: Qt.createComponent(StyleSettings.style + "/CircularGaugeStyle.qml", circularGauge)
+ style: Settings.styleComponent(Settings.style, "CircularGaugeStyle.qml", circularGauge)
/*!
\qmlproperty real CircularGauge::minimumValue
@@ -131,20 +131,18 @@ Control {
property alias stepSize: range.stepSize
/*!
- \since 1.2
-
This property determines whether or not the gauge displays tickmarks,
minor tickmarks, and labels.
For more fine-grained control over what is displayed, the following
style components of
- \l {QtQuick.Extras.Styles::}{CircularGaugeStyle} can be
+ \l {QtQuick.Controls.Styles::}{CircularGaugeStyle} can be
used:
\list
- \li \l {QtQuick.Extras.Styles::CircularGaugeStyle::tickmark}{tickmark}
- \li \l {QtQuick.Extras.Styles::CircularGaugeStyle::minorTickmark}{minorTickmark}
- \li \l {QtQuick.Extras.Styles::CircularGaugeStyle::tickmarkLabel}{tickmarkLabel}
+ \li \l {QtQuick.Controls.Styles::CircularGaugeStyle::tickmark}{tickmark}
+ \li \l {QtQuick.Controls.Styles::CircularGaugeStyle::minorTickmark}{minorTickmark}
+ \li \l {QtQuick.Controls.Styles::CircularGaugeStyle::tickmarkLabel}{tickmarkLabel}
\endlist
*/
property bool tickmarksVisible: true
diff --git a/src/extras/DelayButton.qml b/src/extras/DelayButton.qml
index 7218d457..f855e90e 100644
--- a/src/extras/DelayButton.qml
+++ b/src/extras/DelayButton.qml
@@ -35,16 +35,15 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.1
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
-import QtQuick.Extras.Private 1.0
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4
+import QtQuick.Controls.Private 1.0
/*!
\qmltype DelayButton
\inherits QtQuickControls::Button
\inqmlmodule QtQuick.Extras
- \since QtQuick.Extras 1.0
+ \since 5.5
\ingroup extras
\ingroup extras-interactive
\brief A checkable button that triggers an action when held in long enough.
@@ -68,13 +67,13 @@ import QtQuick.Extras.Private 1.0
A DelayButton after being activated
You can create a custom appearance for a DelayButton by assigning a
- \l {QtQuick.Extras.Styles::}{DelayButtonStyle}.
+ \l {QtQuick.Controls.Styles::}{DelayButtonStyle}.
*/
Button {
id: root
- style: Qt.createComponent(StyleSettings.style + "/DelayButtonStyle.qml", root)
+ style: Settings.styleComponent(Settings.style, "DelayButtonStyle.qml", root)
/*!
\qmlproperty real DelayButton::progress
diff --git a/src/extras/Dial.qml b/src/extras/Dial.qml
index aa1dc4d6..4454c90d 100644
--- a/src/extras/Dial.qml
+++ b/src/extras/Dial.qml
@@ -35,16 +35,16 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.1
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
/*!
\qmltype Dial
\inqmlmodule QtQuick.Extras
- \since QtQuick.Extras 1.0
+ \since 5.5
\ingroup extras
\ingroup extras-interactive
\brief A circular dial that is rotated to set a value.
@@ -57,18 +57,18 @@ import QtQuick.Extras.Private 1.0
Like CircularGauge, Dial can display tickmarks to give an indication of
the current value. When a suitable stepSize is combined with
- \l {QtQuick.Extras.Styles::DialStyle::}{tickmarkStepSize},
+ \l {QtQuick.Controls.Styles::DialStyle::}{tickmarkStepSize},
the dial "snaps" to each tickmark.
You can create a custom appearance for a Dial by assigning a
- \l {QtQuick.Extras.Styles::}{DialStyle}.
+ \l {QtQuick.Controls.Styles::}{DialStyle}.
*/
Control {
id: dial
activeFocusOnTab: true
- style: Qt.createComponent(StyleSettings.style + "/DialStyle.qml", dial)
+ style: Settings.styleComponent(Settings.style, "DialStyle.qml", dial)
/*!
\qmlproperty real Dial::value
@@ -144,19 +144,17 @@ Control {
readonly property alias pressed: mouseArea.pressed
/*!
- \since QtQuick.Extras 1.1
-
This property determines whether or not the dial displays tickmarks,
minor tickmarks, and labels.
For more fine-grained control over what is displayed, the following
style components of
- \l {QtQuick.Extras.Styles::}{DialStyle} can be used:
+ \l {QtQuick.Controls.Styles::}{DialStyle} can be used:
\list
- \li \l {QtQuick.Extras.Styles::DialStyle::tickmark}{tickmark}
- \li \l {QtQuick.Extras.Styles::DialStyle::minorTickmark}{minorTickmark}
- \li \l {QtQuick.Extras.Styles::DialStyle::tickmarkLabel}{tickmarkLabel}
+ \li \l {QtQuick.Controls.Styles::DialStyle::tickmark}{tickmark}
+ \li \l {QtQuick.Controls.Styles::DialStyle::minorTickmark}{minorTickmark}
+ \li \l {QtQuick.Controls.Styles::DialStyle::tickmarkLabel}{tickmarkLabel}
\endlist
The default value is \c true.
diff --git a/src/extras/Gauge.qml b/src/extras/Gauge.qml
index 1a845ee3..f5a0071e 100644
--- a/src/extras/Gauge.qml
+++ b/src/extras/Gauge.qml
@@ -35,16 +35,16 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.1
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
/*!
\qmltype Gauge
\inqmlmodule QtQuick.Extras
- \since QtQuick.Extras 1.0
+ \since 5.5
\ingroup extras
\ingroup extras-non-interactive
\brief A straight gauge that displays a value within a range.
@@ -70,13 +70,13 @@ import QtQuick.Extras.Private 1.0
\endcode
You can create a custom appearance for a Gauge by assigning a
- \l {QtQuick.Extras.Styles::}{GaugeStyle}.
+ \l {QtQuick.Controls.Styles::}{GaugeStyle}.
*/
Control {
id: gauge
- style: Qt.createComponent(StyleSettings.style + "/GaugeStyle.qml", gauge)
+ style: Settings.styleComponent(Settings.style, "GaugeStyle.qml", gauge)
/*!
This property holds the smallest value displayed by the gauge.
@@ -172,11 +172,9 @@ Control {
property alias font: hiddenText.font
/*!
- \since QtQuick.Extras 1.3
-
This property accepts a function that formats the given \a value for
display in
- \l {QtQuick.Extras.Styles::GaugeStyle}{tickmarkLabel}.
+ \l {QtQuick.Controls.Styles::GaugeStyle}{tickmarkLabel}.
For example, to provide a custom format that displays all values with 3
decimal places:
diff --git a/src/extras/PieMenu.qml b/src/extras/PieMenu.qml
index 94b6d414..d667a9a8 100644
--- a/src/extras/PieMenu.qml
+++ b/src/extras/PieMenu.qml
@@ -35,17 +35,17 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.1
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
import QtQuick.Extras.Private.CppUtils 1.0 as CppUtils
-import QtQuick.Extras.Styles 1.3
/*!
\qmltype PieMenu
\inqmlmodule QtQuick.Extras
- \since QtQuick.Extras 1.0
+ \since 5.5
\ingroup extras
\ingroup extras-interactive
\brief A popup menu that displays several menu items along an arc.
@@ -147,19 +147,19 @@ import QtQuick.Extras.Styles 1.3
You can hide individual menu items by setting their visible property to
\c false. Hiding items does not affect the
- \l {QtQuick.Extras.Styles::PieMenuStyle::}{startAngle} or
- \l {QtQuick.Extras.Styles::PieMenuStyle::}{endAngle}; the
+ \l {QtQuick.Controls.Styles::PieMenuStyle::}{startAngle} or
+ \l {QtQuick.Controls.Styles::PieMenuStyle::}{endAngle}; the
remaining items will grow to consume the available space.
You can create a custom appearance for a PieMenu by assigning a
- \l {QtQuick.Extras.Styles::}{PieMenuStyle}.
+ \l {QtQuick.Controls.Styles::}{PieMenuStyle}.
*/
Control {
id: pieMenu
visible: false
- style: Qt.createComponent(StyleSettings.style + "/PieMenuStyle.qml", pieMenu)
+ style: Settings.styleComponent(Settings.style, "PieMenuStyle.qml", pieMenu)
/*!
This property reflects the angle (in radians) created by the imaginary
@@ -276,8 +276,6 @@ Control {
readonly property alias currentItem: protectedScope.currentItem
/*!
- \since QtQuick.Extras 1.1
-
This property defines the text that is shown above the menu when
there is no current menu item (currentIndex is \c -1).
@@ -286,8 +284,6 @@ Control {
property string title: ""
/*!
- \since QtQuick.Extras 1.2
-
The item which the menu must stay within.
A typical use case for PieMenu involves:
@@ -332,8 +328,6 @@ Control {
}
/*!
- \since QtQuick.Extras 1.1
-
\qmlmethod void addItem(string text)
Adds an item to the end of the menu items.
@@ -347,8 +341,6 @@ Control {
}
/*!
- \since QtQuick.Extras 1.1
-
\qmlmethod void insertItem(int before, string text)
Inserts a MenuItem with \a text before the index at \a before.
@@ -372,8 +364,6 @@ Control {
}
/*!
- \since QtQuick.Extras 1.1
-
\qmlmethod void removeItem(item)
Removes \a item from the menu.
diff --git a/src/extras/Private/CircularButton.qml b/src/extras/Private/CircularButton.qml
index b2baf5a2..5c7f2b7e 100644
--- a/src/extras/Private/CircularButton.qml
+++ b/src/extras/Private/CircularButton.qml
@@ -35,15 +35,15 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.1
-import QtQuick.Extras 1.3
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
-import QtQuick.Extras.Styles 1.3
/*!
\internal
*/
Button {
id: button
- style: Qt.createComponent(StyleSettings.style + "/CircularButtonStyle.qml", button)
+ style: Settings.styleComponent(Settings.style, "CircularButtonStyle.qml", button)
}
diff --git a/src/extras/Private/CircularButtonStyleHelper.qml b/src/extras/Private/CircularButtonStyleHelper.qml
index fedd3a37..77bdc9ef 100644
--- a/src/extras/Private/CircularButtonStyleHelper.qml
+++ b/src/extras/Private/CircularButtonStyleHelper.qml
@@ -35,7 +35,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Extras 1.3
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
QtObject {
diff --git a/src/extras/Private/CircularTickmarkLabel.qml b/src/extras/Private/CircularTickmarkLabel.qml
index 05554878..0e45f7b9 100644
--- a/src/extras/Private/CircularTickmarkLabel.qml
+++ b/src/extras/Private/CircularTickmarkLabel.qml
@@ -38,12 +38,12 @@ import QtQuick 2.2
// Workaround for QTBUG-37751; we need this import for RangeModel, although we shouldn't.
import QtQuick.Controls 1.1
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
Control {
id: label
- style: Qt.createComponent(StyleSettings.style + "/CircularTickmarkLabelStyle.qml", label)
+ style: Settings.styleComponent(Settings.style, "CircularTickmarkLabelStyle.qml", label)
property alias minimumValue: range.minimumValue
diff --git a/src/extras/Private/Handle.qml b/src/extras/Private/Handle.qml
index 12e2804d..31b4543f 100644
--- a/src/extras/Private/Handle.qml
+++ b/src/extras/Private/Handle.qml
@@ -36,8 +36,8 @@
import QtQuick 2.0
import QtGraphicalEffects 1.0
+import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras.Styles 1.3
import QtQuick.Extras.Private 1.1
import QtQuick.Extras.Private.CppUtils 1.0
@@ -46,7 +46,7 @@ Control {
x: handleArea.centerOfHandle.x - width / 2
y: handleArea.centerOfHandle.y - height / 2
- style: Qt.createComponent(StyleSettings.style + "/HandleStyle.qml", root)
+ style: Settings.styleComponent(Settings.style, "HandleStyle.qml", root)
/*!
The angle of the handle along the circumference of \l rotationRadius in
diff --git a/src/extras/Private/PieMenuIcon.qml b/src/extras/Private/PieMenuIcon.qml
index f54e035f..17304c94 100644
--- a/src/extras/Private/PieMenuIcon.qml
+++ b/src/extras/Private/PieMenuIcon.qml
@@ -35,7 +35,7 @@
****************************************************************************/
import QtQuick 2.3
-import QtQuick.Extras 1.3
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
import QtQuick.Extras.Private.CppUtils 1.0
diff --git a/src/extras/Private/private.pri b/src/extras/Private/private.pri
index 4f394412..0e4f7a12 100644
--- a/src/extras/Private/private.pri
+++ b/src/extras/Private/private.pri
@@ -4,14 +4,12 @@ HEADERS += \
$$PWD/qquickcircularprogressbar_p.h \
$$PWD/qquickflatprogressbar_p.h \
$$PWD/qquickmousethief_p.h \
- $$PWD/qquickstylesettings_p.h \
$$PWD/qquickmathutils_p.h
SOURCES += \
$$PWD/qquickcircularprogressbar.cpp \
$$PWD/qquickflatprogressbar.cpp \
$$PWD/qquickmousethief.cpp \
- $$PWD/qquickstylesettings.cpp \
$$PWD/qquickmathutils.cpp
OTHER_FILES += \
diff --git a/src/extras/Private/qquickstylesettings.cpp b/src/extras/Private/qquickstylesettings.cpp
deleted file mode 100644
index 0936e55e..00000000
--- a/src/extras/Private/qquickstylesettings.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickstylesettings_p.h"
-#include <qqmlengine.h>
-#include <qfileinfo.h>
-#include <qdebug.h>
-#include <qdir.h>
-
-QT_BEGIN_NAMESPACE
-
-static QString defaultStyleName()
-{
- return QLatin1String("Base");
-}
-
-static QString styleImportName()
-{
- QString name = qgetenv("QT_QUICK_CONTROLS_STYLE");
- if (name.isEmpty())
- name = defaultStyleName();
- return QFileInfo(name).fileName();
-}
-
-static bool isResource(const QString &path)
-{
- return path.startsWith(":/");
-}
-
-static QString styleImportPath(QQmlEngine *engine, const QString &styleName)
-{
- static const char * const stylePaths[] = { "/QtQuick/Extras/Styles", "/QtQuick/Controls/Styles" };
- QString path = qgetenv("QT_QUICK_CONTROLS_STYLE");
- QFileInfo info(path);
- if (isResource(path)) {
- path = info.path();
- } else if (info.isRelative()) {
- bool found = false;
- QStringList importPaths = engine->importPathList();
- importPaths.prepend(QStringLiteral(":/ExtrasImports/"));
-
- foreach (const QString &import, importPaths) {
- for (unsigned i = 0; i < sizeof(stylePaths) / sizeof(stylePaths[0]); i++) {
- QDir dir(import + QLatin1String(stylePaths[i]));
- if (dir.exists(styleName)) {
- found = true;
- path = dir.absolutePath();
- break;
- }
- }
- if (found)
- break;
- }
- if (!found)
- path = QLatin1String(":/ExtrasImports/QtQuick/Extras/Styles");
- } else {
- path = info.absolutePath();
- }
- return path;
-}
-
-QQuickStyleSettings::QQuickStyleSettings(QQmlEngine *engine)
-{
- m_name = styleImportName();
- m_path = styleImportPath(engine, m_name);
-
- QString path = styleFilePath();
-
- if (!QDir(path).exists()) {
- QString unknownStyle = m_name;
- m_name = defaultStyleName();
- m_path = styleImportPath(engine, m_name);
- qWarning() << "WARNING: Cannot find style" << unknownStyle << "- fallback:" << styleFilePath();
- }
-
- connect(this, SIGNAL(styleNameChanged()), SIGNAL(styleChanged()));
- connect(this, SIGNAL(stylePathChanged()), SIGNAL(styleChanged()));
-}
-
-QUrl QQuickStyleSettings::style() const
-{
- QUrl result;
- QString path = styleFilePath();
- if (isResource(path)) {
- result.setScheme("qrc");
- path.remove(0, 1); // remove ':' prefix
- result.setPath(path);
- } else
- result = QUrl::fromLocalFile(path);
- return result;
-}
-
-QString QQuickStyleSettings::styleName() const
-{
- return m_name;
-}
-
-void QQuickStyleSettings::setStyleName(const QString &name)
-{
- if (m_name != name) {
- m_name = name;
- emit styleNameChanged();
- }
-}
-
-QString QQuickStyleSettings::stylePath() const
-{
- return m_path;
-}
-
-void QQuickStyleSettings::setStylePath(const QString &path)
-{
- if (m_path != path) {
- m_path = path;
- emit stylePathChanged();
- }
-}
-
-QString QQuickStyleSettings::styleFilePath() const
-{
- return m_path + QLatin1Char('/') + m_name;
-}
-
-QT_END_NAMESPACE
diff --git a/src/extras/Private/qquickstylesettings_p.h b/src/extras/Private/qquickstylesettings_p.h
deleted file mode 100644
index 3cb157a8..00000000
--- a/src/extras/Private/qquickstylesettings_p.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef STYLESETTINGS_P_H
-#define STYLESETTINGS_P_H
-
-#include <QtCore/qurl.h>
-#include <QtCore/qobject.h>
-
-QT_BEGIN_NAMESPACE
-
-class QQmlEngine;
-
-class QQuickStyleSettings : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QUrl style READ style NOTIFY styleChanged)
- Q_PROPERTY(QString styleName READ styleName WRITE setStyleName NOTIFY styleNameChanged)
- Q_PROPERTY(QString stylePath READ stylePath WRITE setStylePath NOTIFY stylePathChanged)
-
-public:
- QQuickStyleSettings(QQmlEngine *engine);
-
- QUrl style() const;
-
- QString styleName() const;
- void setStyleName(const QString &name);
-
- QString stylePath() const;
- void setStylePath(const QString &path);
-
-signals:
- void styleChanged();
- void styleNameChanged();
- void stylePathChanged();
-
-private:
- QString styleFilePath() const;
-
- QString m_name;
- QString m_path;
-};
-
-QT_END_NAMESPACE
-
-#endif // STYLESETTINGS_P_H
diff --git a/src/extras/StatusIndicator.qml b/src/extras/StatusIndicator.qml
index 8be50737..a49df496 100644
--- a/src/extras/StatusIndicator.qml
+++ b/src/extras/StatusIndicator.qml
@@ -35,15 +35,15 @@
****************************************************************************/
import QtQuick 2.2
+import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
/*!
\qmltype StatusIndicator
\inqmlmodule QtQuick.Extras
- \since QtQuick.Extras 1.1
+ \since 5.5
\ingroup extras
\ingroup extras-non-interactive
\brief An indicator that displays active or inactive states.
@@ -65,7 +65,7 @@ import QtQuick.Extras.Private 1.0
\li
\code
import QtQuick 2.2
- import QtQuick.Extras 1.3
+ import QtQuick.Extras 1.4
Rectangle {
width: 100
@@ -82,13 +82,13 @@ import QtQuick.Extras.Private 1.0
\endtable
You can create a custom appearance for a StatusIndicator by assigning a
- \l {QtQuick.Extras.Styles::}{StatusIndicatorStyle}.
+ \l {QtQuick.Controls.Styles::}{StatusIndicatorStyle}.
*/
Control {
id: statusIndicator
- style: Qt.createComponent(StyleSettings.style + "/StatusIndicatorStyle.qml", statusIndicator)
+ style: Settings.styleComponent(Settings.style, "StatusIndicatorStyle.qml", statusIndicator)
/*!
This property specifies whether the indicator is active or inactive.
@@ -100,8 +100,6 @@ Control {
property alias on: statusIndicator.active
/*!
- \since QtQuick.Extras 1.2
-
This property specifies whether the indicator is active or inactive.
The default value is \c false (inactive).
diff --git a/src/extras/Styles/Base/Base.pro b/src/extras/Styles/Base/Base.pro
deleted file mode 100644
index fcb6ad95..00000000
--- a/src/extras/Styles/Base/Base.pro
+++ /dev/null
@@ -1,34 +0,0 @@
-TARGET = qtquickextrasstylesplugin
-TARGETPATH = QtQuick/Extras/Styles
-
-QT += qml
-
-HEADERS += \
- basestyleplugin.h
-SOURCES += \
- basestyleplugin.cpp
-
-BASE_STYLE = \
- $$PWD/CircularGaugeStyle.qml \
- $$PWD/CircularButtonStyle.qml \
- $$PWD/CircularTickmarkLabelStyle.qml \
- $$PWD/CommonStyleHelper.qml \
- $$PWD/DelayButtonStyle.qml \
- $$PWD/DialStyle.qml \
- $$PWD/GaugeStyle.qml \
- $$PWD/HandleStyle.qml \
- $$PWD/HandleStyleHelper.qml \
- $$PWD/PieMenuStyle.qml \
- $$PWD/StatusIndicatorStyle.qml \
- $$PWD/ToggleButtonStyle.qml \
- $$PWD/TumblerStyle.qml
-
-BASE_STYLE += \
- $$PWD/images/knob.png \
- $$PWD/images/needle.png
-
-RESOURCES += \
- basestyle.qrc
-
-CONFIG += no_cxx_module
-load(qml_plugin)
diff --git a/src/extras/Styles/Base/CircularButtonStyle.qml b/src/extras/Styles/Base/CircularButtonStyle.qml
deleted file mode 100644
index 9e29a534..00000000
--- a/src/extras/Styles/Base/CircularButtonStyle.qml
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtQuick.Controls.Styles 1.1
-import QtQuick.Extras.Styles 1.3
-import QtQuick.Extras.Private 1.0
-
-ButtonStyle {
- id: buttonStyle
-
- label: Text {
- anchors.fill: parent
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- text: control.text
- font.pixelSize: TextSingleton.font.pixelSize * 1.25
- color: control.pressed || control.checked ? __buttonHelper.textColorDown : __buttonHelper.textColorUp
- styleColor: control.pressed || control.checked ? __buttonHelper.textRaisedColorDown : __buttonHelper.textRaisedColorUp
- style: Text.Raised
- wrapMode: Text.Wrap
- fontSizeMode: Text.Fit
- }
-
- /*! \internal */
- property alias __buttonHelper: buttonHelper
-
- CircularButtonStyleHelper {
- id: buttonHelper
- control: buttonStyle.control
- }
-
- background: Item {
- implicitWidth: __buttonHelper.implicitWidth
- implicitHeight: __buttonHelper.implicitHeight
-
- Canvas {
- id: backgroundCanvas
- anchors.fill: parent
-
- Connections {
- target: control
- onPressedChanged: backgroundCanvas.requestPaint()
- }
-
- onPaint: {
- var ctx = getContext("2d");
- __buttonHelper.paintBackground(ctx);
- }
- }
- }
-}
diff --git a/src/extras/Styles/Base/CircularGaugeStyle.qml b/src/extras/Styles/Base/CircularGaugeStyle.qml
deleted file mode 100644
index 2030f775..00000000
--- a/src/extras/Styles/Base/CircularGaugeStyle.qml
+++ /dev/null
@@ -1,498 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtGraphicalEffects 1.0
-import QtQuick.Controls 1.1
-import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
-import QtQuick.Extras.Private 1.0
-
-/*!
- \qmltype CircularGaugeStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.0
- \ingroup extrasstyles
- \brief Provides custom styling for CircularGauge.
-
- You can create a custom circular gauge by replacing the following delegates:
- \list
- \li \l background
- \li \l tickmark
- \li \l minorTickmark
- \li \l tickmarkLabel
- \li \l needle
- \li \l foreground
- \endlist
-
- Below is an example that changes the needle to a basic orange \l Rectangle:
- \code
- CircularGauge {
- style: CircularGaugeStyle {
- needle: Rectangle {
- y: outerRadius * 0.15
- implicitWidth: outerRadius * 0.03
- implicitHeight: outerRadius * 0.9
- antialiasing: true
- color: Qt.rgba(0.66, 0.3, 0, 1)
- }
- }
- }
- \endcode
-
- The result:
- \image circulargauge-needle-example-2.png CircularGaugeStyle example
-
- \section2 Direction
-
- \l minimumValueAngle and \l maximumValueAngle determine not only the
- position of the tickmarks, labels and needle, but the direction in which
- they are displayed around the gauge. For example, if \l minimumValueAngle
- is greater than \l maximumValueAngle, the gauge will be anti-clockwise.
- Below, there are two gauges: the top gauge has a \l minimumValueAngle of
- \c -90 degrees and a \l maximumValueAngle of \c 90 degrees, and the bottom
- gauge has the opposite.
-
- \image circulargauge-reversed.png Reversed CircularGauge
-
- \sa {Styling CircularGauge}
-*/
-
-Style {
- id: circularGaugeStyle
-
- /*!
- \since 1.3
-
- The \l CircularGauge that this style is attached to.
- */
- readonly property CircularGauge control: __control
-
- /*!
- The distance from the center of the gauge to the outer edge of the
- gauge.
-
- This property is useful for determining the size of the various
- components of the style, in order to ensure that they are scaled
- proportionately when the gauge is resized.
- */
- readonly property real outerRadius: Math.min(control.width, control.height) * 0.5
-
- /*!
- This property determines the angle at which the minimum value is
- displayed on the gauge.
-
- The angle set affects the following components of the gauge:
- \list
- \li The angle of the needle
- \li The position of the tickmarks and labels
- \endlist
-
- The angle origin points north:
-
- \image circulargauge-angles.png
-
- There is no minimum or maximum angle for this property, but the default
- style only supports angles whose absolute range is less than or equal
- to \c 360 degrees. This is because ranges higher than \c 360 degrees
- will cause the tickmarks and labels to overlap each other.
-
- The default value is \c -145.
- */
- property real minimumValueAngle: -145
-
- /*!
- This property determines the angle at which the maximum value is
- displayed on the gauge.
-
- The angle set affects the following components of the gauge:
- \list
- \li The angle of the needle
- \li The position of the tickmarks and labels
- \endlist
-
- The angle origin points north:
-
- \image circulargauge-angles.png
-
- There is no minimum or maximum angle for this property, but the default
- style only supports angles whose absolute range is less than or equal
- to \c 360 degrees. This is because ranges higher than \c 360 degrees
- will cause the tickmarks and labels to overlap each other.
-
- The default value is \c 145.
- */
- property real maximumValueAngle: 145
-
- /*!
- The range between \l minimumValueAngle and \l maximumValueAngle, in
- degrees. This value will always be positive.
- */
- readonly property real angleRange: control.__panel.circularTickmarkLabel.angleRange
-
- /*!
- This property holds the rotation of the needle in degrees.
- */
- property real needleRotation: {
- var percentage = (control.value - control.minimumValue) / (control.maximumValue - control.minimumValue);
- minimumValueAngle + percentage * angleRange;
- }
-
- /*!
- The interval at which tickmarks are displayed.
-
- For example, if this property is set to \c 10 (the default),
- control.minimumValue to \c 0, and control.maximumValue to \c 100,
- the tickmarks displayed will be 0, 10, 20, etc., to 100,
- around the gauge.
- */
- property real tickmarkStepSize: 10
-
- /*!
- The distance in pixels from the outside of the gauge (outerRadius) at
- which the outermost point of the tickmark line is drawn.
- */
- property real tickmarkInset: 0
-
-
- /*!
- The amount of tickmarks displayed by the gauge, calculated from
- \l tickmarkStepSize and the control's
- \l {CircularGauge::minimumValue}{minimumValue} and
- \l {CircularGauge::maximumValue}{maximumValue}.
-
- \sa minorTickmarkCount
- */
- readonly property int tickmarkCount: control.__panel.circularTickmarkLabel.tickmarkCount
-
- /*!
- The amount of minor tickmarks between each tickmark.
-
- The default value is \c 4.
-
- \sa tickmarkCount
- */
- property int minorTickmarkCount: 4
-
- /*!
- The distance in pixels from the outside of the gauge (outerRadius) at
- which the outermost point of the minor tickmark line is drawn.
- */
- property real minorTickmarkInset: 0
-
- /*!
- The distance in pixels from the outside of the gauge (outerRadius) at
- which the center of the value marker text is drawn.
- */
- property real labelInset: __protectedScope.toPixels(0.19)
-
- /*!
- The interval at which tickmark labels are displayed.
-
- For example, if this property is set to \c 10 (the default),
- control.minimumValue to \c 0, and control.maximumValue to \c 100, the
- tickmark labels displayed will be 0, 10, 20, etc., to 100,
- around the gauge.
- */
- property real labelStepSize: tickmarkStepSize
-
- /*!
- The amount of tickmark labels displayed by the gauge, calculated from
- \l labelStepSize and the control's
- \l {CircularGauge::minimumValue}{minimumValue} and
- \l {CircularGauge::maximumValue}{maximumValue}.
-
- \sa tickmarkCount, minorTickmarkCount
- */
- readonly property int labelCount: control.__panel.circularTickmarkLabel.labelCount
-
- /*!
- \since QtQuick.Extras 1.2
-
- Returns \a value as an angle in degrees.
-
- This function is useful for custom drawing or positioning of items in
- the style's components. For example, it can be used to calculate the
- angles at which to draw an arc around the gauge indicating the safe
- area for the needle to be within.
-
- For example, if minimumValueAngle is set to \c 270 and
- maximumValueAngle is set to \c 90, this function will return \c 270
- when passed minimumValue and \c 90 when passed maximumValue.
-
- \sa {Styling CircularGauge#styling-circulargauge-background}{
- Styling CircularGauge's background}
- */
- function valueToAngle(value) {
- return control.__panel.circularTickmarkLabel.valueToAngle(value);
- }
-
- property QtObject __protectedScope: QtObject {
- /*!
- Converts a value expressed as a percentage of \l outerRadius to
- a pixel value.
- */
- function toPixels(percentageOfOuterRadius) {
- return percentageOfOuterRadius * outerRadius;
- }
- }
-
- /*!
- The background of the gauge.
-
- If set, the background determines the implicit size of the gauge.
-
- By default, there is no background defined.
-
- \sa {Styling CircularGauge#styling-circulargauge-background}{
- Styling CircularGauge's background}
- */
- property Component background
-
- /*!
- This component defines each individual tickmark. The position of each
- tickmark is already set; only the
- \l {Item::implicitWidth}{implicitWidth} and
- \l {Item::implicitHeight}{implicitHeight} need to be specified.
-
- Each instance of this component has access to the following properties:
-
- \table
- \row \li \c {readonly property int} \b styleData.index
- \li The index of this tickmark.
- \row \li \c {readonly property real} \b styleData.value
- \li The value that this tickmark represents.
- \endtable
-
- To illustrate what these properties refer to, we can use the following
- example:
-
- \snippet circulargauge-tickmark-indices-values.qml tickmarks
-
- We've replaced the conventional \e line tickmarks with \l Text items
- and have hidden the tickmarkLabel component in order to make the
- association clearer:
-
- \image circulargauge-tickmark-indices-values.png Tickmarks
-
- The index property can be useful if you have another model that
- contains images to display for each index, for example.
-
- The value property is useful for drawing lower and upper limits around
- the gauge to indicate the recommended value ranges. For example, speeds
- above 200 kilometers an hour in a car's speedometer could be indicated
- as dangerous using this property.
-
- \sa {Styling CircularGauge#styling-circulargauge-tickmark}{
- Styling CircularGauge's tickmark}
- */
- property Component tickmark: Rectangle {
- implicitWidth: outerRadius * 0.02
- antialiasing: true
- implicitHeight: outerRadius * 0.06
- color: "#c8c8c8"
- }
-
- /*!
- This component defines each individual minor tickmark. The position of
- each minor tickmark is already set; only the
- \l {Item::implicitWidth}{implicitWidth} and
- \l {Item::implicitHeight}{implicitHeight} need to be specified.
-
- Each instance of this component has access to the following properties:
-
- \table
- \row \li \c {readonly property int} \b styleData.index
- \li The index of this tickmark.
- \row \li \c {readonly property real} \b styleData.value
- \li The value that this tickmark represents.
- \endtable
-
- \sa {Styling CircularGauge#styling-circulargauge-minorTickmark}{
- Styling CircularGauge's minorTickmark}
- */
- property Component minorTickmark: Rectangle {
- implicitWidth: outerRadius * 0.01
- antialiasing: true
- implicitHeight: outerRadius * 0.03
- color: "#c8c8c8"
- }
-
- /*!
- This defines the text of each tickmark label on the gauge.
-
- Each instance of this component has access to the following properties:
-
- \table
- \row \li \c {readonly property int} \b styleData.index
- \li The index of this label.
- \row \li \c {readonly property real} \b styleData.value
- \li The value that this label represents.
- \endtable
-
- \sa {Styling CircularGauge#styling-circulargauge-tickmarkLabel}{
- Styling CircularGauge's tickmarkLabel}
- */
- property Component tickmarkLabel: Text {
- font.pixelSize: Math.max(6, __protectedScope.toPixels(0.12))
- text: styleData.value
- color: "#c8c8c8"
- antialiasing: true
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
-
- /*!
- The needle that points to the gauge's current value.
-
- This component is drawn below the \l foreground component.
-
- The style expects the needle to be pointing up at a rotation of \c 0,
- in order for the rotation to be correct. For example:
-
- \image circulargauge-needle.png CircularGauge's needle
-
- When defining your own needle component, the only properties that the
- style requires you to set are the
- \l {Item::implicitWidth}{implicitWidth} and
- \l {Item::implicitHeight}{implicitHeight}.
-
- Optionally, you can set \l {Item::x}{x} and \l {Item::y}{y} to change
- the needle's transform origin. Setting the \c x position can be useful
- for needle images where the needle is not centered exactly
- horizontally. Setting the \c y position allows you to make the base of
- the needle hang over the center of the gauge.
-
- \sa {Styling CircularGauge#styling-circulargauge-needle}{
- Styling CircularGauge's needle}
- */
- property Component needle: Item {
- implicitWidth: __protectedScope.toPixels(0.08)
- implicitHeight: 0.9 * outerRadius
-
- Image {
- anchors.fill: parent
- source: "images/needle.png"
- }
- }
-
- /*!
- The foreground of the gauge. This component is drawn above all others.
-
- Like \l background, the foreground component fills the entire gauge.
-
- By default, the knob of the gauge is defined here.
-
- \sa {Styling CircularGauge#styling-circulargauge-foreground}{
- Styling CircularGauge's foreground}
- */
- property Component foreground: Item {
- Image {
- source: "images/knob.png"
- anchors.centerIn: parent
- scale: {
- var idealHeight = __protectedScope.toPixels(0.2);
- var originalImageHeight = sourceSize.height;
- idealHeight / originalImageHeight;
- }
- }
- }
-
- /*! \internal */
- property Component panel: Item {
- id: panelItem
- implicitWidth: backgroundLoader.item ? backgroundLoader.implicitWidth : TextSingleton.implicitHeight * 16
- implicitHeight: backgroundLoader.item ? backgroundLoader.implicitHeight : TextSingleton.implicitHeight * 16
-
- property alias background: backgroundLoader.item
- property alias circularTickmarkLabel: circularTickmarkLabel_
-
- Loader {
- id: backgroundLoader
- sourceComponent: circularGaugeStyle.background
- width: outerRadius * 2
- height: outerRadius * 2
- anchors.centerIn: parent
- }
-
- CircularTickmarkLabel {
- id: circularTickmarkLabel_
- anchors.fill: backgroundLoader
-
- minimumValue: control.minimumValue
- maximumValue: control.maximumValue
- stepSize: control.stepSize
- tickmarksVisible: control.tickmarksVisible
- minimumValueAngle: circularGaugeStyle.minimumValueAngle
- maximumValueAngle: circularGaugeStyle.maximumValueAngle
- tickmarkStepSize: circularGaugeStyle.tickmarkStepSize
- tickmarkInset: circularGaugeStyle.tickmarkInset
- minorTickmarkCount: circularGaugeStyle.minorTickmarkCount
- minorTickmarkInset: circularGaugeStyle.minorTickmarkInset
- labelInset: circularGaugeStyle.labelInset
- labelStepSize: circularGaugeStyle.labelStepSize
-
- style: CircularTickmarkLabelStyle {
- tickmark: circularGaugeStyle.tickmark
- minorTickmark: circularGaugeStyle.minorTickmark
- tickmarkLabel: circularGaugeStyle.tickmarkLabel
- }
- }
-
- Loader {
- id: needleLoader
- sourceComponent: circularGaugeStyle.needle
- transform: [
- Rotation {
- angle: needleRotation
- origin.x: needleLoader.width / 2
- origin.y: needleLoader.height
- },
- Translate {
- x: panelItem.width / 2 - needleLoader.width / 2
- y: panelItem.height / 2 - needleLoader.height
- }
- ]
- }
-
- Loader {
- id: foreground
- sourceComponent: circularGaugeStyle.foreground
- anchors.fill: backgroundLoader
- }
- }
-}
diff --git a/src/extras/Styles/Base/CircularTickmarkLabelStyle.qml b/src/extras/Styles/Base/CircularTickmarkLabelStyle.qml
deleted file mode 100644
index 010e9245..00000000
--- a/src/extras/Styles/Base/CircularTickmarkLabelStyle.qml
+++ /dev/null
@@ -1,304 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtQuick.Controls.Private 1.0
-import QtQuick.Extras.Private 1.0
-import QtQuick.Extras.Private.CppUtils 1.0
-
-Style {
- id: circularTickmarkLabelStyle
-
- /*!
- The distance from the center of the control to the outer edge.
- */
- readonly property real outerRadius: Math.min(control.width, control.height) * 0.5
-
- property QtObject __protectedScope: QtObject {
- /*!
- Converts a value expressed as a percentage of \l outerRadius to
- a pixel value.
- */
- function toPixels(percentageOfOuterRadius) {
- return percentageOfOuterRadius * outerRadius;
- }
- }
-
- /*!
- This component defines each individual tickmark. The position of each
- tickmark is already set; only the size needs to be specified.
- */
- property Component tickmark: Rectangle {
- width: outerRadius * 0.02
- antialiasing: true
- height: outerRadius * 0.06
- color: "#c8c8c8"
- }
-
- /*!
- This component defines each individual minor tickmark. The position of
- each minor tickmark is already set; only the size needs to be specified.
- */
- property Component minorTickmark: Rectangle {
- width: outerRadius * 0.01
- antialiasing: true
- height: outerRadius * 0.03
- color: "#c8c8c8"
- }
-
- /*!
- This defines the text of each tickmark label on the gauge.
- */
- property Component tickmarkLabel: Text {
- font.pixelSize: Math.max(6, __protectedScope.toPixels(0.12))
- text: styleData.value
- color: "#c8c8c8"
- antialiasing: true
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- }
-
- /*! \internal */
- property Component panel: Item {
- id: panelItem
- implicitWidth: 250
- implicitHeight: 250
-
- function rangeUsed(count, stepSize) {
- return (((count - 1) * stepSize) / (control.maximumValue - control.minimumValue)) * control.angleRange;
- }
-
- readonly property real tickmarkSectionSize: rangeUsed(control.tickmarkCount, control.tickmarkStepSize) / (control.tickmarkCount - 1)
- readonly property real tickmarkSectionValue: (control.maximumValue - control.minimumValue) / (control.tickmarkCount - 1)
- readonly property real minorTickmarkSectionSize: tickmarkSectionSize / (control.minorTickmarkCount + 1)
- readonly property real minorTickmarkSectionValue: tickmarkSectionValue / (control.minorTickmarkCount + 1)
- readonly property int totalMinorTickmarkCount: {
- // The size of each section within two major tickmarks, expressed as a percentage.
- var minorSectionPercentage = 1 / (control.minorTickmarkCount + 1);
- // The amount of major tickmarks not able to be displayed; will be 0 if they all fit.
- var tickmarksNotDisplayed = control.__tickmarkCount - control.tickmarkCount;
- var count = control.minorTickmarkCount * (control.tickmarkCount - 1);
- // We'll try to display as many minor tickmarks as we can to fill up the space.
- count + tickmarksNotDisplayed / minorSectionPercentage;
- }
- readonly property real labelSectionSize: rangeUsed(control.labelCount, control.labelStepSize) / (control.labelCount - 1)
-
- function toPixels(percentageOfOuterRadius) {
- return percentageOfOuterRadius * outerRadius;
- }
-
- /*!
- Returns the angle of \a marker (in the range 0 ... n - 1, where n
- is the amount of markers) on the gauge where sections are of size
- tickmarkSectionSize.
- */
- function tickmarkAngleFromIndex(tickmarkIndex) {
- return tickmarkIndex * tickmarkSectionSize + control.minimumValueAngle;
- }
-
- function labelAngleFromIndex(labelIndex) {
- return labelIndex * labelSectionSize + control.minimumValueAngle;
- }
-
- function labelPosFromIndex(index, labelWidth, labelHeight) {
- return MathUtils.centerAlongCircle(outerRadius, outerRadius, labelWidth, labelHeight,
- MathUtils.degToRadOffset(labelAngleFromIndex(index)),
- outerRadius - control.labelInset)
- }
-
- function minorTickmarkAngleFromIndex(minorTickmarkIndex) {
- var baseAngle = tickmarkAngleFromIndex(Math.floor(minorTickmarkIndex / control.minorTickmarkCount));
- // + minorTickmarkSectionSize because we don't want the first minor tickmark to start on top of its "parent" tickmark.
- var relativeMinorAngle = (minorTickmarkIndex % control.minorTickmarkCount * minorTickmarkSectionSize) + minorTickmarkSectionSize;
- return baseAngle + relativeMinorAngle;
- }
-
- function tickmarkValueFromIndex(majorIndex) {
- return (majorIndex * tickmarkSectionValue) + control.minimumValue;
- }
-
- function tickmarkValueFromMinorIndex(minorIndex) {
- var majorIndex = Math.floor(minorIndex / control.minorTickmarkCount);
- var relativeMinorIndex = minorIndex % control.minorTickmarkCount;
- return tickmarkValueFromIndex(majorIndex) + ((relativeMinorIndex * minorTickmarkSectionValue) + minorTickmarkSectionValue);
- }
-
- Loader {
- active: control.tickmarksVisible && tickmark != null
- width: outerRadius * 2
- height: outerRadius * 2
- anchors.centerIn: parent
-
- sourceComponent: Repeater {
- id: tickmarkRepeater
- model: control.tickmarkCount
- delegate: Loader {
- id: tickmarkLoader
- objectName: "tickmark" + styleData.index
- x: tickmarkRepeater.width / 2
- y: tickmarkRepeater.height / 2
-
- transform: [
- Translate {
- y: -outerRadius + control.tickmarkInset
- },
- Rotation {
- angle: panelItem.tickmarkAngleFromIndex(styleData.index) - __tickmarkWidthAsAngle / 2
- }
- ]
-
- sourceComponent: tickmark
-
- property int __index: index
- property QtObject styleData: QtObject {
- readonly property alias index: tickmarkLoader.__index
- readonly property real value: tickmarkValueFromIndex(index)
- }
-
- readonly property real __tickmarkWidthAsAngle: MathUtils.radToDeg((width / (MathUtils.pi2 * outerRadius)) * MathUtils.pi2)
- }
- }
- }
- Loader {
- active: control.tickmarksVisible && minorTickmark != null
- width: outerRadius * 2
- height: outerRadius * 2
- anchors.centerIn: parent
-
- sourceComponent: Repeater {
- id: minorRepeater
- anchors.fill: parent
- model: totalMinorTickmarkCount
- delegate: Loader {
- id: minorTickmarkLoader
- objectName: "minorTickmark" + styleData.index
- x: minorRepeater.width / 2
- y: minorRepeater.height / 2
- transform: [
- Translate {
- y: -outerRadius + control.minorTickmarkInset
- },
- Rotation {
- angle: panelItem.minorTickmarkAngleFromIndex(styleData.index) - __minorTickmarkWidthAsAngle / 2
- }
- ]
-
- sourceComponent: minorTickmark
-
- property int __index: index
- property QtObject styleData: QtObject {
- readonly property alias index: minorTickmarkLoader.__index
- readonly property real value: tickmarkValueFromMinorIndex(index)
- }
-
- readonly property real __minorTickmarkWidthAsAngle: MathUtils.radToDeg((width / (MathUtils.pi2 * outerRadius)) * MathUtils.pi2)
- }
- }
- }
- Loader {
- id: labelLoader
- active: control.tickmarksVisible && tickmarkLabel != null
- width: outerRadius * 2
- height: outerRadius * 2
- anchors.centerIn: parent
-
- sourceComponent: Item {
- id: labelItem
- width: outerRadius * 2
- height: outerRadius * 2
- anchors.centerIn: parent
-
- Connections {
- target: control
- onMinimumValueChanged: valueTextModel.update()
- onMaximumValueChanged: valueTextModel.update()
- onTickmarkStepSizeChanged: valueTextModel.update()
- onLabelStepSizeChanged: valueTextModel.update()
- }
-
- Repeater {
- id: labelItemRepeater
-
- Component.onCompleted: valueTextModel.update();
-
- model: ListModel {
- id: valueTextModel
-
- function update() {
- if (control.labelStepSize === 0) {
- return;
- }
-
- // Make bigger if it's too small and vice versa.
- // +1 because we want to show 11 values, with, for example: 0, 10, 20... 100.
- var difference = control.labelCount - count;
- if (difference > 0) {
- for (; difference > 0; --difference) {
- append({ value: 0 });
- }
- } else if (difference < 0) {
- for (; difference < 0; ++difference) {
- remove(count - 1);
- }
- }
-
- var index = 0;
- for (var value = control.minimumValue;
- value <= control.maximumValue && index < count;
- value += control.labelStepSize, ++index) {
- setProperty(index, "value", value);
- }
- }
- }
- delegate: Loader {
- id: tickmarkLabelDelegateLoader
- sourceComponent: tickmarkLabel
- x: pos.x
- y: pos.y
-
- readonly property point pos: panelItem.labelPosFromIndex(index, width, height);
-
- readonly property int __index: index
- property QtObject styleData: QtObject {
- readonly property var value: index != -1 ? labelItemRepeater.model.get(index).value : 0
- readonly property alias index: tickmarkLabelDelegateLoader.__index
- }
- }
- }
- }
- }
- }
-}
diff --git a/src/extras/Styles/Base/CommonStyleHelper.qml b/src/extras/Styles/Base/CommonStyleHelper.qml
deleted file mode 100644
index 4263a743..00000000
--- a/src/extras/Styles/Base/CommonStyleHelper.qml
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-
-QtObject {
- property Item control
-
- property color buttonColorUpTop: "#e3e3e3"
- property color buttonColorUpBottom: "#b3b3b3"
- property color buttonColorDownTop: "#d3d3d3"
- property color buttonColorDownBottom: "#939393"
- property color textColorUp: "#4e4e4e"
- property color textColorDown: "#303030"
- property color textRaisedColorUp: "#ffffff"
- property color textRaisedColorDown: "#e3e3e3"
- property color offColor: "#ff0000"
- property color offColorShine: "#ff6666"
- property color onColor: "#00cc00"
- property color onColorShine: "#66ff66"
- property color inactiveColor: "#1f1f1f"
- property color inactiveColorShine: "#666666"
-}
diff --git a/src/extras/Styles/Base/DelayButtonStyle.qml b/src/extras/Styles/Base/DelayButtonStyle.qml
deleted file mode 100644
index e416550b..00000000
--- a/src/extras/Styles/Base/DelayButtonStyle.qml
+++ /dev/null
@@ -1,233 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtGraphicalEffects 1.0
-import QtQuick.Controls.Styles 1.1
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
-import QtQuick.Extras.Private.CppUtils 1.1
-
-/*!
- \qmltype DelayButtonStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.0
- \ingroup extrasstyles
- \brief Provides custom styling for DelayButton.
-
- You can create a custom DelayButton by replacing the following delegates:
- \list
- \li \l foreground
- \li \l {QtQuick.Controls.Styles::ButtonStyle::label}{label}
- \endlist
-*/
-
-CircularButtonStyle {
- id: delayButtonStyle
-
- /*!
- \since 1.3
-
- The \l DelayButton that this style is attached to.
- */
- readonly property DelayButton control: __control
-
- /*!
- The gradient of the progress bar around the button.
- */
- property Gradient progressBarGradient: Gradient {
- GradientStop {
- position: 0
- color: "#ff6666"
- }
- GradientStop {
- position: 1
- color: "#ff0000"
- }
- }
-
- /*!
- The color of the drop shadow under the progress bar.
- */
- property color progressBarDropShadowColor: "#ff6666"
-
- background: Item {
- implicitWidth: __buttonHelper.implicitWidth
- implicitHeight: __buttonHelper.implicitHeight
-
- Canvas {
- id: backgroundCanvas
- anchors.fill: parent
-
- Connections {
- target: control
- onPressedChanged: backgroundCanvas.requestPaint()
- onCheckedChanged: backgroundCanvas.requestPaint()
- }
-
- onPaint: {
- var ctx = getContext("2d");
- __buttonHelper.paintBackground(ctx);
- }
- }
- }
-
- /*!
- The foreground of the button.
-
- The progress bar is drawn here.
- */
- property Component foreground: Item {
- id: foregroundItem
-
- state: "normal"
- states: [
- State {
- name: "normal"
-
- PropertyChanges {
- target: foregroundItem
- opacity: 1
- }
- },
- State {
- name: "activated"
- }
- ]
-
- transitions: [
- Transition {
- from: "normal"
- to: "activated"
- SequentialAnimation {
- loops: Animation.Infinite
-
- NumberAnimation {
- target: foregroundItem
- property: "opacity"
- from: 0.8
- to: 0
- duration: 500
- easing.type: Easing.InOutSine
- }
- NumberAnimation {
- target: foregroundItem
- property: "opacity"
- from: 0
- to: 0.8
- duration: 500
- easing.type: Easing.InOutSine
- }
- }
- }
- ]
-
- Connections {
- target: control
- onActivated: state = "activated"
- onCheckedChanged: if (!control.checked) state = "normal"
- }
-
- CircularProgressBar {
- id: progressBar
- visible: false
- width: Math.min(parent.width, parent.height) + progressBarDropShadow.radius * 3 * 2
- height: width
- anchors.centerIn: parent
- antialiasing: true
- barWidth: __buttonHelper.outerArcLineWidth
- inset: progressBarDropShadow.radius * 3
- minimumValueAngle: -180
- maximumValueAngle: 180
-
- progress: control.progress
-
- // TODO: Add gradient property if/when we drop support for building with 5.1.
- function updateGradient() {
- clearStops();
- for (var i = 0; i < progressBarGradient.stops.length; ++i) {
- addStop(progressBarGradient.stops[i].position, progressBarGradient.stops[i].color);
- }
- }
-
- Component.onCompleted: updateGradient()
-
- Connections {
- target: delayButtonStyle
- onProgressBarGradientChanged: progressBar.updateGradient()
- }
- }
-
- DropShadow {
- id: progressBarDropShadow
- anchors.fill: progressBar
- fast: true
- // QTBUG-33747
-// cached: !control.pressed
- radius: 4
- samples: radius * 2
- color: progressBarDropShadowColor
- source: progressBar
- }
- }
-
- panel: Item {
- implicitWidth: backgroundLoader.implicitWidth
- implicitHeight: backgroundLoader.implicitHeight
-
- Loader {
- id: backgroundLoader
- anchors.fill: parent
- sourceComponent: background
- }
-
- Loader {
- id: foregroundLoader
- anchors.fill: parent
- sourceComponent: foreground
- }
-
- Loader {
- id: labelLoader
- sourceComponent: label
- anchors.fill: parent
- anchors.leftMargin: padding.left
- anchors.topMargin: padding.top
- anchors.rightMargin: padding.right
- anchors.bottomMargin: padding.bottom
- }
- }
-}
diff --git a/src/extras/Styles/Base/DialStyle.qml b/src/extras/Styles/Base/DialStyle.qml
deleted file mode 100644
index 3523f500..00000000
--- a/src/extras/Styles/Base/DialStyle.qml
+++ /dev/null
@@ -1,392 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtQuick.Controls 1.2
-import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
-import QtQuick.Extras.Private 1.0
-import QtQuick.Extras.Private.CppUtils 1.0
-
-/*!
- \qmltype DialStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.0
- \ingroup extrasstyles
- \brief Provides custom styling for Dial.
-
- You can create a custom dial by replacing the following delegates:
- \list
- \li \l background
- \endlist
-*/
-
-Style {
- id: dialStyle
-
- /*!
- \since 1.3
-
- The \l Dial that this style is attached to.
- */
- readonly property Dial control: __control
-
- /*!
- \since QtQuick.Extras 1.1
-
- The distance from the center of the dial to the outer edge of the dial.
-
- This property is useful for determining the size of the various
- components of the style, in order to ensure that they are scaled
- proportionately when the dial is resized.
- */
- readonly property real outerRadius: Math.min(control.height, control.width) / 2
-
- /*!
- \since 1.2
-
- The distance in pixels from the outside of the dial (outerRadius)
- to the center of the handle.
- */
- property real handleInset: (__tickmarkRadius * 4) + ((__handleRadius * 2) * 0.55)
-
- /*!
- \since QtQuick.Extras 1.1
-
- The interval at which tickmarks are displayed.
-
- For example, if this property is set to \c 10,
- control.minimumValue to \c 0, and control.maximumValue to \c 100,
- the tickmarks displayed will be 0, 10, 20, etc., to 100, along
- the circumference of the dial.
- */
- property real tickmarkStepSize: 1
-
- /*!
- \since QtQuick.Extras 1.1
-
- The distance in pixels from the outside of the dial (outerRadius) at
- which the outermost point of the tickmark line is drawn.
- */
- property real tickmarkInset: 0
-
-
- /*!
- \since QtQuick.Extras 1.1
-
- The amount of tickmarks displayed by the dial, calculated from
- \l tickmarkStepSize and the control's
- \l {Dial::minimumValue}{minimumValue} and
- \l {Dial::maximumValue}{maximumValue}.
-
- \sa minorTickmarkCount
- */
- readonly property int tickmarkCount: control.__panel.circularTickmarkLabel.tickmarkCount
-
- /*!
- \since QtQuick.Extras 1.1
-
- The amount of minor tickmarks between each tickmark.
-
- \sa tickmarkCount
- */
- property int minorTickmarkCount: 0
-
- /*!
- \since QtQuick.Extras 1.1
-
- The distance in pixels from the outside of the dial (outerRadius) at
- which the outermost point of the minor tickmark line is drawn.
- */
- property real minorTickmarkInset: 0
-
- /*!
- \since QtQuick.Extras 1.1
-
- The distance in pixels from the outside of the dial (outerRadius) at
- which the center of the value marker text is drawn.
- */
- property real labelInset: 0
-
- /*!
- \since QtQuick.Extras 1.1
-
- The interval at which tickmark labels are displayed.
-
- For example, if this property is set to \c 10 (the default),
- control.minimumValue to \c 0, and control.maximumValue to \c 100, the
- tickmark labels displayed will be 0, 10, 20, etc., to 100,
- along the circumference of the dial.
- */
- property real labelStepSize: tickmarkStepSize
-
- /*!
- \since QtQuick.Extras 1.1
-
- The amount of tickmark labels displayed by the dial, calculated from
- \l labelStepSize and the control's
- \l {Dial::minimumValue}{minimumValue} and
- \l {Dial::maximumValue}{maximumValue}.
-
- \sa tickmarkCount, minorTickmarkCount
- */
- readonly property int labelCount: control.__panel.circularTickmarkLabel.labelCount
-
- /*!
- \since QtQuick.Extras 1.2
-
- Returns \a value as an angle in degrees.
-
- This function is useful for custom drawing or positioning of items in
- the style's components. For example, it can be used to calculate the
- angles at which to draw an arc around the dial indicating the safe
- range of values.
-
- For example, if minimumValueAngle is set to \c 270 and
- maximumValueAngle is set to \c 90, this function will return \c 270
- when passed minimumValue and \c 90 when passed maximumValue.
- */
- function valueToAngle(value) {
- return control.__panel.circularTickmarkLabel.valueToAngle(value);
- }
-
- /*! \internal */
- readonly property real __tickmarkRadius: outerRadius * 0.06
-
- /*! \internal */
- readonly property real __handleRadius: outerRadius * 0.15
-
- /*!
- \internal
-
- This property determines whether it is possible to change the value of
- the dial simply by pressing/tapping.
-
- If \c false, the user must drag to rotate the dial and hence change the
- value.
-
- This property is useful for touch devices, where it is easy to
- accidentally tap while flicking, for example.
- */
- property bool __dragToSet: Settings.hasTouchScreen && Settings.isMobile
-
- /*!
- The background of the dial.
-
- The implicit size of the dial is taken from this component.
- */
- property Component background: Item {
- id: backgroundItem
- implicitWidth: backgroundHelper.implicitWidth
- implicitHeight: backgroundHelper.implicitHeight
-
- CircularButtonStyleHelper {
- id: backgroundHelper
- control: dialStyle.control
- property color zeroMarkerColor: "#a8a8a8"
- property color zeroMarkerColorTransparent: "transparent"
- property real zeroMarkerLength: outerArcLineWidth * 1.25
- property real zeroMarkerWidth: outerArcLineWidth * 0.3
-
- smallestAxis: Math.min(backgroundItem.width, backgroundItem.height) - __tickmarkRadius * 4
- }
-
- Canvas {
- id: backgroundCanvas
- anchors.fill: parent
-
- readonly property real xCenter: width / 2
- readonly property real yCenter: height / 2
-
- onPaint: {
- var ctx = getContext("2d");
- backgroundHelper.paintBackground(ctx);
- }
- }
- }
-
- /*!
- \since 1.2
-
- The handle of the dial.
-
- The handle is automatically positioned within the dial, based on the
- \l handleInset and the implicit width and height of the handle itself.
- */
- property Component handle: Canvas {
- implicitWidth: __handleRadius * 2
- implicitHeight: __handleRadius * 2
-
- HandleStyleHelper {
- id: handleHelper
- }
-
- onPaint: {
- var ctx = getContext("2d");
- handleHelper.paintHandle(ctx, 1, 1, width - 2, height - 2);
- }
- }
-
- /*!
- \since QtQuick.Extras 1.1
-
- This component defines each individual tickmark. The position of each
- tickmark is already set; only the
- \l {Item::implicitWidth}{implicitWidth} and
- \l {Item::implicitHeight}{implicitHeight} need to be specified.
-
- Each instance of this component has access to the following properties:
-
- \table
- \row \li \c {readonly property int} \b styleData.index
- \li The index of this tickmark.
- \row \li \c {readonly property real} \b styleData.value
- \li The value that this tickmark represents.
- \endtable
- */
- property Component tickmark: Rectangle {
- implicitWidth: outerRadius * 0.015 + (styleData.index === 0 || styleData.index === tickmarkCount ? 1 : (styleData.index) / tickmarkCount) * __tickmarkRadius * 0.75
- implicitHeight: implicitWidth
- radius: height / 2
- color: styleData.index === 0 ? "transparent" : Qt.rgba(0, 0, 0, 0.266)
- antialiasing: true
- border.width: styleData.index === 0 ? Math.max(1, outerRadius * 0.0075) : 0
- border.color: Qt.rgba(0, 0, 0, 0.266)
- }
-
- /*!
- \since QtQuick.Extras 1.1
-
- This component defines each individual minor tickmark. The position of each
- minor tickmark is already set; only the
- \l {Item::implicitWidth}{implicitWidth} and
- \l {Item::implicitHeight}{implicitHeight} need to be specified.
-
- Each instance of this component has access to the following properties:
-
- \table
- \row \li \c {readonly property int} \b styleData.index
- \li The index of this tickmark.
- \row \li \c {readonly property real} \b styleData.value
- \li The value that this tickmark represents.
- \endtable
-
- By default, no minor tickmark is defined.
- */
- property Component minorTickmark
-
- /*!
- \since QtQuick.Extras 1.1
-
- This defines the text of each tickmark label on the dial.
-
- Each instance of this component has access to the following properties:
-
- \table
- \row \li \c {readonly property int} \b styleData.index
- \li The index of this label.
- \row \li \c {readonly property real} \b styleData.value
- \li The value that this label represents.
- \endtable
-
- By default, no label is defined.
- */
- property Component tickmarkLabel
-
- /*! \internal */
- property Component panel: Item {
- implicitWidth: backgroundLoader.implicitWidth
- implicitHeight: backgroundLoader.implicitHeight
-
- property alias background: backgroundLoader.item
- property alias circularTickmarkLabel: circularTickmarkLabel_
-
- Loader {
- id: backgroundLoader
- sourceComponent: dialStyle.background
- width: outerRadius * 2
- height: width
- anchors.centerIn: parent
- }
-
- Loader {
- id: handleLoader
- sourceComponent: dialStyle.handle
- x: backgroundLoader.x + __pos.x - width / 2
- y: backgroundLoader.y + __pos.y - height / 2
-
- readonly property point __pos: {
- var radians = 0;
- if (control.__wrap) {
- radians = (control.value - control.minimumValue) /
- (control.maximumValue - control.minimumValue) *
- (MathUtils.pi2) + backgroundHelper.zeroAngle;
- } else {
- radians = -(Math.PI * 8 - (control.value - control.minimumValue) * 10 *
- Math.PI / (control.maximumValue - control.minimumValue)) / 6;
- }
-
- return MathUtils.centerAlongCircle(backgroundLoader.width / 2, backgroundLoader.height / 2,
- 0, 0, radians, outerRadius - handleInset)
- }
- }
-
- CircularTickmarkLabel {
- id: circularTickmarkLabel_
- anchors.fill: backgroundLoader
-
- minimumValue: control.minimumValue
- maximumValue: control.maximumValue
- stepSize: control.stepSize
- tickmarksVisible: control.tickmarksVisible
- minimumValueAngle: -150
- maximumValueAngle: 150
- tickmarkStepSize: dialStyle.tickmarkStepSize
- tickmarkInset: dialStyle.tickmarkInset
- minorTickmarkCount: dialStyle.minorTickmarkCount
- minorTickmarkInset: dialStyle.minorTickmarkInset
- labelInset: dialStyle.labelInset
- labelStepSize: dialStyle.labelStepSize
-
- style: CircularTickmarkLabelStyle {
- tickmark: dialStyle.tickmark
- minorTickmark: dialStyle.minorTickmark
- tickmarkLabel: dialStyle.tickmarkLabel
- }
- }
- }
-}
diff --git a/src/extras/Styles/Base/GaugeStyle.qml b/src/extras/Styles/Base/GaugeStyle.qml
deleted file mode 100644
index 49ea6f29..00000000
--- a/src/extras/Styles/Base/GaugeStyle.qml
+++ /dev/null
@@ -1,545 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtQuick.Controls 1.1
-import QtQuick.Controls.Styles 1.1
-import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Private 1.0
-
-/*!
- \qmltype GaugeStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.0
- \ingroup extrasstyles
- \brief Provides custom styling for Gauge.
-
- You can create a custom gauge by replacing the following delegates:
- \list
- \li \l background
- \li valueBar
- \li tickmarkLabel
- \endlist
-
- Below, you'll find an example of how to create a temperature gauge that
- changes color as its value increases:
-
- \code
- import QtQuick 2.2
- import QtQuick.Controls 1.1
- import QtQuick.Extras 1.3
- import QtQuick.Extras.Styles 1.3
-
- Rectangle {
- width: 80
- height: 200
-
- Timer {
- running: true
- repeat: true
- interval: 2000
- onTriggered: gauge.value = gauge.value == gauge.maximumValue ? 5 : gauge.maximumValue
- }
-
- Gauge {
- id: gauge
- anchors.fill: parent
- anchors.margins: 10
-
- value: 5
- Behavior on value {
- NumberAnimation {
- duration: 1000
- }
- }
-
- style: GaugeStyle {
- valueBar: Rectangle {
- implicitWidth: 16
- color: Qt.rgba(gauge.value / gauge.maximumValue, 0, 1 - gauge.value / gauge.maximumValue, 1)
- }
- }
- }
- }
- \endcode
-
- \image gauge-temperature.png
- The gauge displaying values at various points during the animation.
-
- \sa {Styling Gauge}
-*/
-
-Style {
- id: gaugeStyle
-
- /*!
- \since 1.3
-
- The \l Gauge that this style is attached to.
- */
- readonly property Gauge control: __control
-
- /*!
- \since QtQuick.Extras.Styles 1.3
-
- This property holds the value displayed by the gauge as a position in
- pixels.
-
- It is useful for custom styling.
- */
- readonly property real valuePosition: control.__panel.valuePosition
-
- /*!
- The background of the gauge, displayed behind the \l valueBar.
-
- By default, no background is defined.
- */
- property Component background
-
- /*!
- Each tickmark displayed by the gauge.
-
- To set the size of the tickmarks, specify an
- \l {Item::implicitWidth}{implicitWidth} and
- \l {Item::implicitHeight}{implicitHeight}.
-
- The widest tickmark will determine the space set aside for all
- tickmarks. For this reason, the \c implicitWidth of each tickmark
- should be greater than or equal to that of each minor tickmark. If you
- need minor tickmarks to have greater widths than the major tickmarks,
- set the larger width in a child item of the \l minorTickmark component.
-
- For layouting reasons, each tickmark should have the same
- \c implicitHeight. If different heights are needed for individual
- tickmarks, specify those heights in a child item of the component.
-
- In the example below, we decrease the height of the tickmarks:
-
- \code
- tickmark: Item {
- implicitWidth: 18
- implicitHeight: 1
-
- Rectangle {
- color: "#c8c8c8"
- anchors.fill: parent
- anchors.leftMargin: 3
- anchors.rightMargin: 3
- }
- }
- \endcode
-
- \image gauge-tickmark-example.png Gauge tickmark example
-
- Each instance of this component has access to the following properties:
-
- \table
- \row \li \c {readonly property int} \b styleData.index
- \li The index of this tickmark.
- \row \li \c {readonly property real} \b styleData.value
- \li The value that this tickmark represents.
- \row \li \c {readonly property real} \b styleData.valuePosition
- \li The value that this tickmark represents as a position in
- pixels, with 0 being at the bottom of the gauge.
- \endtable
-
- \sa minorTickmark
- */
- property Component tickmark: Item {
- implicitWidth: Math.round(TextSingleton.height * 1.1)
- implicitHeight: Math.max(2, Math.round(TextSingleton.height * 0.1))
-
- Rectangle {
- color: "#c8c8c8"
- anchors.fill: parent
- anchors.leftMargin: Math.round(TextSingleton.implicitHeight * 0.2)
- anchors.rightMargin: Math.round(TextSingleton.implicitHeight * 0.2)
- }
- }
-
- /*!
- Each minor tickmark displayed by the gauge.
-
- To set the size of the minor tickmarks, specify an
- \l {Item::implicitWidth}{implicitWidth} and
- \l {Item::implicitHeight}{implicitHeight}.
-
- For layouting reasons, each minor tickmark should have the same
- \c implicitHeight. If different heights are needed for individual
- tickmarks, specify those heights in a child item of the component.
-
- In the example below, we decrease the width of the minor tickmarks:
-
- \code
- minorTickmark: Item {
- implicitWidth: 8
- implicitHeight: 1
-
- Rectangle {
- color: "#cccccc"
- anchors.fill: parent
- anchors.leftMargin: 2
- anchors.rightMargin: 4
- }
- }
- \endcode
-
- \image gauge-minorTickmark-example.png Gauge minorTickmark example
-
- Each instance of this component has access to the following property:
-
- \table
- \row \li \c {readonly property int} \b styleData.index
- \li The index of this minor tickmark.
- \row \li \c {readonly property real} \b styleData.value
- \li The value that this minor tickmark represents.
- \row \li \c {readonly property real} \b styleData.valuePosition
- \li The value that this minor tickmark represents as a
- position in pixels, with 0 being at the bottom of the
- gauge.
- \endtable
-
- \sa tickmark
- */
- property Component minorTickmark: Item {
- implicitWidth: Math.round(TextSingleton.implicitHeight * 0.65)
- implicitHeight: Math.max(1, Math.round(TextSingleton.implicitHeight * 0.05))
-
- Rectangle {
- color: "#c8c8c8"
- anchors.fill: parent
- anchors.leftMargin: control.__tickmarkAlignment === Qt.AlignBottom || control.__tickmarkAlignment === Qt.AlignRight
- ? Math.max(3, Math.round(TextSingleton.implicitHeight * 0.2))
- : 0
- anchors.rightMargin: control.__tickmarkAlignment === Qt.AlignBottom || control.__tickmarkAlignment === Qt.AlignRight
- ? 0
- : Math.max(3, Math.round(TextSingleton.implicitHeight * 0.2))
- }
- }
-
- /*!
- This defines the text of each tickmark label on the gauge.
-
- Each instance of this component has access to the following properties:
-
- \table
- \row \li \c {readonly property int} \b styleData.index
- \li The index of this label.
- \row \li \c {readonly property real} \b styleData.value
- \li The value that this label represents.
- \endtable
- */
- property Component tickmarkLabel: Text {
- text: control.formatValue(styleData.value)
- font: control.font
- color: "#c8c8c8"
- antialiasing: true
- }
-
- /*!
- The bar that represents the value of the gauge.
-
- To height of the value bar is automatically resized according to
- \l {Gauge::value}{value}, and does not need to be specified.
-
- When a custom valueBar is defined, its
- \l {Item::implicitWidth}{implicitWidth} property must be set.
- */
- property Component valueBar: Rectangle {
- color: "#00bbff"
- implicitWidth: TextSingleton.implicitHeight
- }
-
- /*!
- The bar that represents the foreground of the gauge.
-
- This component is drawn above every other component.
- */
- property Component foreground: Canvas {
- readonly property real xCenter: width / 2
- readonly property real yCenter: height / 2
- property real shineLength: height * 0.95
-
- onPaint: {
- var ctx = getContext("2d");
- ctx.reset();
-
- ctx.beginPath();
- ctx.rect(0, 0, width, height);
-
- var gradient = ctx.createLinearGradient(0, yCenter, width, yCenter);
-
- gradient.addColorStop(0, Qt.rgba(1, 1, 1, 0.08));
- gradient.addColorStop(1, Qt.rgba(1, 1, 1, 0.20));
- ctx.fillStyle = gradient;
- ctx.fill();
- }
- }
-
- /*! \internal */
- property Component panel: Item {
- id: panelComponent
- implicitWidth: control.orientation === Qt.Vertical ? tickmarkLabelBoundsWidth + rawBarWidth : TextSingleton.height * 14
- implicitHeight: control.orientation === Qt.Vertical ? TextSingleton.height * 14 : tickmarkLabelBoundsWidth + rawBarWidth
-
- readonly property int tickmarkCount: (control.maximumValue - control.minimumValue) / control.tickmarkStepSize + 1
- readonly property real tickmarkSpacing: (tickmarkLabelBounds.height - tickmarkWidth * tickmarkCount) / (tickmarkCount - 1)
-
- property real tickmarkLength: tickmarkColumn.width
- // Can't deduce this from the column, so we set it from within the first tickmark delegate loader.
- property real tickmarkWidth: 2
-
- readonly property real tickmarkOffset: control.orientation === Qt.Vertical ? control.__hiddenText.height / 2 : control.__hiddenText.width / 2
-
- readonly property real minorTickmarkStep: control.tickmarkStepSize / (control.minorTickmarkCount + 1);
-
- /*!
- Returns the marker text that should be displayed based on
- \a markerPos (\c 0 to \c 1.0).
- */
- function markerTextFromPos(markerPos) {
- return markerPos * (control.maximumValue - control.minimumValue) + control.minimumValue;
- }
-
- readonly property real rawBarWidth: valueBarLoader.item.implicitWidth
- readonly property real barLength: (control.orientation === Qt.Vertical ? control.height : control.width) - (tickmarkOffset * 2 - 2)
-
- readonly property real tickmarkLabelBoundsWidth: tickmarkLength + (control.orientation === Qt.Vertical ? control.__hiddenText.width : control.__hiddenText.height)
- readonly property int valuePosition: valueBarLoader.height
-
- Item {
- id: container
-
- width: control.orientation === Qt.Vertical ? parent.width : parent.height
- height: control.orientation === Qt.Vertical ? parent.height : parent.width
- rotation: control.orientation === Qt.Horizontal ? 90 : 0
- transformOrigin: Item.Center
- anchors.centerIn: parent
-
- Item {
- id: valueBarItem
-
- x: control.__tickmarkAlignment === Qt.AlignLeft || control.__tickmarkAlignment === Qt.AlignTop ? tickmarkLabelBounds.x + tickmarkLabelBounds.width : 0
- width: rawBarWidth
- height: barLength
- anchors.verticalCenter: parent.verticalCenter
-
- Loader {
- id: backgroundLoader
- sourceComponent: background
- anchors.fill: parent
- }
-
- Loader {
- id: valueBarLoader
- sourceComponent: valueBar
-
- readonly property real valueAsPercentage: (control.value - control.minimumValue) / (control.maximumValue - control.minimumValue)
-
- y: Math.round(parent.height - height)
- height: Math.round(valueAsPercentage * parent.height)
- }
- }
- Item {
- id: tickmarkLabelBounds
-
- x: control.__tickmarkAlignment === Qt.AlignLeft || control.__tickmarkAlignment === Qt.AlignTop ? 0 : valueBarItem.width
- width: tickmarkLabelBoundsWidth
- height: barLength
- anchors.verticalCenter: parent.verticalCenter
- // We want our items to be laid out from bottom to top, but Column can't do that, so we flip
- // the whole item containing the tickmarks and labels vertically. Then, we flip each tickmark
- // and label back again.
- transform: Rotation {
- axis.x: 1
- axis.y: 0
- axis.z: 0
- origin.x: tickmarkLabelBounds.width / 2
- origin.y: tickmarkLabelBounds.height / 2
- angle: 180
- }
-
- Column {
- id: tickmarkColumn
- x: control.__tickmarkAlignment === Qt.AlignRight || control.__tickmarkAlignment === Qt.AlignBottom ? 0 : tickmarkLabelBounds.width - width
- spacing: tickmarkSpacing
- anchors.verticalCenter: parent.verticalCenter
-
- Repeater {
- id: tickmarkRepeater
- model: tickmarkCount
- delegate: Loader {
- id: tickmarkDelegateLoader
-
- sourceComponent: gaugeStyle.tickmark
- transform: Rotation {
- axis.x: 1
- axis.y: 0
- axis.z: 0
- origin.x: tickmarkDelegateLoader.width / 2
- origin.y: tickmarkDelegateLoader.height / 2
- angle: 180
- }
-
- onHeightChanged: {
- if (index == 0)
- tickmarkWidth = height;
- }
-
- readonly property int __index: index
- property QtObject styleData: QtObject {
- readonly property alias index: tickmarkDelegateLoader.__index
- readonly property real value: (index / (tickmarkCount - 1)) * (control.maximumValue - control.minimumValue) + control.minimumValue
- readonly property int valuePosition: Math.round(tickmarkDelegateLoader.y)
- }
- }
- }
- }
-
- // Doesn't need to be in a column, since we assume that the major tickmarks will always be longer than us.
- Repeater {
- id: minorTickmarkRepeater
- model: (tickmarkCount - 1) * control.minorTickmarkCount
- delegate: Loader {
- id: minorTickmarkDelegateLoader
-
- x: control.__tickmarkAlignment === Qt.AlignRight || control.__tickmarkAlignment === Qt.AlignBottom ? 0 : tickmarkLabelBounds.width - width
- y: {
- var tickmarkWidthOffset = Math.floor(index / control.minorTickmarkCount) * tickmarkWidth + tickmarkWidth;
- var relativePosition = (index % control.minorTickmarkCount + 1) * (tickmarkSpacing / (control.minorTickmarkCount + 1));
- var clusterOffset = Math.floor(index / control.minorTickmarkCount) * tickmarkSpacing;
- // We assume that each minorTickmark's height is the same.
- return clusterOffset + tickmarkWidthOffset + relativePosition - height / 2;
- }
-
- transform: Rotation {
- axis.x: 1
- axis.y: 0
- axis.z: 0
- origin.x: minorTickmarkDelegateLoader.width / 2
- origin.y: minorTickmarkDelegateLoader.height / 2
- angle: 180
- }
-
- sourceComponent: gaugeStyle.minorTickmark
-
- readonly property int __index: index
- property QtObject styleData: QtObject {
- readonly property alias index: minorTickmarkDelegateLoader.__index
- readonly property real value: {
- var tickmarkIndex = Math.floor(index / control.minorTickmarkCount);
- return index * minorTickmarkStep + minorTickmarkStep * tickmarkIndex + minorTickmarkStep + control.minimumValue;
- }
- readonly property int valuePosition: Math.round(minorTickmarkDelegateLoader.y)
- }
- }
- }
-
- Item {
- id: tickmarkLabelItem
- x: control.__tickmarkAlignment === Qt.AlignRight || control.__tickmarkAlignment === Qt.AlignBottom
- ? tickmarkLength
- : tickmarkLabelBounds.width - tickmarkLength - width
- width: control.__hiddenText.width
- // Use the bar height instead of the container's, as the labels seem to be translated by 1 when we
- // flip the control vertically, and this fixes that.
- height: parent.height
- anchors.verticalCenter: parent.verticalCenter
-
- Repeater {
- id: tickmarkTextRepeater
- model: tickmarkCount
- delegate: Item {
- x: {
- if (control.orientation === Qt.Vertical)
- return 0;
-
- // Align the text to the edge of the tickmarks.
- return ((width - height) / 2) * (control.__tickmarkAlignment === Qt.AlignBottom ? -1 : 1);
- }
- y: index * labelDistance - height / 2
-
- width: control.__hiddenText.width
- height: control.__hiddenText.height
-
- transformOrigin: Item.Center
- rotation: control.orientation === Qt.Vertical ? 0 : 90
-
- readonly property real labelDistance: tickmarkLabelBounds.height / (tickmarkCount - 1)
-
- Loader {
- id: tickmarkTextRepeaterDelegate
-
- x: {
- if (control.orientation === Qt.Horizontal) {
- return parent.width / 2 - width / 2;
- }
-
- return control.__tickmarkAlignment === Qt.AlignRight || control.__tickmarkAlignment === Qt.AlignBottom
- ? 0
- : parent.width - width;
- }
-
- transform: Rotation {
- axis.x: 1
- axis.y: 0
- axis.z: 0
- origin.x: tickmarkTextRepeaterDelegate.width / 2
- origin.y: tickmarkTextRepeaterDelegate.height / 2
- angle: 180
- }
-
- sourceComponent: tickmarkLabel
-
- readonly property int __index: index
- property QtObject styleData: QtObject {
- readonly property alias index: tickmarkTextRepeaterDelegate.__index
- readonly property real value: markerTextFromPos(index / (tickmarkTextRepeater.count - 1))
- }
- }
- }
- }
- }
- }
- Loader {
- id: foregroundLoader
- sourceComponent: foreground
- anchors.fill: valueBarItem
- }
- }
- }
-}
diff --git a/src/extras/Styles/Base/HandleStyle.qml b/src/extras/Styles/Base/HandleStyle.qml
deleted file mode 100644
index 38588417..00000000
--- a/src/extras/Styles/Base/HandleStyle.qml
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
-
-Style {
- id: handleStyle
- property alias handleColorTop: __helper.handleColorTop
- property alias handleColorBottom: __helper.handleColorBottom
- property alias handleColorBottomStop: __helper.handleColorBottomStop
-
- HandleStyleHelper {
- id: __helper
- }
-
- property Component handle: Item {
- implicitWidth: 50
- implicitHeight: 50
-
- Canvas {
- id: handleCanvas
- anchors.fill: parent
-
- onPaint: {
- var ctx = getContext("2d");
- __helper.paintHandle(ctx);
- }
- }
- }
-
- property Component panel: Item {
- Loader {
- id: handleLoader
- sourceComponent: handle
- anchors.fill: parent
- }
- }
-}
diff --git a/src/extras/Styles/Base/HandleStyleHelper.qml b/src/extras/Styles/Base/HandleStyleHelper.qml
deleted file mode 100644
index 61ad3bb3..00000000
--- a/src/extras/Styles/Base/HandleStyleHelper.qml
+++ /dev/null
@@ -1,91 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-
-QtObject {
- id: handleStyleHelper
-
- property color handleColorTop: "#969696"
- property color handleColorBottom: Qt.rgba(0.9, 0.9, 0.9, 0.298)
- property real handleColorBottomStop: 0.7
-
- property color handleRingColorTop: "#b0b0b0"
- property color handleRingColorBottom: "transparent"
-
- /*!
- If \a ctx is the only argument, this is equivalent to calling
- paintHandle(\c ctx, \c 0, \c 0, \c ctx.canvas.width, \c ctx.canvas.height).
- */
- function paintHandle(ctx, handleX, handleY, handleWidth, handleHeight) {
- ctx.reset();
-
- if (handleWidth < 0)
- return;
-
- if (arguments.length == 1) {
- handleX = 0;
- handleY = 0;
- handleWidth = ctx.canvas.width;
- handleHeight = ctx.canvas.height;
- }
-
- ctx.beginPath();
- var gradient = ctx.createRadialGradient(handleX, handleY, handleWidth / 2,
- handleX, handleY, handleWidth);
- gradient.addColorStop(0, handleColorTop);
- gradient.addColorStop(handleColorBottomStop, handleColorBottom);
- ctx.ellipse(handleX, handleY, handleWidth, handleHeight);
- ctx.fillStyle = gradient;
- ctx.fill();
-
- /* Draw the ring gradient around the handle. */
- // Clip first, so we only draw inside the ring.
- ctx.beginPath();
- ctx.ellipse(handleX, handleY, handleWidth, handleHeight);
- ctx.ellipse(handleX + 2, handleY + 2, handleWidth - 4, handleHeight - 4);
- ctx.clip();
-
- ctx.beginPath();
- gradient = ctx.createLinearGradient(handleX + handleWidth / 2, handleY,
- handleX + handleWidth / 2, handleY + handleHeight);
- gradient.addColorStop(0, handleRingColorTop);
- gradient.addColorStop(1, handleRingColorBottom);
- ctx.ellipse(handleX, handleY, handleWidth, handleHeight);
- ctx.fillStyle = gradient;
- ctx.fill();
- }
-}
diff --git a/src/extras/Styles/Base/PieMenuStyle.qml b/src/extras/Styles/Base/PieMenuStyle.qml
deleted file mode 100644
index c7cd1dda..00000000
--- a/src/extras/Styles/Base/PieMenuStyle.qml
+++ /dev/null
@@ -1,393 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtGraphicalEffects 1.0
-import QtQuick.Controls 1.1
-import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
-import QtQuick.Extras.Private 1.0
-import QtQuick.Extras.Private.CppUtils 1.0
-
-/*!
- \qmltype PieMenuStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.0
- \ingroup extrasstyles
- \brief Provides custom styling for PieMenu.
-
- PieMenuStyle is a style for PieMenu that draws each section of the menu as a
- filled "slice".
-
- You can create a custom pie menu by replacing the following delegates:
- \list
- \li \l background
- \li \l cancel
- \li \l menuItem
- \li \l title
- \endlist
-
- To customize the appearance of each menuItem without having to define your
- own, you can use the \l backgroundColor and \l selectionColor properties.
- To customize the drop shadow, use the \l shadowColor, \l shadowRadius and
- \l shadowSpread properties.
-
- Icons that are too large for the section that they are in will be scaled
- down appropriately.
-
- To style individual sections of the menu, use the menuItem component:
- \code
- PieMenuStyle {
- shadowRadius: 0
-
- menuItem: Item {
- id: item
- rotation: -90 + sectionCenterAngle(styleData.index)
-
- Rectangle {
- width: parent.height * 0.2
- height: width
- color: "darkorange"
- radius: width / 2
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
-
- Text {
- id: textItem
- text: control.menuItems[styleData.index].text
- anchors.centerIn: parent
- color: control.currentIndex === styleData.index ? "red" : "white"
- rotation: -item.rotation
- }
- }
- }
- }
- \endcode
-
- \image piemenu-menuitem-example.png A custom PieMenu
-*/
-
-Style {
- id: pieMenuStyle
-
- /*!
- \since 1.3
-
- The \l PieMenu that this style is attached to.
- */
- readonly property PieMenu control: __control
-
- /*! The background color. */
- property color backgroundColor: Qt.rgba(0.6, 0.6, 0.6, 0.66)
-
- /*! The selection color. */
- property color selectionColor: "#eee"
-
- /*! The shadow color. */
- property color shadowColor: Qt.rgba(0, 0, 0, 0.26)
-
- /*! The shadow radius. */
- property real shadowRadius: 50
-
- /*! The shadow spread. */
- property real shadowSpread: 0.3
-
- /*!
- The distance from the center of the menu to the outer edge of the menu.
-
- \sa cancelRadius
- */
- readonly property real radius: Math.min(control.width, control.height) * 0.5
-
- /*!
- The radius of the area that is used to cancel the menu.
-
- \sa radius
- */
- property real cancelRadius: radius * 0.4
-
- /*!
- The angle (in degrees) at which the first menu item will be drawn.
-
- The absolute range formed by \a startAngle and \l endAngle must be
- less than or equal to \c 360 degrees.
-
- Menu items are displayed clockwise when \a startAngle is less than
- \l endAngle, otherwise they are displayed anti-clockwise.
-
- \sa endAngle
- */
- property real startAngle: -90
-
- /*!
- The angle (in degrees) at which the last menu item will be drawn.
-
- The absolute range formed by \l startAngle and \a endAngle must be
- less than or equal to \c 360 degrees.
-
- Menu items are displayed clockwise when \l startAngle is less than
- \a endAngle, otherwise they are displayed anti-clockwise.
-
- \sa startAngle
- */
- property real endAngle: 90
-
- /*!
- Returns the start of the section at \a itemIndex as an angle in degrees.
- */
- function sectionStartAngle(itemIndex) {
- return MathUtils.radToDegOffset(control.__protectedScope.sectionStartAngle(itemIndex));
- }
-
- /*!
- Returns the center of the section at \a itemIndex as an angle in
- degrees.
- */
- function sectionCenterAngle(itemIndex) {
- return MathUtils.radToDegOffset(control.__protectedScope.sectionCenterAngle(itemIndex));
- }
-
- /*!
- Returns the end of the section at \a itemIndex as an angle in degrees.
- */
- function sectionEndAngle(itemIndex) {
- return MathUtils.radToDegOffset(control.__protectedScope.sectionEndAngle(itemIndex));
- }
-
- /*!
- \internal
-
- The distance in pixels from the center of each menu item's icon to the
- center of the menu. A higher value means that the icons will be further
- from the center of the menu.
- */
- readonly property real __iconOffset: cancelRadius + ((radius - cancelRadius) / 2)
-
- /*! \internal */
- readonly property real __selectableRadius: radius - cancelRadius
-
- /*! \internal */
- property int __implicitWidth: Math.round(TextSingleton.implicitHeight * 12.5)
-
- /*! \internal */
- property int __implicitHeight: __implicitWidth
-
- /*!
- The background of the menu.
-
- By default, there is no background defined.
- */
- property Component background
-
- /*!
- The cancel component of the menu.
-
- This is an area in the center of the menu that closes the menu when
- clicked.
-
- By default, it is not visible.
- */
- property Component cancel: null
-
- /*!
- \since QtQuick.Extras 1.1
-
- The component that displays the text of the currently selected menu
- item, or the title if there is no current item.
-
- The current item's text is available via the \c styleData.text
- property.
- */
- property Component title: Text {
- font.pointSize: 20
- text: styleData.text
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- color: "#ccc"
- antialiasing: true
- }
-
- /*!
- This component defines each section of the pie menu.
-
- This component covers the width and height of the control.
-
- No mouse events are propagated to this component, which means that
- controls like Button will not function when used within it. You can
- check if the mouse is over this section by comparing
- \c control.currentIndex to \c styleData.index.
-
- Each instance of this component has access to the following properties:
-
- \table
- \row \li \c {readonly property int} \b styleData.index
- \li The index of this menu item.
- \row \li \c {readonly property bool} \b styleData.hovered
- \li \c true if this menu item is under the mouse.
- \row \li \c {readonly property bool} \b styleData.pressed
- \li \c true if the mouse is pressed down on this menu item.
- (since QtQuick.Extras 1.3)
- \endtable
- */
- property Component menuItem: Item {
- id: actionRootDelegateItem
-
- function drawRingSection(ctx, x, y, section, r, ringWidth, ringColor) {
- ctx.fillStyle = ringColor;
-
- // Draw one section.
- ctx.beginPath();
- ctx.moveTo(x,y);
-
- // Canvas draws 0 degrees at 3 o'clock, whereas we want it to draw it at 12.
- var start = control.__protectedScope.sectionStartAngle(section);
- var end = control.__protectedScope.sectionEndAngle(section);
- ctx.arc(x, y, r, start, end, start > end);
- ctx.fill();
-
- // Either change this to the background color, or use the global composition.
- ctx.fillStyle = "black";
- ctx.globalCompositeOperation = "destination-out";
- ctx.beginPath();
- ctx.moveTo(x, y);
- ctx.arc(x, y, ringWidth, 0, Math.PI * 2);
- ctx.closePath();
- ctx.fill();
-
- // If using the global composition method, make sure to change it back to default.
- ctx.globalCompositeOperation = "source-over";
- }
-
- Canvas {
- id: actionCanvas
- anchors.fill: parent
- property color currentColor: control.currentIndex === styleData.index ? selectionColor : backgroundColor
-
- Connections {
- target: pieMenuStyle
- onStartAngleChanged: actionCanvas.requestPaint()
- onEndAngleChanged: actionCanvas.requestPaint()
- }
-
- Connections {
- target: control
- onCurrentIndexChanged: actionCanvas.requestPaint()
- }
-
- onPaint: {
- var ctx = getContext("2d");
- ctx.reset();
- drawRingSection(ctx, width / 2, height / 2, styleData.index, radius, cancelRadius, currentColor);
- }
- }
-
- readonly property var __styleData: styleData
-
- PieMenuIcon {
- control: pieMenuStyle.control
- styleData: __styleData
- }
- }
-
- /*! \internal */
- property Component panel: Item {
- implicitWidth: __implicitWidth
- implicitHeight: __implicitHeight
-
- property alias titleItem: titleLoader.item
-
- Item {
- id: itemgroup
- anchors.fill: parent
- visible: false
-
- Loader {
- id: backgroundLoader
- sourceComponent: background
- anchors.fill: parent
- }
-
- Loader {
- id: cancelLoader
- sourceComponent: cancel
- anchors.centerIn: parent
- }
-
- Repeater {
- id: menuItemRepeater
- model: control.__protectedScope.visibleItems
-
- delegate: Loader {
- id: menuItemLoader
- anchors.fill: parent
- sourceComponent: menuItem
-
- readonly property int __index: index
- property QtObject styleData: QtObject {
- readonly property alias index: menuItemLoader.__index
- readonly property bool hovered: control.currentIndex === index
- readonly property bool pressed: control.__protectedScope.pressedIndex === index
- }
- }
- }
- }
- DropShadow {
- id: dropShadow
- anchors.fill: itemgroup
- fast: true
- radius: shadowRadius
- spread: shadowSpread
- transparentBorder: true
- samples: 12
- color: shadowColor
- source: itemgroup
- }
-
- Loader {
- id: titleLoader
- sourceComponent: title
- x: parent.x + parent.width / 2 - width / 2
- y: -height - 10
-
- property QtObject styleData: QtObject {
- property string text: control.currentIndex !== -1
- ? control.__protectedScope.visibleItems[control.currentIndex].text
- : control.title
- }
- }
- }
-}
diff --git a/src/extras/Styles/Base/StatusIndicatorStyle.qml b/src/extras/Styles/Base/StatusIndicatorStyle.qml
deleted file mode 100644
index ddfd1b45..00000000
--- a/src/extras/Styles/Base/StatusIndicatorStyle.qml
+++ /dev/null
@@ -1,237 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtGraphicalEffects 1.0
-import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
-
-/*!
- \qmltype StatusIndicatorStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.1
- \ingroup extrasstyles
- \brief Provides custom styling for StatusIndicatorStyle.
-
- You can create a custom status indicator by defining the \l indicator
- component.
-*/
-
-Style {
- id: pieMenuStyle
-
- /*!
- \since 1.3
-
- The \l StatusIndicator that this style is attached to.
- */
- readonly property StatusIndicator control: __control
-
- /*!
- \since 1.3
-
- The color that instances of
- \l {QtQuick.Extras::}{StatusIndicator} will have.
- The \l {QtQuick.Extras::StatusIndicator::}{color}
- property in \l {QtQuick.Extras::}{StatusIndicator}
- will override this property when set.
- */
- property color color: "red"
-
- /*!
- This defines the indicator in both its on and off status.
- */
- property Component indicator: Item {
- readonly property real shineStep: 0.05
- readonly property real smallestAxis: Math.min(control.width, control.height)
- readonly property real shadowRadius: smallestAxis * 0.4
- readonly property real outerRecessPercentage: 0.11
- readonly property color offColor: Qt.rgba(0.13, 0.13, 0.13)
- readonly property color baseColor: control.active ? control.color : offColor
-
- implicitWidth: TextSingleton.implicitHeight * 2
- implicitHeight: implicitWidth
-
- Canvas {
- id: backgroundCanvas
- width: Math.min(parent.width, parent.height)
- // height: width --- QTBUG-42878
- height: Math.min(parent.width, parent.height)
- anchors.centerIn: parent
-
- Connections {
- target: control
- onActiveChanged: backgroundCanvas.requestPaint()
- onColorChanged: backgroundCanvas.requestPaint()
- }
-
- onPaint: {
- var ctx = getContext("2d");
- ctx.reset();
-
- // Draw the semi-transparent background.
- ctx.beginPath();
- var gradient = ctx.createLinearGradient(width / 2, 0, width / 2, height * 0.75);
- gradient.addColorStop(0.0, Qt.rgba(0, 0, 0, control.active ? 0.1 : 0.25));
- gradient.addColorStop(1.0, control.active ? Qt.rgba(0, 0, 0, 0.1) : Qt.rgba(0.74, 0.74, 0.74, 0.25));
-
- ctx.fillStyle = gradient;
- ctx.ellipse(0, 0, width, height);
- ctx.fill();
- }
- }
-
- Item {
- id: shadowGuard
- anchors.fill: backgroundCanvas
- anchors.margins: -shadowRadius
-
- Canvas {
- id: colorCanvas
- anchors.fill: parent
- anchors.margins: shadowRadius
-
- Connections {
- target: control
- onActiveChanged: colorCanvas.requestPaint()
- onColorChanged: colorCanvas.requestPaint()
- }
-
- onPaint: {
- var ctx = getContext("2d");
- ctx.reset();
-
- // Draw the actual color within the circle.
- ctx.beginPath();
- ctx.fillStyle = baseColor;
- var recess = smallestAxis * outerRecessPercentage;
- ctx.ellipse(recess, recess, width - recess * 2, height - recess * 2);
- ctx.fill();
- }
- }
- }
-
- DropShadow {
- id: shadow
- source: shadowGuard
- color: control.color
- // Don't set fast here because Qt < 5.3 will run into QTBUG-36931
- radius: shadowRadius
- samples: Math.min(32, radius)
- cached: true
- anchors.fill: shadowGuard
- visible: control.active
- }
-
- Canvas {
- id: foregroundCanvas
- anchors.fill: backgroundCanvas
-
- Connections {
- target: control
- onActiveChanged: foregroundCanvas.requestPaint()
- onColorChanged: foregroundCanvas.requestPaint()
- }
-
- onPaint: {
- var ctx = getContext("2d");
- ctx.reset();
-
- // Draw the first shine.
- ctx.beginPath();
- ctx.fillStyle = Qt.rgba(1, 1, 1, 0.03);
- var recessPercentage = outerRecessPercentage + shineStep * 0.65;
- var recess = smallestAxis * recessPercentage;
- ctx.ellipse(recess, recess, width - recess * 2, height - recess * 2);
- ctx.fill();
-
- // Draw the second, inner shine.
- ctx.beginPath();
- ctx.fillStyle = Qt.rgba(1, 1, 1, 0.06);
- recessPercentage += shineStep;
- recess = smallestAxis * recessPercentage;
- ctx.ellipse(recess, recess, width - recess * 2, height - recess * 2);
- ctx.fill();
-
- // Now draw the final arced shine that goes over the first and second shines.
- // First, clip the entire shine area.
- ctx.beginPath();
- recessPercentage -= shineStep;
- recess = smallestAxis * recessPercentage;
- ctx.ellipse(recess, recess, width - recess * 2, height - recess * 2);
- ctx.clip();
-
- if (!control.active) {
- // Then, clip the bottom area out of the shine.
- ctx.ellipse(recess, height * 0.425, width - recess * 2, height - recess * 2);
- ctx.clip();
- }
-
- ctx.beginPath();
- var gradient;
- if (!control.active) {
- // Draw the shine arc.
- gradient = ctx.createLinearGradient(width / 2, height * 0.2, width / 2, height * 0.65);
- gradient.addColorStop(0.0, Qt.rgba(1, 1, 1, 0.05));
- gradient.addColorStop(1.0, "transparent");
- } else {
- // Draw the radial shine.
- gradient = ctx.createRadialGradient(width / 2, height / 2, width * 0.25, width / 2, height / 2, width * 0.25);
- gradient.addColorStop(0.0, Qt.lighter(baseColor, 1.4));
- gradient.addColorStop(1.0, "transparent");
- }
-
- ctx.fillStyle = gradient;
- ctx.ellipse(recess, recess, width - recess * 2, height - recess * 2);
- ctx.fill();
- }
- }
- }
-
- /*! \internal */
- property Component panel: Item {
- implicitWidth: indicatorLoader.implicitWidth
- implicitHeight: indicatorLoader.implicitHeight
-
- Loader {
- id: indicatorLoader
- width: Math.max(1, parent.width)
- height: Math.max(1, parent.height)
- anchors.centerIn: parent
- sourceComponent: indicator
- }
- }
-}
diff --git a/src/extras/Styles/Base/ToggleButtonStyle.qml b/src/extras/Styles/Base/ToggleButtonStyle.qml
deleted file mode 100644
index 507c0314..00000000
--- a/src/extras/Styles/Base/ToggleButtonStyle.qml
+++ /dev/null
@@ -1,294 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtGraphicalEffects 1.0
-import QtQuick.Controls.Styles 1.1
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
-import QtQuick.Extras.Private 1.0
-import QtQuick.Extras.Private.CppUtils 1.0
-
-/*!
- \qmltype ToggleButtonStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.0
- \ingroup extrasstyles
- \brief Provides custom styling for ToggleButton.
-
- You can create a custom toggle button by replacing the same delegates that
- \l {QtQuick.Controls.Styles::ButtonStyle}{ButtonStyle} provides.
-*/
-
-CircularButtonStyle {
- id: circularButtonStyle
-
- /*!
- \since 1.3
-
- The \l ToggleButton that this style is attached to.
- */
- readonly property ToggleButton control: __control
-
- /*!
- The gradient that is displayed on the inactive state indicator. The
- inactive state indicator will be the checked gradient when the button
- is unchecked, and the unchecked gradient when the button is checked.
-
- \sa checkedGradient, uncheckedGradient
- */
- property Gradient inactiveGradient: Gradient {
- GradientStop {
- position: 0
- color: commonStyleHelper.inactiveColor
- }
- GradientStop {
- position: 1
- color: commonStyleHelper.inactiveColorShine
- }
- }
-
- /*!
- The gradient that is displayed on the checked state indicator.
-
- \sa uncheckedGradient, inactiveGradient
- */
- property Gradient checkedGradient: Gradient {
- GradientStop {
- position: 0
- color: commonStyleHelper.onColor
- }
- GradientStop {
- position: 1
- color: commonStyleHelper.onColorShine
- }
- }
-
- /*!
- The gradient that is displayed on the unchecked state indicator.
-
- \sa checkedGradient, inactiveGradient
- */
- property Gradient uncheckedGradient: Gradient {
- GradientStop {
- position: 0
- color: commonStyleHelper.offColor
- }
- GradientStop {
- position: 1
- color: commonStyleHelper.offColorShine
- }
- }
-
- /*!
- The color that is used for the drop shadow below the checked state
- indicator.
-
- \sa uncheckedDropShadowColor
- */
- property color checkedDropShadowColor: commonStyleHelper.onColor
-
- /*!
- The color that is used for the drop shadow below the checked state
- indicator.
-
- \sa checkedDropShadowColor
- */
- property color uncheckedDropShadowColor: commonStyleHelper.offColor
-
- CommonStyleHelper {
- id: commonStyleHelper
- }
-
- background: Item {
- implicitWidth: __buttonHelper.implicitWidth
- implicitHeight: __buttonHelper.implicitHeight
-
- Connections {
- target: control
- onPressedChanged: {
- backgroundCanvas.requestPaint();
- }
-
- onCheckedChanged: {
- uncheckedCanvas.requestPaint();
- checkedCanvas.requestPaint();
- }
- }
-
- Connections {
- target: circularButtonStyle
-
- onCheckedGradientChanged: checkedCanvas.requestPaint()
- onCheckedDropShadowColorChanged: checkedCanvas.requestPaint()
- onUncheckedGradientChanged: uncheckedCanvas.requestPaint()
- onUncheckedDropShadowColorChanged: uncheckedCanvas.requestPaint()
- onInactiveGradientChanged: {
- checkedCanvas.requestPaint();
- uncheckedCanvas.requestPaint();
- }
- }
-
- Connections {
- target: circularButtonStyle.checkedGradient
- onUpdated: checkedCanvas.requestPaint()
- }
-
- Connections {
- target: circularButtonStyle.uncheckedGradient
- onUpdated: uncheckedCanvas.requestPaint()
- }
-
- Connections {
- target: circularButtonStyle.inactiveGradient
- onUpdated: {
- uncheckedCanvas.requestPaint();
- checkedCanvas.requestPaint();
- }
- }
-
- Canvas {
- id: backgroundCanvas
- anchors.fill: parent
-
- onPaint: {
- var ctx = getContext("2d");
- __buttonHelper.paintBackground(ctx);
- }
- }
-
- Canvas {
- id: uncheckedCanvas
- anchors.fill: parent
- anchors.margins: -(__buttonHelper.radius * 3)
- visible: control.checked
-
- readonly property real xCenter: width / 2
- readonly property real yCenter: height / 2
-
- onPaint: {
- var ctx = getContext("2d");
- ctx.reset();
-
- /* Draw unchecked indicator */
- ctx.beginPath();
- ctx.lineWidth = __buttonHelper.outerArcLineWidth - __buttonHelper.innerArcLineWidth;
- ctx.arc(xCenter, yCenter, __buttonHelper.outerArcRadius + __buttonHelper.innerArcLineWidth / 2,
- MathUtils.degToRad(180), MathUtils.degToRad(270), false);
- var gradient = ctx.createLinearGradient(xCenter, yCenter + __buttonHelper.radius,
- xCenter, yCenter - __buttonHelper.radius);
- var relevantGradient = control.checked ? inactiveGradient : uncheckedGradient;
- for (var i = 0; i < relevantGradient.stops.length; ++i) {
- gradient.addColorStop(relevantGradient.stops[i].position, relevantGradient.stops[i].color);
- }
- ctx.strokeStyle = gradient;
- ctx.stroke();
- }
- }
-
- Canvas {
- id: checkedCanvas
- anchors.fill: parent
- anchors.margins: -(__buttonHelper.radius * 3)
- visible: !control.checked
-
- readonly property real xCenter: width / 2
- readonly property real yCenter: height / 2
-
- onPaint: {
- var ctx = getContext("2d");
- ctx.reset();
-
- /* Draw checked indicator */
- ctx.beginPath();
- ctx.lineWidth = __buttonHelper.outerArcLineWidth - __buttonHelper.innerArcLineWidth;
- ctx.arc(xCenter, yCenter, __buttonHelper.outerArcRadius + __buttonHelper.innerArcLineWidth / 2,
- MathUtils.degToRad(270), MathUtils.degToRad(0), false);
- var gradient = ctx.createLinearGradient(xCenter, yCenter + __buttonHelper.radius,
- xCenter, yCenter - __buttonHelper.radius);
- var relevantGradient = control.checked ? checkedGradient : inactiveGradient;
- for (var i = 0; i < relevantGradient.stops.length; ++i) {
- gradient.addColorStop(relevantGradient.stops[i].position, relevantGradient.stops[i].color);
- }
- ctx.strokeStyle = gradient;
- ctx.stroke();
- }
- }
-
- DropShadow {
- id: uncheckedDropShadow
- anchors.fill: uncheckedCanvas
- cached: true
- radius: 4
- samples: 8
- color: uncheckedDropShadowColor
- source: uncheckedCanvas
- visible: !control.checked
- }
-
- DropShadow {
- id: checkedDropShadow
- anchors.fill: checkedCanvas
- cached: true
- radius: 4
- samples: 8
- color: checkedDropShadowColor
- source: checkedCanvas
- visible: control.checked
- }
- }
-
- panel: Item {
- implicitWidth: backgroundLoader.implicitWidth
- implicitHeight: backgroundLoader.implicitHeight
-
- Loader {
- id: backgroundLoader
- anchors.fill: parent
- sourceComponent: background
- }
-
- Loader {
- id: labelLoader
- sourceComponent: label
- anchors.fill: parent
- anchors.leftMargin: padding.left
- anchors.topMargin: padding.top
- anchors.rightMargin: padding.right
- anchors.bottomMargin: padding.bottom
- }
- }
-}
diff --git a/src/extras/Styles/Base/TumblerStyle.qml b/src/extras/Styles/Base/TumblerStyle.qml
deleted file mode 100644
index 3ebcb7a2..00000000
--- a/src/extras/Styles/Base/TumblerStyle.qml
+++ /dev/null
@@ -1,330 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtGraphicalEffects 1.0
-import QtQuick.Controls 1.0
-import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
-import QtQuick.Extras.Private 1.0
-
-/*!
- \qmltype TumblerStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.2
- \ingroup extrasstyles
- \brief Provides custom styling for Tumbler.
-
- \note TumblerStyle requires Qt 5.3.2 or later.
-
- You can create a custom tumbler by replacing the following delegates:
- \list
- \li \l background
- \li \l foreground
- \li \l separator
- \li \l delegate
- \li \l highlight
- \li \l frame
- \endlist
-*/
-
-Style {
- id: tumblerStyle
-
- padding.left: __padding
- padding.right: __padding
- padding.top: __padding
- padding.bottom: __padding
-
- /*!
- \since 1.3
-
- The \l Tumbler that this style is attached to.
- */
- readonly property Tumbler control: __control
-
- /*!
- This property holds the spacing between each delegate.
- */
- property real spacing: 0
-
- /*!
- This property holds the amount of items visible in each column.
-
- This value should be an odd number.
- */
- property int visibleItemCount: 3
-
- /*!
- \internal
-
- TODO: how do we handle differing padding values?
- */
- readonly property real __padding: Math.max(6, Math.round(TextSingleton.implicitHeight * 0.4))
- /*! \internal */
- property real __delegateHeight: 0
- /*! \internal */
- property real __separatorWidth: 0
-
- /*!
- The background of the tumbler.
- */
- property Component background: Rectangle {
- gradient: Gradient {
- GradientStop { position: 0.00; color: "#acacac" }
- GradientStop { position: 0.12; color: "#d5d5d5" }
- GradientStop { position: 0.24; color: "#e8e8e8" }
- GradientStop { position: 0.39; color: "#ffffff" }
- GradientStop { position: 0.61; color: "#ffffff" }
- GradientStop { position: 0.76; color: "#e8e8e8" }
- GradientStop { position: 0.88; color: "#d5d5d5" }
- GradientStop { position: 1.00; color: "#acacac" }
- }
- }
-
- /*!
- The foreground of the tumbler.
- */
- property Component foreground: Item {
- clip: true
-
- Rectangle {
- id: rect
- anchors.fill: parent
- // Go one pixel larger than our parent so that we can hide our one pixel frame
- // that the shadow is created from.
- anchors.margins: -1
- color: "transparent"
- border.color: "black"
- visible: false
- }
-
- DropShadow {
- anchors.fill: rect
- source: rect
- radius: __padding
- samples: Math.min(32, radius * 2)
- }
- }
-
- /*!
- The separator between each column.
-
- The \l {Item::}{implicitWidth} property must be set, and should be the
- same value for each separator.
- */
- property Component separator: Canvas {
- implicitWidth: Math.max(10, Math.round(TextSingleton.implicitHeight * 0.4))
-
- onPaint: {
- var ctx = getContext("2d");
- ctx.reset();
-
- ctx.fillStyle = "#11000000";
- ctx.fillRect(0, 0, width, height);
- ctx.fillStyle = "#11000000";
- ctx.fillRect(width * 0.2, 0, width * 0.6, height);
- ctx.fillStyle = "#66000000";
- ctx.fillRect(width * 0.4, 0, width * 0.2, height);
- }
- }
-
- /*!
- The foreground of each column.
-
- In terms of stacking order, this component is displayed above the
- delegate and highlight components, but below the foreground component.
-
- \table
- \row \li \c {readonly property int} \b styleData.column
- \li The index of the column that contains this item.
- \row \li \c {readonly property bool} \b styleData.activeFocus
- \li \c true if the column that contains this item has active focus.
-
- \endtable
-
- Delegates for items in specific columns can be defined using
- TumblerColumn's \l {TumblerColumn::columnForeground}{columnForeground}
- property, which will be used instead of this component.
- */
- property Component columnForeground
-
- /*!
- The frame around the tumbler.
-
- The \l {Item::}{implicitWidth} property must be set, and should be the
- same value for each separator.
- */
- property Component frame: Canvas {
- onPaint: {
- // workaround for QTBUG-40792
- var ctx = getContext("2d");
- ctx.reset();
-
- var cornerRadius = Math.max(2, Math.round(TextSingleton.implicitHeight * 0.2));
- var outerLineWidth = Math.max(1, Math.round(TextSingleton.implicitHeight * 0.05));
- var innerLineWidth = __padding - outerLineWidth;
-
- ctx.save();
- ctx.lineWidth = outerLineWidth;
- ctx.beginPath();
- ctx.roundedRect(0, 0, width, height, cornerRadius, cornerRadius);
- ctx.roundedRect(outerLineWidth, outerLineWidth, width - outerLineWidth * 2, height - outerLineWidth * 2,
- cornerRadius - outerLineWidth, cornerRadius - outerLineWidth);
- ctx.clip();
-
- ctx.beginPath();
- ctx.rect(0, 0, width, height);
- var gradient = ctx.createLinearGradient(width / 2, 0, width / 2, height);
- gradient.addColorStop(0, "#33b3b3b3");
- gradient.addColorStop(1, "#4ce6e6e6");
- ctx.fillStyle = gradient;
- ctx.fill();
- ctx.restore();
-
- // The inner stroke must account for its corner radius.
- cornerRadius -= outerLineWidth;
-
- ctx.save();
- ctx.lineWidth = innerLineWidth;
- ctx.beginPath();
- ctx.roundedRect(outerLineWidth, outerLineWidth, width - outerLineWidth * 2, height - outerLineWidth * 2,
- cornerRadius, cornerRadius);
- ctx.roundedRect(outerLineWidth + innerLineWidth, outerLineWidth + innerLineWidth,
- width - outerLineWidth * 2 - innerLineWidth * 2, height - outerLineWidth * 2 - innerLineWidth * 2,
- cornerRadius - innerLineWidth, cornerRadius - innerLineWidth);
- ctx.clip();
-
- ctx.beginPath();
- ctx.rect(0, 0, width, height);
- gradient = ctx.createLinearGradient(width / 2, 0, width / 2, height);
- gradient.addColorStop(0, "#4c666666");
- gradient.addColorStop(1, "#40cccccc");
- ctx.fillStyle = gradient;
- ctx.fill();
- ctx.restore();
- }
- }
-
- /*!
- The delegate provides a template defining each item instantiated in the
- column. Each instance of this component has access to the following properties:
-
- \table
- \row \li \c {readonly property int} \b styleData.index
- \li The index of this delegate in the model.
- \row \li \c {readonly property int} \b styleData.column
- \li The index of the column that contains this item.
- \row \li \c {readonly property real} \b styleData.value
- \li The value for this delegate from the model.
- \row \li \c {readonly property bool} \b styleData.current
- \li \c true if this delegate is the current item.
- \row \li \c {readonly property real} \b styleData.displacement
- \li \c A value from \c {-visibleItemCount / 2} to
- \c {visibleItemCount / 2} which represents how far away
- this item is from being the current item, with \c 0 being
- completely current.
-
- For example, the item below will be 40% opaque when
- it is not the current item, and transition to 100%
- opacity when it becomes the current item:
-
- \code
- delegate: Text {
- text: styleData.value
- opacity: 0.4 + Math.max(0, 1 - Math.abs(styleData.displacement)) * 0.6
- }
- \endcode
- \row \li \c {readonly property bool} \b styleData.activeFocus
- \li \c true if the column that contains this item has active focus.
-
- \endtable
-
- Properties of the model are also available depending upon the type of
- \l {qml-data-models}{Data Model}.
-
- Delegates for items in specific columns can be defined using
- TumblerColumn's \l {TumblerColumn::delegate}{delegate} property, which
- will be used instead of this delegate.
-
- The \l {Item::}{implicitHeight} property must be set, and it must be
- the same for each delegate.
- */
- property Component delegate: Item {
- implicitHeight: (control.height - padding.top - padding.bottom) / tumblerStyle.visibleItemCount
-
- Text {
- id: label
- text: styleData.value
- color: "#666666"
- opacity: 0.4 + Math.max(0, 1 - Math.abs(styleData.displacement)) * 0.6
- font.pixelSize: Math.round(TextSingleton.font.pixelSize * 1.25)
- anchors.centerIn: parent
- }
- }
-
- /*!
- The delegate for the highlight of each column.
-
- Delegates for the highlight of specific columns can be defined using
- TumblerColumn's \l {TumblerColumn::highlight}{highlight} property,
- which will be used instead of this delegate.
-
- Each instance of this component has access to the following properties:
-
- \table
- \row \li \c {readonly property int} \b styleData.index
- \li The index of this column in the tumbler.
- \row \li \c {readonly property int} \b styleData.columnIndex
- \li The index of the column that contains this highlight.
- \row \li \c {readonly property bool} \b styleData.activeFocus
- \li \c true if the column that contains this highlight has active focus.
- \endtable
- */
- property Component highlight
-
- /*! \internal */
- property Component panel: Item {
- implicitWidth: {
- var w = (__separatorWidth * (control.columnCount - 1)) + tumblerStyle.padding.left + tumblerStyle.padding.right;
- for (var i = 0; i < control.columnCount; ++i)
- w += control.getColumn(i).width;
- return w;
- }
- implicitHeight: TextSingleton.implicitHeight * 10 + tumblerStyle.padding.top + tumblerStyle.padding.bottom
- }
-}
diff --git a/src/extras/Styles/Base/basestyle.qrc b/src/extras/Styles/Base/basestyle.qrc
deleted file mode 100644
index 2bcf0328..00000000
--- a/src/extras/Styles/Base/basestyle.qrc
+++ /dev/null
@@ -1,19 +0,0 @@
-<RCC>
- <qresource prefix="/ExtrasImports/QtQuick/Extras/Styles/Base">
- <file>TumblerStyle.qml</file>
- <file>ToggleButtonStyle.qml</file>
- <file>StatusIndicatorStyle.qml</file>
- <file>PieMenuStyle.qml</file>
- <file>HandleStyleHelper.qml</file>
- <file>HandleStyle.qml</file>
- <file>GaugeStyle.qml</file>
- <file>DialStyle.qml</file>
- <file>DelayButtonStyle.qml</file>
- <file>CommonStyleHelper.qml</file>
- <file>CircularTickmarkLabelStyle.qml</file>
- <file>CircularGaugeStyle.qml</file>
- <file>CircularButtonStyle.qml</file>
- <file>images/needle.png</file>
- <file>images/knob.png</file>
- </qresource>
-</RCC>
diff --git a/src/extras/Styles/Base/basestyleplugin.cpp b/src/extras/Styles/Base/basestyleplugin.cpp
deleted file mode 100644
index ef894910..00000000
--- a/src/extras/Styles/Base/basestyleplugin.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "basestyleplugin.h"
-
-QT_BEGIN_NAMESPACE
-
-QtQuickExtrasStylesPlugin::QtQuickExtrasStylesPlugin(QObject *parent) :
- QQmlExtensionPlugin(parent)
-{
-}
-
-void QtQuickExtrasStylesPlugin::registerTypes(const char *uri)
-{
- Q_INIT_RESOURCE(basestyle);
- const QString prefix = "qrc:/ExtrasImports/QtQuick/Extras/Styles";
- // register version 1.0
- qmlRegisterType(QUrl(prefix + "/Base/CircularButtonStyle.qml"), uri, 1, 0, "CircularButtonStyle");
- qmlRegisterType(QUrl(prefix + "/Base/CircularGaugeStyle.qml"), uri, 1, 0, "CircularGaugeStyle");
- qmlRegisterType(QUrl(prefix + "/Base/CircularTickmarkLabelStyle.qml"), uri, 1, 0, "CircularTickmarkLabelStyle");
- qmlRegisterType(QUrl(prefix + "/Base/CommonStyleHelper.qml"), uri, 1, 0, "CommonStyleHelper");
- qmlRegisterType(QUrl(prefix + "/Base/DelayButtonStyle.qml"), uri, 1, 0, "DelayButtonStyle");
- qmlRegisterType(QUrl(prefix + "/Base/DialStyle.qml"), uri, 1, 0, "DialStyle");
- qmlRegisterType(QUrl(prefix + "/Base/GaugeStyle.qml"), uri, 1, 0, "GaugeStyle");
- qmlRegisterType(QUrl(prefix + "/Base/HandleStyleHelper.qml"), uri, 1, 0, "HandleStyleHelper");
- qmlRegisterType(QUrl(prefix + "/Base/HandleStyle.qml"), uri, 1, 0, "HandleStyle");
- qmlRegisterType(QUrl(prefix + "/Base/PieMenuStyle.qml"), uri, 1, 0, "PieMenuStyle");
- qmlRegisterType(QUrl(prefix + "/Base/ToggleButtonStyle.qml"), uri, 1, 0, "ToggleButtonStyle");
- // register version 1.1
- qmlRegisterType(QUrl(prefix + "/Base/DialStyle.qml"), uri, 1, 1, "DialStyle");
- qmlRegisterType(QUrl(prefix + "/Base/StatusIndicatorStyle.qml"), uri, 1, 1, "StatusIndicatorStyle");
- // register version 1.2
- qmlRegisterType(QUrl(prefix + "/Base/TumblerStyle.qml"), uri, 1, 2, "TumblerStyle");
- // register version 1.3
- qmlRegisterType(QUrl(prefix + "/Base/PieMenuStyle.qml"), uri, 1, 3, "PieMenuStyle");
-}
-
-QT_END_NAMESPACE
diff --git a/src/extras/Styles/Base/basestyleplugin.h b/src/extras/Styles/Base/basestyleplugin.h
deleted file mode 100644
index 4f1fb6d1..00000000
--- a/src/extras/Styles/Base/basestyleplugin.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the Qt Quick Extras module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** 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 Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef STYLES_PLUGIN_H
-#define STYLES_PLUGIN_H
-
-#include <QtQml/qqmlextensionplugin.h>
-#include <QtQml/qqml.h>
-#include <QtQml/qqmlengine.h>
-
-QT_BEGIN_NAMESPACE
-
-class QtQuickExtrasStylesPlugin : public QQmlExtensionPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0")
-public:
- explicit QtQuickExtrasStylesPlugin(QObject *parent = 0);
-
- void registerTypes(const char *uri);
-};
-
-QT_END_NAMESPACE
-
-#endif // STYLES_PLUGIN_H
diff --git a/src/extras/Styles/Base/images/knob.png b/src/extras/Styles/Base/images/knob.png
deleted file mode 100644
index ecac4d09..00000000
--- a/src/extras/Styles/Base/images/knob.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/Styles/Base/images/needle.png b/src/extras/Styles/Base/images/needle.png
deleted file mode 100644
index 8237e516..00000000
--- a/src/extras/Styles/Base/images/needle.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/Styles/Base/qmldir b/src/extras/Styles/Base/qmldir
deleted file mode 100644
index 509cd05c..00000000
--- a/src/extras/Styles/Base/qmldir
+++ /dev/null
@@ -1,4 +0,0 @@
-module QtQuick.Extras.Styles
-plugin qtquickextrasstylesplugin
-classname QtQuickExtrasStylesPlugin
-depends QtGraphicalEffects 1.0
diff --git a/src/extras/Styles/Flat/ApplicationWindowStyle.qml b/src/extras/Styles/Flat/ApplicationWindowStyle.qml
index 8ae620b0..248e39d4 100644
--- a/src/extras/Styles/Flat/ApplicationWindowStyle.qml
+++ b/src/extras/Styles/Flat/ApplicationWindowStyle.qml
@@ -35,7 +35,7 @@
****************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.2
-import QtQuick.Controls.Styles 1.3 as Base
+import QtQuick.Controls.Styles 1.4 as Base
import QtQuick.Controls.Styles.Flat 1.0
Base.ApplicationWindowStyle {
diff --git a/src/extras/Styles/Flat/CalendarStyle.qml b/src/extras/Styles/Flat/CalendarStyle.qml
index b41e3c8e..7c42507a 100644
--- a/src/extras/Styles/Flat/CalendarStyle.qml
+++ b/src/extras/Styles/Flat/CalendarStyle.qml
@@ -39,7 +39,7 @@ import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2 as Base
import QtQuick.Controls.Styles.Flat 1.0
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
import QtQuick.Extras.Private.CppUtils 1.0
diff --git a/src/extras/Styles/Flat/CircularButtonStyle.qml b/src/extras/Styles/Flat/CircularButtonStyle.qml
index 774870e6..def48daa 100644
--- a/src/extras/Styles/Flat/CircularButtonStyle.qml
+++ b/src/extras/Styles/Flat/CircularButtonStyle.qml
@@ -33,6 +33,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQuick.Extras.Styles 1.3 as Base
+import QtQuick.Controls.Styles 1.4 as Base
Base.CircularButtonStyle { }
diff --git a/src/extras/Styles/Flat/CircularGaugeStyle.qml b/src/extras/Styles/Flat/CircularGaugeStyle.qml
index d18cdea5..cd6d7f1b 100644
--- a/src/extras/Styles/Flat/CircularGaugeStyle.qml
+++ b/src/extras/Styles/Flat/CircularGaugeStyle.qml
@@ -35,10 +35,10 @@
****************************************************************************/
import QtQuick 2.2
+import QtQuick.Controls.Styles 1.4 as Base
import QtQuick.Controls.Styles.Flat 1.0
import QtQuick.Extras.Private 1.0
import QtQuick.Extras.Private.CppUtils 1.1
-import QtQuick.Extras.Styles 1.3 as Base
Base.CircularGaugeStyle {
id: circularGaugeStyle
diff --git a/src/extras/Styles/Flat/CircularTickmarkLabelStyle.qml b/src/extras/Styles/Flat/CircularTickmarkLabelStyle.qml
index 8127608b..4e6649e7 100644
--- a/src/extras/Styles/Flat/CircularTickmarkLabelStyle.qml
+++ b/src/extras/Styles/Flat/CircularTickmarkLabelStyle.qml
@@ -34,6 +34,6 @@
**
****************************************************************************/
-import QtQuick.Extras.Styles 1.3 as Base
+import QtQuick.Controls.Styles 1.4 as Base
Base.CircularTickmarkLabelStyle {}
diff --git a/src/extras/Styles/Flat/DelayButtonStyle.qml b/src/extras/Styles/Flat/DelayButtonStyle.qml
index 2e438497..619cc19b 100644
--- a/src/extras/Styles/Flat/DelayButtonStyle.qml
+++ b/src/extras/Styles/Flat/DelayButtonStyle.qml
@@ -35,10 +35,10 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.1
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4 as Base
import QtQuick.Controls.Styles.Flat 1.0
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras.Styles 1.1 as Base
import QtQuick.Extras.Private 1.0
import QtQuick.Extras.Private.CppUtils 1.1
diff --git a/src/extras/Styles/Flat/DialStyle.qml b/src/extras/Styles/Flat/DialStyle.qml
index 3e841d9b..ebc53f0a 100644
--- a/src/extras/Styles/Flat/DialStyle.qml
+++ b/src/extras/Styles/Flat/DialStyle.qml
@@ -35,11 +35,11 @@
****************************************************************************/
import QtQuick 2.2
+import QtQuick.Controls.Styles 1.4 as Base
import QtQuick.Controls.Styles.Flat 1.0
-import QtQuick.Extras 1.3
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
import QtQuick.Extras.Private.CppUtils 1.1
-import QtQuick.Extras.Styles 1.3 as Base
Base.DialStyle {
id: dialStyle
diff --git a/src/extras/Styles/Flat/GaugeStyle.qml b/src/extras/Styles/Flat/GaugeStyle.qml
index d5bf986b..8378571b 100644
--- a/src/extras/Styles/Flat/GaugeStyle.qml
+++ b/src/extras/Styles/Flat/GaugeStyle.qml
@@ -35,9 +35,9 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.2
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4 as Base
import QtQuick.Controls.Styles.Flat 1.0
-import QtQuick.Extras.Styles 1.3 as Base
import QtQuick.Extras.Private 1.0
Base.GaugeStyle {
diff --git a/src/extras/Styles/Flat/PieMenuStyle.qml b/src/extras/Styles/Flat/PieMenuStyle.qml
index 9b314610..10d3fa28 100644
--- a/src/extras/Styles/Flat/PieMenuStyle.qml
+++ b/src/extras/Styles/Flat/PieMenuStyle.qml
@@ -35,8 +35,8 @@
****************************************************************************/
import QtQuick 2.3
+import QtQuick.Controls.Styles 1.4 as Base
import QtQuick.Controls.Styles.Flat 1.0
-import QtQuick.Extras.Styles 1.3 as Base
import QtQuick.Extras.Private 1.0
Base.PieMenuStyle {
diff --git a/src/extras/Styles/Flat/ProgressBarStyle.qml b/src/extras/Styles/Flat/ProgressBarStyle.qml
index f0b5bdd4..bf2b0ef6 100644
--- a/src/extras/Styles/Flat/ProgressBarStyle.qml
+++ b/src/extras/Styles/Flat/ProgressBarStyle.qml
@@ -39,7 +39,7 @@ import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2 as Base
import QtQuick.Controls.Styles.Flat 1.0
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private.CppUtils 1.1
Base.ProgressBarStyle {
diff --git a/src/extras/Styles/Flat/RadioButtonStyle.qml b/src/extras/Styles/Flat/RadioButtonStyle.qml
index 779e8636..5061697d 100644
--- a/src/extras/Styles/Flat/RadioButtonStyle.qml
+++ b/src/extras/Styles/Flat/RadioButtonStyle.qml
@@ -38,7 +38,7 @@ import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2 as Base
import QtQuick.Controls.Styles.Flat 1.0
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
+import QtQuick.Extras 1.4
Base.RadioButtonStyle {
spacing: Math.round(8 * FlatStyle.scaleFactor)
diff --git a/src/extras/Styles/Flat/SliderStyle.qml b/src/extras/Styles/Flat/SliderStyle.qml
index 191612c5..779ac1b6 100644
--- a/src/extras/Styles/Flat/SliderStyle.qml
+++ b/src/extras/Styles/Flat/SliderStyle.qml
@@ -39,7 +39,7 @@ import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2 as Base
import QtQuick.Controls.Styles.Flat 1.0
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
Base.SliderStyle {
diff --git a/src/extras/Styles/Flat/StatusIndicatorStyle.qml b/src/extras/Styles/Flat/StatusIndicatorStyle.qml
index fb527665..1c1c6bea 100644
--- a/src/extras/Styles/Flat/StatusIndicatorStyle.qml
+++ b/src/extras/Styles/Flat/StatusIndicatorStyle.qml
@@ -35,10 +35,10 @@
****************************************************************************/
import QtQuick 2.3
-import QtQuick.Controls 1.2
+import QtQuick.Controls 1.4
import QtQuick.Controls.Private 1.0
+import QtQuick.Controls.Styles 1.4 as Base
import QtQuick.Controls.Styles.Flat 1.0
-import QtQuick.Extras.Styles 1.3 as Base
import QtQuick.Extras.Private 1.0
import QtQuick.Extras.Private.CppUtils 1.0
diff --git a/src/extras/Styles/Flat/ToggleButtonStyle.qml b/src/extras/Styles/Flat/ToggleButtonStyle.qml
index 5cbb0a5d..8c5315af 100644
--- a/src/extras/Styles/Flat/ToggleButtonStyle.qml
+++ b/src/extras/Styles/Flat/ToggleButtonStyle.qml
@@ -35,12 +35,12 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.1
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4 as Base
import QtQuick.Controls.Styles.Flat 1.0
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
-import QtQuick.Extras.Styles 1.3 as Base
Base.ToggleButtonStyle {
label: Label {
diff --git a/src/extras/Styles/Flat/TumblerStyle.qml b/src/extras/Styles/Flat/TumblerStyle.qml
index cede9fee..3be7f6a0 100644
--- a/src/extras/Styles/Flat/TumblerStyle.qml
+++ b/src/extras/Styles/Flat/TumblerStyle.qml
@@ -35,10 +35,10 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.1
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4 as Base
import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles.Flat 1.0
-import QtQuick.Extras.Styles 1.3 as Base
Base.TumblerStyle {
id: tumblerStyle
diff --git a/src/extras/Styles/Flat/flatstyleplugin.cpp b/src/extras/Styles/Flat/flatstyleplugin.cpp
index e3bffd5c..db464c38 100644
--- a/src/extras/Styles/Flat/flatstyleplugin.cpp
+++ b/src/extras/Styles/Flat/flatstyleplugin.cpp
@@ -56,7 +56,7 @@ extern "C" {
Q_DECL_EXPORT const char* qt_quick_controls_style_path()
{
- return "qrc:/ExtrasImports/QtQuick/Controls/Styles/";
+ return ":/ExtrasImports/QtQuick/Controls/Styles/Flat";
}
}
diff --git a/src/extras/Styles/styles.pro b/src/extras/Styles/styles.pro
index 8f05bcd0..5e1a1633 100644
--- a/src/extras/Styles/styles.pro
+++ b/src/extras/Styles/styles.pro
@@ -1,4 +1,4 @@
TEMPLATE = subdirs
-SUBDIRS += Base \
+SUBDIRS += \
Flat
diff --git a/src/extras/ToggleButton.qml b/src/extras/ToggleButton.qml
index 8e0d313e..ca08e36f 100644
--- a/src/extras/ToggleButton.qml
+++ b/src/extras/ToggleButton.qml
@@ -35,15 +35,14 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.1
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
-import QtQuick.Extras.Private 1.0
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4
+import QtQuick.Controls.Private 1.0
/*!
\qmltype ToggleButton
\inqmlmodule QtQuick.Extras
- \since QtQuick.Extras 1.0
+ \since 5.5
\ingroup extras
\ingroup extras-interactive
\brief A push button that toggles between two states.
@@ -59,11 +58,11 @@ import QtQuick.Extras.Private 1.0
placing color-coded indicators around the button.
You can create a custom appearance for a ToggleButton by assigning a
- \l {QtQuick.Extras.Styles::}{ToggleButtonStyle}.
+ \l {QtQuick.Controls.Styles::}{ToggleButtonStyle}.
*/
Button {
id: button
checkable: true
- style: Qt.createComponent(StyleSettings.style + "/ToggleButtonStyle.qml", button)
+ style: Settings.styleComponent(Settings.style, "ToggleButtonStyle.qml", button)
}
diff --git a/src/extras/Tumbler.qml b/src/extras/Tumbler.qml
index cdf21c4d..561515b2 100644
--- a/src/extras/Tumbler.qml
+++ b/src/extras/Tumbler.qml
@@ -35,17 +35,17 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.0
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
-import QtQuick.Extras.Styles 1.3
import QtQuick.Layouts 1.0
/*!
\qmltype Tumbler
\inqmlmodule QtQuick.Extras
- \since QtQuick.Extras 1.2
+ \since 5.5
\ingroup extras
\ingroup extras-interactive
\brief A control that can have several spinnable wheels, each with items
@@ -53,7 +53,7 @@ import QtQuick.Layouts 1.0
\image tumbler.png A Tumbler
- \note Tumbler requires Qt 5.3.2 or later.
+ \note Tumbler requires Qt 5.5.0 or later.
The Tumbler control is used with one or more TumblerColumn items, which
define the content of each column:
@@ -67,7 +67,7 @@ import QtQuick.Layouts 1.0
model: [0, 1, 2, 3, 4]
}
TumblerColumn {
- model: ["A", "B", "C", "D", "E]
+ model: ["A", "B", "C", "D", "E"]
}
}
\endcode
@@ -122,13 +122,13 @@ import QtQuick.Layouts 1.0
\section1 Limitations
For technical reasons, the model count must be equal to or greater than
- \l {QtQuick.Extras.Styles::TumblerStyle}{visibleItemCount}
+ \l {QtQuick.Controls.Styles::TumblerStyle}{visibleItemCount}
plus one. The
- \l {QtQuick.Extras.Styles::TumblerStyle::}{visibleItemCount}
+ \l {QtQuick.Controls.Styles::TumblerStyle::}{visibleItemCount}
must also be an odd number.
You can create a custom appearance for a Tumbler by assigning a
- \l {QtQuick.Extras.Styles::}{TumblerStyle}. To style
+ \l {QtQuick.Controls.Styles::}{TumblerStyle}. To style
individual columns, use the \l {TumblerColumn::delegate}{delegate} and
\l {TumblerColumn::highlight}{highlight} properties of TumblerColumn.
*/
@@ -136,7 +136,7 @@ import QtQuick.Layouts 1.0
Control {
id: tumbler
- style: Qt.createComponent(StyleSettings.style + "/TumblerStyle.qml", tumbler)
+ style: Settings.styleComponent(Settings.style, "TumblerStyle.qml", tumbler)
ListModel {
id: columnModel
diff --git a/src/extras/TumblerColumn.qml b/src/extras/TumblerColumn.qml
index 95bcae85..481f0869 100644
--- a/src/extras/TumblerColumn.qml
+++ b/src/extras/TumblerColumn.qml
@@ -35,17 +35,17 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.2
+import QtQuick.Controls 1.4
import QtQuick.Controls.Private 1.0
/*!
\qmltype TumblerColumn
\inqmlmodule QtQuick.Extras
- \since QtQuick.Extras 1.2
+ \since 5.5
\ingroup extras
\brief A column within a tumbler.
- \note TumblerColumn requires Qt 5.3.2 or later.
+ \note TumblerColumn requires Qt 5.5.0 or later.
TumblerColumn represents a column within a tumbler, providing the interface
to define the items and width of each column.
@@ -64,7 +64,7 @@ import QtQuick.Controls.Private 1.0
\endcode
You can create a custom appearance for a Tumbler by assigning a
- \l {QtQuick.Extras.Styles::}{TumblerStyle}.
+ \l {QtQuick.Controls.Styles::}{TumblerStyle}.
*/
QtObject {
@@ -116,8 +116,8 @@ QtObject {
If set, this delegate will be used to display items in this column,
instead of the
- \l {QtQuick.Extras.Styles::TumblerStyle::delegate}{delegate}
- property in \l {QtQuick.Extras.Styles::}{TumblerStyle}.
+ \l {QtQuick.Controls.Styles::TumblerStyle::delegate}{delegate}
+ property in \l {QtQuick.Controls.Styles::}{TumblerStyle}.
The \l {Item::implicitHeight}{implicitHeight} property must be set,
and it must be the same for each delegate.
@@ -129,8 +129,8 @@ QtObject {
If set, this highlight will be used to display the highlight in this
column, instead of the
- \l {QtQuick.Extras.Styles::TumblerStyle::highlight}{highlight}
- property in \l {QtQuick.Extras.Styles::}{TumblerStyle}.
+ \l {QtQuick.Controls.Styles::TumblerStyle::highlight}{highlight}
+ property in \l {QtQuick.Controls.Styles::}{TumblerStyle}.
*/
property Component highlight
@@ -139,8 +139,8 @@ QtObject {
If set, this component will be used to display the foreground in this
column, instead of the
- \l {QtQuick.Extras.Styles::TumblerStyle::columnForeground}{columnForeground}
- property in \l {QtQuick.Extras.Styles::}{TumblerStyle}.
+ \l {QtQuick.Controls.Styles::TumblerStyle::columnForeground}{columnForeground}
+ property in \l {QtQuick.Controls.Styles::}{TumblerStyle}.
*/
property Component columnForeground
diff --git a/src/extras/doc/compat/qtquickextras.qdocconf b/src/extras/doc/compat/qtquickextras.qdocconf
deleted file mode 100644
index d36fd909..00000000
--- a/src/extras/doc/compat/qtquickextras.qdocconf
+++ /dev/null
@@ -1,5 +0,0 @@
-include(../qtquickextras-compat.qdocconf)
-
-# Workaround for qdoc not parsing relative include paths correctly
-exampledirs += ../../../../examples
-imagedirs += ../images
diff --git a/src/extras/doc/images/circulargauge-angles.png b/src/extras/doc/images/circulargauge-angles.png
deleted file mode 100644
index fb93bcaa..00000000
--- a/src/extras/doc/images/circulargauge-angles.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/circulargauge-needle-example-2.png b/src/extras/doc/images/circulargauge-needle-example-2.png
deleted file mode 100644
index a2b5f322..00000000
--- a/src/extras/doc/images/circulargauge-needle-example-2.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/circulargauge-needle.png b/src/extras/doc/images/circulargauge-needle.png
deleted file mode 100644
index b2780b41..00000000
--- a/src/extras/doc/images/circulargauge-needle.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/circulargauge-reversed.png b/src/extras/doc/images/circulargauge-reversed.png
deleted file mode 100644
index aeadfbcc..00000000
--- a/src/extras/doc/images/circulargauge-reversed.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/circulargauge-tickmark-indices-values.png b/src/extras/doc/images/circulargauge-tickmark-indices-values.png
deleted file mode 100644
index d117f483..00000000
--- a/src/extras/doc/images/circulargauge-tickmark-indices-values.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/gauge-minorTickmark-example.png b/src/extras/doc/images/gauge-minorTickmark-example.png
deleted file mode 100644
index 591120d6..00000000
--- a/src/extras/doc/images/gauge-minorTickmark-example.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/gauge-temperature.png b/src/extras/doc/images/gauge-temperature.png
deleted file mode 100644
index 95fc1679..00000000
--- a/src/extras/doc/images/gauge-temperature.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/gauge-tickmark-example.png b/src/extras/doc/images/gauge-tickmark-example.png
deleted file mode 100644
index c46fb8a5..00000000
--- a/src/extras/doc/images/gauge-tickmark-example.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/piemenu-menuitem-example.png b/src/extras/doc/images/piemenu-menuitem-example.png
deleted file mode 100644
index 57a2f956..00000000
--- a/src/extras/doc/images/piemenu-menuitem-example.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/styling-circulargauge-background-example.png b/src/extras/doc/images/styling-circulargauge-background-example.png
deleted file mode 100644
index e816c6f6..00000000
--- a/src/extras/doc/images/styling-circulargauge-background-example.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/styling-circulargauge-knob-example.png b/src/extras/doc/images/styling-circulargauge-knob-example.png
deleted file mode 100644
index 793a36c2..00000000
--- a/src/extras/doc/images/styling-circulargauge-knob-example.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/styling-circulargauge-minorTickmark-example.png b/src/extras/doc/images/styling-circulargauge-minorTickmark-example.png
deleted file mode 100644
index f3f2d8d7..00000000
--- a/src/extras/doc/images/styling-circulargauge-minorTickmark-example.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/styling-circulargauge-needle-example.png b/src/extras/doc/images/styling-circulargauge-needle-example.png
deleted file mode 100644
index 08049fc9..00000000
--- a/src/extras/doc/images/styling-circulargauge-needle-example.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/styling-circulargauge-tickmark-example.png b/src/extras/doc/images/styling-circulargauge-tickmark-example.png
deleted file mode 100644
index 01c71cd1..00000000
--- a/src/extras/doc/images/styling-circulargauge-tickmark-example.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/styling-circulargauge-tickmarkLabel-example.png b/src/extras/doc/images/styling-circulargauge-tickmarkLabel-example.png
deleted file mode 100644
index 7520827e..00000000
--- a/src/extras/doc/images/styling-circulargauge-tickmarkLabel-example.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/styling-gauge-font-size.png b/src/extras/doc/images/styling-gauge-font-size.png
deleted file mode 100644
index 97d7ebb2..00000000
--- a/src/extras/doc/images/styling-gauge-font-size.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/styling-gauge-foreground.png b/src/extras/doc/images/styling-gauge-foreground.png
deleted file mode 100644
index 5a4f65b9..00000000
--- a/src/extras/doc/images/styling-gauge-foreground.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/styling-gauge-minorTickmark.png b/src/extras/doc/images/styling-gauge-minorTickmark.png
deleted file mode 100644
index 34e36192..00000000
--- a/src/extras/doc/images/styling-gauge-minorTickmark.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/styling-gauge-tickmark.png b/src/extras/doc/images/styling-gauge-tickmark.png
deleted file mode 100644
index 1cd4fb8b..00000000
--- a/src/extras/doc/images/styling-gauge-tickmark.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/images/styling-gauge-valueBar.png b/src/extras/doc/images/styling-gauge-valueBar.png
deleted file mode 100644
index 581b8240..00000000
--- a/src/extras/doc/images/styling-gauge-valueBar.png
+++ /dev/null
Binary files differ
diff --git a/src/extras/doc/qtquickextras-compat.qdocconf b/src/extras/doc/qtquickextras-compat.qdocconf
deleted file mode 100644
index ad171f47..00000000
--- a/src/extras/doc/qtquickextras-compat.qdocconf
+++ /dev/null
@@ -1,17 +0,0 @@
-include($QT_INSTALL_DOCS/global/qt-defines.qdocconf)
-include($QT_INSTALL_DOCS/global/qt-cpp-ignore.qdocconf)
-
-naturallanguage = en_US
-outputencoding = UTF-8
-sourceencoding = UTF-8
-
-examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.qml *.css"
-examples.imageextensions = "*.png *.jpg *.gif"
-
-headers.fileextensions = "*.ch *.h *.h++ *.hh *.hpp *.hxx"
-sources.fileextensions = "*.c++ *.cc *.cpp *.cxx *.mm *.qml *.qdoc"
-
-#include the external websites
-sourcedirs += externalsites
-
-include(qtquickextras-project.qdocconf)
diff --git a/src/extras/doc/qtquickextras-project.qdocconf b/src/extras/doc/qtquickextras-project.qdocconf
deleted file mode 100644
index 0e0104c1..00000000
--- a/src/extras/doc/qtquickextras-project.qdocconf
+++ /dev/null
@@ -1,59 +0,0 @@
-include($QT_INSTALL_DOCS/global/macros.qdocconf)
-include($QT_INSTALL_DOCS/global/compat.qdocconf)
-#include($QT_INSTALL_DOCS/global/manifest-meta.qdocconf)
-include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf)
-
-project = QtQuickExtras
-description = Qt Quick Extras Reference Documentation
-url = http://doc.qt.digia.com/QtQuickExtras/
-version = 1.3
-
-qhp.projects = QtQuickExtras
-
-qhp.QtQuickExtras.file = qtquickextras.qhp
-qhp.QtQuickExtras.namespace = org.qt-project.qtquickextras.1.3
-qhp.QtQuickExtras.virtualFolder = qtquickextras
-qhp.QtQuickExtras.indexTitle = Qt Quick Extras
-qhp.QtQuickExtras.indexRoot =
-#qhp.QtQuickExtras.extraFiles = style/qtquickextras.css
-
-qhp.QtQuickExtras.filterAttributes = qtquickextras 1.3 qtrefdoc
-qhp.QtQuickExtras.customFilters.Qt.name = QtQuickExtras 1.3
-qhp.QtQuickExtras.customFilters.Qt.filterAttributes = qtquickextras 1.3
-
-qhp.QtQuickExtras.subprojects = qtquickextrasstyles
-
-qhp.QtQuickExtras.subprojects.qtquickextrasqmltypes.title = Controls QML Types
-qhp.QtQuickExtras.subprojects.qtquickextrasqmltypes.indexTitle = Qt Quick Controls QML Types
-qhp.QtQuickExtras.subprojects.qtquickextrasqmltypes.selectors = fake:qmlclass # cannot choose qmltypes from a specific group QTBUG-32985
-qhp.QtQuickExtras.subprojects.qtquickextrasqmltypes.sortPages = true
-
-qhp.QtQuickExtras.subprojects.qtquickextrasstyles.title = Qt Quick Extras Styles Structure
-qhp.QtQuickExtras.subprojects.qtquickextrasstyles.indexTitle = Qt Quick Extras Styles Structure
-qhp.QtQuickExtras.subprojects.qtquickextrasstyles.type = manual
-
-# QTBUG-35596: If you're using a shadow build of Qt >= 5.3.1, then uncomment the following line and comment out indexes += ...
-#depends = qtqml qtquick qtdoc qtquickcontrols
-indexes += $QT_INSTALL_DOCS/qtqml/qtqml.index \
- $QT_INSTALL_DOCS/qtquick/qtquick.index \
- $QT_INSTALL_DOCS/qtdoc/qtdoc.index \
- $QT_INSTALL_DOCS/qtquickcontrols/qtquickcontrols.index
-
-# Specify the install path under QT_INSTALL_EXAMPLES
-# Examples will be installed under quick/extras -
-# 'extras' subdirectory is given as part of \example commands
-exampledirs += ../../../examples/quick \
- snippets
-examplesinstallpath = quick
-
-headerdirs += ../
-
-sourcedirs += ../
-
-#sources += ../Private/<stuff> \
-
-imagedirs += images
-
-navigation.landingpage = "Qt Quick Extras"
-navigation.qmltypespage = "Qt Quick Extras QML Types"
-buildversion = "Qt Quick Extras 1.3"
diff --git a/src/extras/doc/qtquickextras.qdocconf b/src/extras/doc/qtquickextras.qdocconf
index 10117442..f65630f9 100644
--- a/src/extras/doc/qtquickextras.qdocconf
+++ b/src/extras/doc/qtquickextras.qdocconf
@@ -1,4 +1,45 @@
-include($QT_INSTALL_DOCS/global/qt-cpp-defines.qdocconf)
-include($QT_INSTALL_DOCS/global/fileextensions.qdocconf)
+include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
+
+project = QtQuickExtras
+description = Qt Quick Extras Reference Documentation
+version = $QT_VERSION
+
+qhp.projects = QtQuickExtras
+
+qhp.QtQuickExtras.file = qtquickextras.qhp
+qhp.QtQuickExtras.namespace = org.qt-project.qtquickextras.$QT_VERSION_TAG
+qhp.QtQuickExtras.virtualFolder = qtquickextras
+qhp.QtQuickExtras.indexTitle = Qt Quick Extras
+qhp.QtQuickExtras.indexRoot =
+
+qhp.QtQuickExtras.filterAttributes = qtquickextras $QT_VERSION qtrefdoc
+qhp.QtQuickExtras.customFilters.Qt.name = QtQuickExtras $QT_VERSION
+qhp.QtQuickExtras.customFilters.Qt.filterAttributes = qtquickextras $QT_VERSION
+
+qhp.QtQuickExtras.subprojects = qtquickextrasqmltypes qtquickextrasexamples
+qhp.QtQuickExtras.subprojects.qtquickextrasqmltypes.title = Extras QML Types
+qhp.QtQuickExtras.subprojects.qtquickextrasqmltypes.indexTitle = Qt Quick Extras QML Types
+qhp.QtQuickExtras.subprojects.qtquickextrasqmltypes.selectors = qmlclass
+qhp.QtQuickExtras.subprojects.qtquickextrasqmltypes.sortPages = true
+
+qhp.QtQuickExtras.subprojects.qtquickextrasexamples.title = Extras Examples
+qhp.QtQuickExtras.subprojects.qtquickextrasexamples.indexTitle = Qt Quick Extras Examples
+qhp.QtQuickExtras.subprojects.qtquickextrasexamples.selectors = fake:example
+qhp.QtQuickExtras.subprojects.qtquickextrasexamples.sortPages = true
+
+depends = qtqml qtquick qtdoc qtquickcontrols
+
+exampledirs += ../../../examples/quick/extras
+examplesinstallpath = quick/extras
+
+headerdirs += ../
+
+sourcedirs += ../
+
+#sources += ../Private/<stuff> \
+
+imagedirs += images
+
+navigation.landingpage = "Qt Quick Extras"
+navigation.qmltypespage = "Qt Quick Extras QML Types"
-include(qtquickextras-project.qdocconf)
diff --git a/src/extras/doc/snippets/circulargauge-background-range.qml b/src/extras/doc/snippets/circulargauge-background-range.qml
deleted file mode 100644
index 619fc465..00000000
--- a/src/extras/doc/snippets/circulargauge-background-range.qml
+++ /dev/null
@@ -1,121 +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$
-**
-****************************************************************************/
-
-//! [range]
-import QtQuick 2.0
-import QtQuick.Controls 1.1
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
-import QtQuick.Extras.Private 1.0
-
-Rectangle {
- width: 300
- height: 300
- color: "#494d53"
-
- CircularGauge {
- id: gauge
- anchors.centerIn: parent
- style: CircularGaugeStyle {
- id: style
-
- //! [background]
- function degreesToRadians(degrees) {
- return degrees * (Math.PI / 180);
- }
-
-
- background: Canvas {
- onPaint: {
- var ctx = getContext("2d");
- ctx.reset();
-
- ctx.beginPath();
- ctx.strokeStyle = "#e34c22";
- ctx.lineWidth = outerRadius * 0.02;
-
- ctx.arc(outerRadius, outerRadius, outerRadius - ctx.lineWidth / 2,
- degreesToRadians(valueToAngle(80) - 90), degreesToRadians(valueToAngle(100) - 90));
- ctx.stroke();
- }
- }
- //! [background]
-
- //! [tickmark]
- tickmark: Rectangle {
- visible: styleData.value < 80 || styleData.value % 10 == 0
- implicitWidth: outerRadius * 0.02
- antialiasing: true
- implicitHeight: outerRadius * 0.06
- color: styleData.value >= 80 ? "#e34c22" : "#e5e5e5"
- }
- //! [tickmark]
-
- //! [minorTickmark]
- minorTickmark: Rectangle {
- visible: styleData.value < 80
- implicitWidth: outerRadius * 0.01
- antialiasing: true
- implicitHeight: outerRadius * 0.03
- color: "#e5e5e5"
- }
- //! [minorTickmark]
-
- //! [tickmarkLabel]
- tickmarkLabel: Text {
- font.pixelSize: Math.max(6, outerRadius * 0.1)
- text: styleData.value
- color: styleData.value >= 80 ? "#e34c22" : "#e5e5e5"
- antialiasing: true
- }
- //! [tickmarkLabel]
-
- //! [needle]
- needle: Rectangle {
- y: outerRadius * 0.15
- implicitWidth: outerRadius * 0.03
- implicitHeight: outerRadius * 0.9
- antialiasing: true
- color: "#e5e5e5"
- }
- //! [needle]
-
- //! [foreground]
- foreground: Item {
- Rectangle {
- width: outerRadius * 0.2
- height: width
- radius: width / 2
- color: "#e5e5e5"
- anchors.centerIn: parent
- }
- }
- //! [foreground]
- }
- }
-}
-//! [range]
diff --git a/src/extras/doc/snippets/circulargauge-tickmark-indices-values.qml b/src/extras/doc/snippets/circulargauge-tickmark-indices-values.qml
deleted file mode 100644
index 33781baa..00000000
--- a/src/extras/doc/snippets/circulargauge-tickmark-indices-values.qml
+++ /dev/null
@@ -1,85 +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$
-**
-****************************************************************************/
-
-//! [tickmarks]
-import QtQuick 2.0
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
-
-Rectangle {
- width: 400
- height: 400
-
- CircularGauge {
- id: gauge
- anchors.fill: parent
- style: CircularGaugeStyle {
- labelInset: outerRadius * 0.2
-
- tickmarkLabel: null
-
- tickmark: Text {
- text: styleData.value
-
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.bottom
- text: styleData.index
- color: "blue"
- }
- }
-
- minorTickmark: Text {
- text: styleData.value
- font.pixelSize: 8
-
- Text {
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.bottom
- text: styleData.index
- font.pixelSize: 8
- color: "blue"
- }
- }
- }
-
- Text {
- id: indexText
- text: "Major and minor indices"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: valueText.top
- color: "blue"
- }
- Text {
- id: valueText
- text: "Major and minor values"
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom
- }
- }
-}
-//! [tickmarks]
diff --git a/src/extras/doc/snippets/styling-gauge.qml b/src/extras/doc/snippets/styling-gauge.qml
deleted file mode 100644
index 48cb95ed..00000000
--- a/src/extras/doc/snippets/styling-gauge.qml
+++ /dev/null
@@ -1,93 +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$
-**
-****************************************************************************/
-
-//! [all]
-import QtQuick 2.2
-import QtQuick.Controls 1.1
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
-
-Rectangle {
- width: 100
- height: 220
- color: "#494d53"
-
- Gauge {
- value: 50
- tickmarkStepSize: 20
- minorTickmarkCount: 1
- //! [font-size]
- font.pixelSize: 15
- //! [font-size]
- anchors.centerIn: parent
- anchors.horizontalCenterOffset: -4
-
- style: GaugeStyle {
- //! [valueBar]
- valueBar: Rectangle {
- color: "#e34c22"
- implicitWidth: 28
- }
- //! [valueBar]
-
- //! [foreground]
- foreground: null
- //! [foreground]
-
- //! [tickmark]
- tickmark: Item {
- implicitWidth: 8
- implicitHeight: 4
-
- Rectangle {
- x: control.tickmarkAlignment === Qt.AlignLeft
- || control.tickmarkAlignment === Qt.AlignTop ? parent.implicitWidth : -28
- width: 28
- height: parent.height
- color: "#ffffff"
- }
- }
- //! [tickmark]
-
- //! [minorTickmark]
- minorTickmark: Item {
- implicitWidth: 8
- implicitHeight: 2
-
- Rectangle {
- x: control.tickmarkAlignment === Qt.AlignLeft
- || control.tickmarkAlignment === Qt.AlignTop ? parent.implicitWidth : -28
- width: 28
- height: parent.height
- color: "#ffffff"
- }
- }
- //! [minorTickmark]
- }
- }
-}
-//! [all]
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
-*/
-
diff --git a/src/extras/extras.pro b/src/extras/extras.pro
index cc2d2958..2ebd8f81 100644
--- a/src/extras/extras.pro
+++ b/src/extras/extras.pro
@@ -1,6 +1,6 @@
TARGET = qtquickextrasplugin
TARGETPATH = QtQuick/Extras
-IMPORT_VERSION = 1.3
+IMPORT_VERSION = 1.4
QT += qml
diff --git a/src/extras/plugin.cpp b/src/extras/plugin.cpp
index 7ac942bd..87455eb1 100644
--- a/src/extras/plugin.cpp
+++ b/src/extras/plugin.cpp
@@ -43,7 +43,6 @@
#include "Private/qquickcircularprogressbar_p.h"
#include "Private/qquickflatprogressbar_p.h"
#include "Private/qquickmousethief_p.h"
-#include "Private/qquickstylesettings_p.h"
#include "Private/qquickmathutils_p.h"
QT_BEGIN_NAMESPACE
@@ -83,7 +82,7 @@ void QtQuickExtrasPlugin::registerTypes(const char *uri)
// register 1.3
qmlRegisterUncreatableType<QQuickTriggerMode>(uri, 1, 3, "TriggerMode", QLatin1String("Do not create objects of type TriggerMode"));
// register 1.4
- qmlRegisterType<QQuickPicture>(uri, 1, /*TODO: 4*/3, "Picture");
+ qmlRegisterType<QQuickPicture>(uri, 1, 4, "Picture");
}
void QtQuickExtrasPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
@@ -93,7 +92,6 @@ void QtQuickExtrasPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
qmlRegisterType<QQuickMouseThief>("QtQuick.Extras.Private.CppUtils", 1, 0, "MouseThief");
qmlRegisterType<QQuickCircularProgressBar>("QtQuick.Extras.Private.CppUtils", 1, 1, "CircularProgressBar");
qmlRegisterType<QQuickFlatProgressBar>("QtQuick.Extras.Private.CppUtils", 1, 1, "FlatProgressBar");
- qmlRegisterSingletonType<QQuickStyleSettings>("QtQuick.Extras.Private", 1, 0, "StyleSettings", registerSettingsModule);
qmlRegisterSingletonType<QQuickMathUtils>("QtQuick.Extras.Private.CppUtils", 1, 0, "MathUtils", registerMathUtilsSingleton);
const QString prefix = "qrc:///ExtrasImports/QtQuick/Extras";
@@ -106,11 +104,4 @@ void QtQuickExtrasPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
qmlRegisterSingletonType(QUrl(prefix + "/Private/TextSingleton.qml"), private_uri, 1, 0, "TextSingleton");
}
-QObject *QtQuickExtrasPlugin::registerSettingsModule(QQmlEngine *engine, QJSEngine *jsEngine)
-{
- Q_UNUSED(engine);
- Q_UNUSED(jsEngine);
- return new QQuickStyleSettings(engine);
-}
-
QT_END_NAMESPACE
diff --git a/src/extras/plugin.h b/src/extras/plugin.h
index c613739f..08eae1c1 100644
--- a/src/extras/plugin.h
+++ b/src/extras/plugin.h
@@ -52,8 +52,6 @@ public:
void registerTypes(const char *uri);
void initializeEngine(QQmlEngine *engine, const char *uri);
-private:
- static QObject *registerSettingsModule(QQmlEngine *engine, QJSEngine *jsEngine);
};
QT_END_NAMESPACE
diff --git a/src/extras/qmldir b/src/extras/qmldir
index 8cf21310..030a7c2c 100644
--- a/src/extras/qmldir
+++ b/src/extras/qmldir
@@ -2,3 +2,5 @@ module QtQuick.Extras
plugin qtquickextrasplugin
classname QtQuickExtrasPlugin
#typeinfo plugins.qmltypes
+
+depends QtGraphicalEffects 1.0
diff --git a/src/extras/qquickpicture.cpp b/src/extras/qquickpicture.cpp
index fd8846a2..21747ee4 100644
--- a/src/extras/qquickpicture.cpp
+++ b/src/extras/qquickpicture.cpp
@@ -45,12 +45,25 @@
\since QtQuick.Extras 1.4
\ingroup extras
\ingroup extras-non-interactive
- \brief An indicator that displays a colorized ISO 7000 icon
+ \brief An indicator that displays a colorized QPicture icon
Picture displays icons in a scalable vector format. It can also colorize
the icons via the \l color property.
The icon to display is set with the \l source property.
+
+ For example, if you have access to the ISO 7000 icons that come with Qt
+ Enterprise, you can specify the following URL:
+
+ \code
+ "qrc:/iso-icons/iso_grs_7000_4_0001.dat"
+ \endcode
+
+ Due to the
+ \l {http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=65977}
+ {large selection of icons} available in this package, it is advisable to
+ use Qt Creator's Qt Quick Designer tool to browse and select icons, as this
+ property will then be set automatically.
*/
QQuickPicture::QQuickPicture(QQuickItem *parent)
@@ -85,23 +98,7 @@ void QQuickPicture::paint(QPainter *painter)
\qmlproperty url Picture::source
This property specifies the URL of the icon to use. The URL must point to a
- local file that contains \l QPicture data.
-
- For example, if you have the \l <NewControlName> from \l
- <NewEnterpriseControlsName>, you can specify the following URL:
-
- \code
- "qrc:/iso-icons/iso_grs_7000_4_0001.dat"
- \endcode
-
- Due to the
- \l {http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=65977}
- {large selection of icons} available in this package, it is advisable to
- use Qt Creator's Qt Quick Designer tool to browse and select icons, as this
- property will then be set automatically.
-
- If you have your own picture that you'd like to display, you can set the
- following URL:
+ local file that contains \l QPicture data. For example:
\code
"mypicture.dat"