summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2015-02-17 13:53:44 +0100
committerCaroline Chao <caroline.chao@theqtcompany.com>2015-03-02 13:52:13 +0000
commitf0c227f8a9a5c5e3ed83f86702626092457175aa (patch)
tree9d5903b76206906a7dc5abff7a8c06bfcfc3f129 /src
parentb80076c53c045076afdba44a975a533d130a7b60 (diff)
downloadqtquickcontrols-f0c227f8a9a5c5e3ed83f86702626092457175aa.tar.gz
Merge Extras' styling system into Controls'.
- Removes the duplicated style settings functionality in Extras and simplifies the installed styles directory structure. - Extras' Base style is now part of Controls' Base style, eliminating the need for a separate QtQuick.Extras.Styles import. The cost of doing this should be negligible: a few QML files and two images. If we didn't merge Extras' Baste style into Controls', we'd need extras-specific code in qquickcontrolssettings, as the default style search path is: qml/QtQuick/Controls/Styles/ Whereas the Extras Base style would be in: qml/QtQuick/Extras/Styles/ The Extras Base style can't go into Controls' Base style directory, either, because otherwise we'd have two qmldir files there. The Flat style doesn't have this problem because it is all contained in one plugin and gets installed into its own Flat/ folder. - Documentation now lists the Extras controls as \since QtQuick.Extras 1.4. - Adds the customcontrolsstyle auto test to ensure that custom styling is tested. Change-Id: I19ca7a8b7e1c1daa85b272f4ccf9a2f05c76e0d9 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com> Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/controls/ApplicationWindow.qml2
-rw-r--r--src/controls/BusyIndicator.qml2
-rw-r--r--src/controls/Button.qml2
-rw-r--r--src/controls/Calendar.qml2
-rw-r--r--src/controls/CheckBox.qml2
-rw-r--r--src/controls/ComboBox.qml2
-rw-r--r--src/controls/GroupBox.qml2
-rw-r--r--src/controls/Menu.qml2
-rw-r--r--src/controls/MenuBar.qml2
-rw-r--r--src/controls/Private/FocusFrame.qml2
-rw-r--r--src/controls/Private/qquickcontrolsettings.cpp190
-rw-r--r--src/controls/Private/qquickcontrolsettings_p.h19
-rw-r--r--src/controls/ProgressBar.qml2
-rw-r--r--src/controls/RadioButton.qml2
-rw-r--r--src/controls/ScrollView.qml2
-rw-r--r--src/controls/Slider.qml2
-rw-r--r--src/controls/SpinBox.qml2
-rw-r--r--src/controls/StatusBar.qml2
-rw-r--r--src/controls/Styles/Base/CircularButtonStyle.qml (renamed from src/extras/Styles/Base/CircularButtonStyle.qml)3
-rw-r--r--src/controls/Styles/Base/CircularGaugeStyle.qml (renamed from src/extras/Styles/Base/CircularGaugeStyle.qml)16
-rw-r--r--src/controls/Styles/Base/CircularTickmarkLabelStyle.qml (renamed from src/extras/Styles/Base/CircularTickmarkLabelStyle.qml)0
-rw-r--r--src/controls/Styles/Base/CommonStyleHelper.qml (renamed from src/extras/Styles/Base/CommonStyleHelper.qml)0
-rw-r--r--src/controls/Styles/Base/DelayButtonStyle.qml (renamed from src/extras/Styles/Base/DelayButtonStyle.qml)13
-rw-r--r--src/controls/Styles/Base/DialStyle.qml (renamed from src/extras/Styles/Base/DialStyle.qml)44
-rw-r--r--src/controls/Styles/Base/GaugeStyle.qml (renamed from src/extras/Styles/Base/GaugeStyle.qml)22
-rw-r--r--src/controls/Styles/Base/HandleStyle.qml (renamed from src/extras/Styles/Base/HandleStyle.qml)2
-rw-r--r--src/controls/Styles/Base/HandleStyleHelper.qml (renamed from src/extras/Styles/Base/HandleStyleHelper.qml)0
-rw-r--r--src/controls/Styles/Base/PieMenuStyle.qml (renamed from src/extras/Styles/Base/PieMenuStyle.qml)17
-rw-r--r--src/controls/Styles/Base/StatusIndicatorStyle.qml (renamed from src/extras/Styles/Base/StatusIndicatorStyle.qml)12
-rw-r--r--src/controls/Styles/Base/ToggleButtonStyle.qml (renamed from src/extras/Styles/Base/ToggleButtonStyle.qml)13
-rw-r--r--src/controls/Styles/Base/TumblerStyle.qml (renamed from src/extras/Styles/Base/TumblerStyle.qml)14
-rw-r--r--src/controls/Styles/Base/images/knob.png (renamed from src/extras/Styles/Base/images/knob.png)bin5495 -> 5495 bytes
-rw-r--r--src/controls/Styles/Base/images/needle.png (renamed from src/extras/Styles/Base/images/needle.png)bin4354 -> 4354 bytes
-rw-r--r--src/controls/Styles/qmldir15
-rw-r--r--src/controls/Styles/styles.pri20
-rw-r--r--src/controls/Switch.qml2
-rw-r--r--src/controls/TabView.qml2
-rw-r--r--src/controls/TableView.qml2
-rw-r--r--src/controls/TextArea.qml2
-rw-r--r--src/controls/TextField.qml2
-rw-r--r--src/controls/ToolBar.qml2
-rw-r--r--src/controls/ToolButton.qml2
-rw-r--r--src/controls/TreeView.qml2
-rw-r--r--src/controls/controls.pro2
-rw-r--r--src/controls/doc/images/circulargauge-angles.png (renamed from src/extras/doc/images/circulargauge-angles.png)bin19719 -> 19719 bytes
-rw-r--r--src/controls/doc/images/circulargauge-needle-example-2.png (renamed from src/extras/doc/images/circulargauge-needle-example-2.png)bin12680 -> 12680 bytes
-rw-r--r--src/controls/doc/images/circulargauge-needle.png (renamed from src/extras/doc/images/circulargauge-needle.png)bin1561 -> 1561 bytes
-rw-r--r--src/controls/doc/images/circulargauge-reversed.png (renamed from src/extras/doc/images/circulargauge-reversed.png)bin21836 -> 21836 bytes
-rw-r--r--src/controls/doc/images/circulargauge-tickmark-indices-values.png (renamed from src/extras/doc/images/circulargauge-tickmark-indices-values.png)bin40132 -> 40132 bytes
-rw-r--r--src/controls/doc/images/gauge-minorTickmark-example.png (renamed from src/extras/doc/images/gauge-minorTickmark-example.png)bin4780 -> 4780 bytes
-rw-r--r--src/controls/doc/images/gauge-temperature.png (renamed from src/extras/doc/images/gauge-temperature.png)bin6055 -> 6055 bytes
-rw-r--r--src/controls/doc/images/gauge-tickmark-example.png (renamed from src/extras/doc/images/gauge-tickmark-example.png)bin4882 -> 4882 bytes
-rw-r--r--src/controls/doc/images/piemenu-menuitem-example.png (renamed from src/extras/doc/images/piemenu-menuitem-example.png)bin10606 -> 10606 bytes
-rw-r--r--src/controls/doc/images/styling-circulargauge-background-example.png (renamed from src/extras/doc/images/styling-circulargauge-background-example.png)bin13071 -> 13071 bytes
-rw-r--r--src/controls/doc/images/styling-circulargauge-knob-example.png (renamed from src/extras/doc/images/styling-circulargauge-knob-example.png)bin13209 -> 13209 bytes
-rw-r--r--src/controls/doc/images/styling-circulargauge-minorTickmark-example.png (renamed from src/extras/doc/images/styling-circulargauge-minorTickmark-example.png)bin11770 -> 11770 bytes
-rw-r--r--src/controls/doc/images/styling-circulargauge-needle-example.png (renamed from src/extras/doc/images/styling-circulargauge-needle-example.png)bin13472 -> 13472 bytes
-rw-r--r--src/controls/doc/images/styling-circulargauge-tickmark-example.png (renamed from src/extras/doc/images/styling-circulargauge-tickmark-example.png)bin12179 -> 12179 bytes
-rw-r--r--src/controls/doc/images/styling-circulargauge-tickmarkLabel-example.png (renamed from src/extras/doc/images/styling-circulargauge-tickmarkLabel-example.png)bin12171 -> 12171 bytes
-rw-r--r--src/controls/doc/images/styling-gauge-font-size.png (renamed from src/extras/doc/images/styling-gauge-font-size.png)bin4410 -> 4410 bytes
-rw-r--r--src/controls/doc/images/styling-gauge-foreground.png (renamed from src/extras/doc/images/styling-gauge-foreground.png)bin3557 -> 3557 bytes
-rw-r--r--src/controls/doc/images/styling-gauge-minorTickmark.png (renamed from src/extras/doc/images/styling-gauge-minorTickmark.png)bin3527 -> 3527 bytes
-rw-r--r--src/controls/doc/images/styling-gauge-tickmark.png (renamed from src/extras/doc/images/styling-gauge-tickmark.png)bin3547 -> 3547 bytes
-rw-r--r--src/controls/doc/images/styling-gauge-valueBar.png (renamed from src/extras/doc/images/styling-gauge-valueBar.png)bin3691 -> 3691 bytes
-rw-r--r--src/controls/doc/qtquickcontrols.qdocconf8
-rw-r--r--src/controls/doc/snippets/circulargauge-background-range.qml (renamed from src/extras/doc/snippets/circulargauge-background-range.qml)6
-rw-r--r--src/controls/doc/snippets/circulargauge-tickmark-indices-values.qml (renamed from src/extras/doc/snippets/circulargauge-tickmark-indices-values.qml)4
-rw-r--r--src/controls/doc/snippets/styling-gauge.qml (renamed from src/extras/doc/snippets/styling-gauge.qml)6
-rw-r--r--src/controls/doc/src/qtquickcontrolsstyles-index.qdoc41
-rw-r--r--src/controls/doc/src/styling-circulargauge.qdoc (renamed from src/extras/doc/src/styling-circulargauge.qdoc)12
-rw-r--r--src/controls/doc/src/styling-gauge.qdoc (renamed from src/extras/doc/src/styling-gauge.qdoc)10
-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/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/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/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/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/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
123 files changed, 525 insertions, 997 deletions
diff --git a/src/controls/ApplicationWindow.qml b/src/controls/ApplicationWindow.qml
index 51e08316..542cfe4e 100644
--- a/src/controls/ApplicationWindow.qml
+++ b/src/controls/ApplicationWindow.qml
@@ -145,7 +145,7 @@ Window {
/*! The style Component for the window.
\sa {Qt Quick Controls Styles QML Types}
*/
- property Component style: Qt.createComponent(Settings.style + "/ApplicationWindowStyle.qml", root)
+ property Component style: Settings.styleComponent(Settings.style, "ApplicationWindowStyle.qml", root)
/*! \internal */
property alias __style: styleLoader.item
diff --git a/src/controls/BusyIndicator.qml b/src/controls/BusyIndicator.qml
index 4922ecd0..fbd6d665 100644
--- a/src/controls/BusyIndicator.qml
+++ b/src/controls/BusyIndicator.qml
@@ -78,5 +78,5 @@ Control {
Accessible.role: Accessible.Indicator
Accessible.name: "busy"
- style: Qt.createComponent(Settings.style + "/BusyIndicatorStyle.qml", indicator)
+ style: Settings.styleComponent(Settings.style, "BusyIndicatorStyle.qml", indicator)
}
diff --git a/src/controls/Button.qml b/src/controls/Button.qml
index 00ccfa4e..6daf595c 100644
--- a/src/controls/Button.qml
+++ b/src/controls/Button.qml
@@ -88,7 +88,7 @@ BasicButton {
Accessible.name: text
- style: Qt.createComponent(Settings.style + "/ButtonStyle.qml", button)
+ style: Settings.styleComponent(Settings.style, "ButtonStyle.qml", button)
Binding {
target: menu
diff --git a/src/controls/Calendar.qml b/src/controls/Calendar.qml
index ba40893a..f6a779db 100644
--- a/src/controls/Calendar.qml
+++ b/src/controls/Calendar.qml
@@ -218,7 +218,7 @@ Control {
visibleDate: new Date(visibleYear, visibleMonth, 1)
}
- style: Qt.createComponent(Settings.style + "/CalendarStyle.qml", calendar)
+ style: Settings.styleComponent(Settings.style, "CalendarStyle.qml", calendar)
/*!
\qmlsignal Calendar::hovered(date date)
diff --git a/src/controls/CheckBox.qml b/src/controls/CheckBox.qml
index 0d27c1ac..b5df8846 100644
--- a/src/controls/CheckBox.qml
+++ b/src/controls/CheckBox.qml
@@ -139,7 +139,7 @@ AbstractCheckable {
*/
property bool __ignoreCheckedState: false
- style: Qt.createComponent(Settings.style + "/CheckBoxStyle.qml", checkBox)
+ style: Settings.styleComponent(Settings.style, "CheckBoxStyle.qml", checkBox)
activeFocusOnTab: true
diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml
index f0067822..81d56030 100644
--- a/src/controls/ComboBox.qml
+++ b/src/controls/ComboBox.qml
@@ -332,7 +332,7 @@ Control {
/*! \internal */
property var __popup: popup
- style: Qt.createComponent(Settings.style + "/ComboBoxStyle.qml", comboBox)
+ style: Settings.styleComponent(Settings.style, "ComboBoxStyle.qml", comboBox)
activeFocusOnTab: true
diff --git a/src/controls/GroupBox.qml b/src/controls/GroupBox.qml
index f51ac757..99d520fe 100644
--- a/src/controls/GroupBox.qml
+++ b/src/controls/GroupBox.qml
@@ -154,7 +154,7 @@ FocusScope {
readonly property alias contentItem: container
/*! \internal */
- property Component style: Qt.createComponent(Settings.style + "/GroupBoxStyle.qml", groupbox)
+ property Component style: Settings.styleComponent(Settings.style, "GroupBoxStyle.qml", groupbox)
/*! \internal */
property alias __checkbox: check
diff --git a/src/controls/Menu.qml b/src/controls/Menu.qml
index 2ab229ab..17b27977 100644
--- a/src/controls/Menu.qml
+++ b/src/controls/Menu.qml
@@ -132,7 +132,7 @@ MenuPrivate {
Component.onCompleted: {
if (!style) {
__usingDefaultStyle = true
- style = Qt.binding(function() { return Qt.createComponent(Settings.style + "/MenuStyle.qml", root) })
+ style = Qt.binding(function() { return Settings.styleComponent(Settings.style, "MenuStyle.qml", root) })
}
}
diff --git a/src/controls/MenuBar.qml b/src/controls/MenuBar.qml
index 5f444dac..0c0a2004 100644
--- a/src/controls/MenuBar.qml
+++ b/src/controls/MenuBar.qml
@@ -77,7 +77,7 @@ import QtQuick.Controls.Private 1.0
MenuBarPrivate {
id: root
- property Component style: Qt.createComponent(Settings.style + "/MenuBarStyle.qml", root)
+ property Component style: Settings.styleComponent(Settings.style, "MenuBarStyle.qml", root)
/*! \internal */
property QtObject __style: styleLoader.item
diff --git a/src/controls/Private/FocusFrame.qml b/src/controls/Private/FocusFrame.qml
index d1205708..66090038 100644
--- a/src/controls/Private/FocusFrame.qml
+++ b/src/controls/Private/FocusFrame.qml
@@ -59,6 +59,6 @@ Item {
id: loader
z: 2
anchors.fill: parent
- sourceComponent: Qt.createComponent(Settings.style + "/FocusFrameStyle.qml", root)
+ sourceComponent: Settings.styleComponent(Settings.style, "FocusFrameStyle.qml", root)
}
}
diff --git a/src/controls/Private/qquickcontrolsettings.cpp b/src/controls/Private/qquickcontrolsettings.cpp
index 017a0714..c000a658 100644
--- a/src/controls/Private/qquickcontrolsettings.cpp
+++ b/src/controls/Private/qquickcontrolsettings.cpp
@@ -106,6 +106,57 @@ bool QQuickControlSettings::hoverEnabled() const
return !isMobile() || !hasTouchScreen();
}
+QString QQuickControlSettings::makeStyleComponentPath(const QString &controlStyleName, const QString &styleDirPath)
+{
+ return styleDirPath + QStringLiteral("/") + controlStyleName;
+}
+
+QUrl QQuickControlSettings::makeStyleComponentUrl(const QString &controlStyleName, QString styleDirPath)
+{
+ QString styleFilePath = makeStyleComponentPath(controlStyleName, styleDirPath);
+
+ if (styleDirPath.startsWith(QStringLiteral(":/")))
+ return QUrl(QStringLiteral("qrc") + styleFilePath);
+
+ return QUrl::fromLocalFile(styleFilePath);
+}
+
+QQmlComponent *QQuickControlSettings::styleComponent(const QUrl &styleDirUrl, const QString &controlStyleName, QObject *control)
+{
+ Q_UNUSED(styleDirUrl); // required for hack that forces this function to be re-called from within QML when style changes
+
+ // QUrl doesn't consider qrc-based URLs as local files, so bypass it here.
+ QString styleFilePath = makeStyleComponentPath(controlStyleName, m_styleMap.value(m_name).m_styleDirPath);
+ QUrl styleFileUrl;
+ if (QFile::exists(styleFilePath)) {
+ styleFileUrl = makeStyleComponentUrl(controlStyleName, m_styleMap.value(m_name).m_styleDirPath);
+ } else {
+ // It's OK for a style to pick and choose which controls it wants to provide style files for.
+ styleFileUrl = makeStyleComponentUrl(controlStyleName, m_styleMap.value(QStringLiteral("Base")).m_styleDirPath);
+ }
+
+ return new QQmlComponent(qmlEngine(control), styleFileUrl);
+}
+
+static QString relativeStyleImportPath(QQmlEngine *engine, const QString &styleName)
+{
+ QString path;
+ bool found = false;
+ foreach (const QString &import, engine->importPathList()) {
+ QDir dir(import + QStringLiteral("/QtQuick/Controls/Styles"));
+ if (dir.exists(styleName)) {
+ found = true;
+ path = dir.absolutePath();
+ break;
+ }
+ if (found)
+ break;
+ }
+ if (!found)
+ path = ":/QtQuick/Controls/Styles";
+ return path;
+}
+
static QString styleImportPath(QQmlEngine *engine, const QString &styleName)
{
QString path = qgetenv("QT_QUICK_CONTROLS_STYLE");
@@ -113,19 +164,7 @@ static QString styleImportPath(QQmlEngine *engine, const QString &styleName)
if (fromResource(path)) {
path = info.path();
} else if (info.isRelative()) {
- bool found = false;
- foreach (const QString &import, engine->importPathList()) {
- QDir dir(import + QLatin1String("/QtQuick/Controls/Styles"));
- if (dir.exists(styleName)) {
- found = true;
- path = dir.absolutePath();
- break;
- }
- if (found)
- break;
- }
- if (!found)
- path = ":/QtQuick/Controls/Styles";
+ path = relativeStyleImportPath(engine, styleName);
} else {
path = info.absolutePath();
}
@@ -134,40 +173,109 @@ static QString styleImportPath(QQmlEngine *engine, const QString &styleName)
QQuickControlSettings::QQuickControlSettings(QQmlEngine *engine)
{
+ // First, register all style paths in the default style location.
+ QDir dir;
+ const QString defaultStyle = defaultStyleName();
+ dir.setPath(relativeStyleImportPath(engine, defaultStyle));
+ dir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot);
+ foreach (const QString &styleDirectory, dir.entryList()) {
+ findStyle(engine, styleDirectory);
+ }
+
m_name = styleImportName();
- m_path = styleImportPath(engine, m_name);
- QString path = styleFilePath();
+ // If the style name is a path..
+ const QString styleNameFromEnvVar = qgetenv("QT_QUICK_CONTROLS_STYLE");
+ if (QFile::exists(styleNameFromEnvVar)) {
+ StyleData styleData;
+ styleData.m_styleDirPath = styleNameFromEnvVar;
+ m_styleMap[m_name] = styleData;
+ }
- QDir dir(path);
- if (!dir.exists()) {
+ // Then check if the style the user wanted is known to us. Otherwise, use the fallback style.
+ if (m_styleMap.contains(m_name)) {
+ m_path = m_styleMap.value(m_name).m_styleDirPath;
+ } else {
QString unknownStyle = m_name;
- m_name = defaultStyleName();
- m_path = styleImportPath(engine, m_name);
+ m_name = defaultStyle;
+ m_path = m_styleMap.value(defaultStyle).m_styleDirPath;
qWarning() << "WARNING: Cannot find style" << unknownStyle << "- fallback:" << styleFilePath();
- } else {
- typedef bool (*StyleInitFunc)();
- typedef const char *(*StylePathFunc)();
-
- foreach (const QString &fileName, dir.entryList()) {
- if (QLibrary::isLibrary(fileName)) {
- QLibrary lib(dir.absoluteFilePath(fileName));
- StyleInitFunc initFunc = (StyleInitFunc) lib.resolve("qt_quick_controls_style_init");
- if (initFunc)
- initFunc();
- StylePathFunc pathFunc = (StylePathFunc) lib.resolve("qt_quick_controls_style_path");
- if (pathFunc)
- m_path = QString::fromLocal8Bit(pathFunc());
- if (initFunc || pathFunc)
- break;
- }
- }
}
+ // Can't really do anything about this failing here, so don't bother checking...
+ resolveCurrentStylePath();
+
connect(this, SIGNAL(styleNameChanged()), SIGNAL(styleChanged()));
connect(this, SIGNAL(stylePathChanged()), SIGNAL(styleChanged()));
}
+bool QQuickControlSettings::resolveCurrentStylePath()
+{
+ if (!m_styleMap.contains(m_name)) {
+ qWarning() << "WARNING: Cannot find style" << m_name;
+ return false;
+ }
+
+ StyleData styleData = m_styleMap.value(m_name);
+
+ if (styleData.m_stylePluginPath.isEmpty())
+ return true; // It's not a plugin; don't have to do anything.
+
+ typedef bool (*StyleInitFunc)();
+ typedef const char *(*StylePathFunc)();
+
+ QLibrary lib(styleData.m_stylePluginPath);
+ if (!lib.load()) {
+ qWarning().nospace() << "WARNING: Cannot load plugin " << styleData.m_stylePluginPath
+ << " for style " << m_name << ": " << lib.errorString();
+ return false;
+ }
+
+ // Check for the existence of this first, as we don't want to init if this doesn't exist.
+ StylePathFunc pathFunc = (StylePathFunc) lib.resolve("qt_quick_controls_style_path");
+ if (!pathFunc) {
+ qWarning() << "WARNING: Style" << m_name << "is a plugin but does not expose qt_quick_controls_style_path";
+ return false;
+ }
+
+ StyleInitFunc initFunc = (StyleInitFunc) lib.resolve("qt_quick_controls_style_init");
+ if (initFunc)
+ initFunc();
+
+ styleData.m_styleDirPath = QString::fromLocal8Bit(pathFunc());
+ m_styleMap[m_name] = styleData;
+ return true;
+}
+
+void QQuickControlSettings::findStyle(QQmlEngine *engine, const QString &styleName)
+{
+ QString path = styleImportPath(engine, styleName);
+ QDir dir;
+ dir.setFilter(QDir::Files | QDir::NoDotAndDotDot);
+ dir.setPath(path);
+ dir.cd(styleName);
+
+ StyleData styleData;
+
+ foreach (const QString &fileName, dir.entryList()) {
+ // This assumes that there is only one library in the style directory,
+ // which should be a safe assumption. If at some point it's determined
+ // not to be safe, we'll have to resolve the init and path functions
+ // here, to be sure that it is the correct library.
+ if (QLibrary::isLibrary(fileName)) {
+ styleData.m_stylePluginPath = dir.absoluteFilePath(fileName);
+ break;
+ }
+ }
+
+ // If there's no plugin for the style, then the style's files are
+ // contained in this directory (which contains a qmldir file instead).
+ if (styleData.m_stylePluginPath.isEmpty())
+ styleData.m_styleDirPath = dir.absolutePath();
+
+ m_styleMap[styleName] = styleData;
+}
+
QUrl QQuickControlSettings::style() const
{
QUrl result;
@@ -189,8 +297,14 @@ QString QQuickControlSettings::styleName() const
void QQuickControlSettings::setStyleName(const QString &name)
{
if (m_name != name) {
+ QString oldName = m_name;
m_name = name;
- emit styleNameChanged();
+
+ // Don't change the style if it can't be resolved.
+ if (!resolveCurrentStylePath())
+ m_name = oldName;
+ else
+ emit styleNameChanged();
}
}
@@ -209,7 +323,7 @@ void QQuickControlSettings::setStylePath(const QString &path)
QString QQuickControlSettings::styleFilePath() const
{
- return m_path + QLatin1Char('/') + m_name;
+ return m_path;
}
extern Q_GUI_EXPORT int qt_defaultDpiX();
diff --git a/src/controls/Private/qquickcontrolsettings_p.h b/src/controls/Private/qquickcontrolsettings_p.h
index ed21101d..1b99fd3e 100644
--- a/src/controls/Private/qquickcontrolsettings_p.h
+++ b/src/controls/Private/qquickcontrolsettings_p.h
@@ -39,6 +39,9 @@
#include <QtCore/qurl.h>
#include <QtCore/qobject.h>
+#include <QtCore/qstring.h>
+#include <QtCore/qhash.h>
+#include <QtQml/qqmlcomponent.h>
QT_BEGIN_NAMESPACE
@@ -74,6 +77,9 @@ public:
bool isMobile() const;
bool hoverEnabled() const;
+ Q_INVOKABLE QQmlComponent *styleComponent(const QUrl &styleDirUrl,
+ const QString &controlStyleName, QObject *control);
+
signals:
void styleChanged();
void styleNameChanged();
@@ -81,9 +87,22 @@ signals:
private:
QString styleFilePath() const;
+ void findStyle(QQmlEngine *engine, const QString &styleName);
+ bool resolveCurrentStylePath();
+ QString makeStyleComponentPath(const QString &controlStyleName, const QString &styleDirPath);
+ QUrl makeStyleComponentUrl(const QString &controlStyleName, QString styleDirPath);
+
+ struct StyleData
+ {
+ // Path to the style's plugin or qmldir file.
+ QString m_stylePluginPath;
+ // Path to the directory containing the style's files.
+ QString m_styleDirPath;
+ };
QString m_name;
QString m_path;
+ QHash<QString, StyleData> m_styleMap;
};
QT_END_NAMESPACE
diff --git a/src/controls/ProgressBar.qml b/src/controls/ProgressBar.qml
index 7bc3bec5..681cb135 100644
--- a/src/controls/ProgressBar.qml
+++ b/src/controls/ProgressBar.qml
@@ -114,7 +114,7 @@ Control {
readonly property alias hovered: hoverArea.containsMouse
/*! \internal */
- style: Qt.createComponent(Settings.style + "/ProgressBarStyle.qml", progressbar)
+ style: Settings.styleComponent(Settings.style, "ProgressBarStyle.qml", progressbar)
/*! \internal */
property bool __initialized: false
diff --git a/src/controls/RadioButton.qml b/src/controls/RadioButton.qml
index d24a5d44..b03028a1 100644
--- a/src/controls/RadioButton.qml
+++ b/src/controls/RadioButton.qml
@@ -90,7 +90,7 @@ AbstractCheckable {
\codeline Qt.createComponent("path/to/style.qml", radioButtonId);
*/
- style: Qt.createComponent(Settings.style + "/RadioButtonStyle.qml", radioButton)
+ style: Settings.styleComponent(Settings.style, "RadioButtonStyle.qml", radioButton)
__cycleStatesHandler: function() { checked = !checked; }
}
diff --git a/src/controls/ScrollView.qml b/src/controls/ScrollView.qml
index 05f33b84..c82bb7e5 100644
--- a/src/controls/ScrollView.qml
+++ b/src/controls/ScrollView.qml
@@ -180,7 +180,7 @@ FocusScope {
\sa {Qt Quick Controls Styles QML Types}
*/
- property Component style: Qt.createComponent(Settings.style + "/ScrollViewStyle.qml", root)
+ property Component style: Settings.styleComponent(Settings.style, "ScrollViewStyle.qml", root)
/*! \internal */
property Style __style: styleLoader.item
diff --git a/src/controls/Slider.qml b/src/controls/Slider.qml
index 8bce7e8f..437749eb 100644
--- a/src/controls/Slider.qml
+++ b/src/controls/Slider.qml
@@ -189,7 +189,7 @@ Control {
range.decreaseSingleStep()
}
- style: Qt.createComponent(Settings.style + "/SliderStyle.qml", slider)
+ style: Settings.styleComponent(Settings.style, "SliderStyle.qml", slider)
Keys.onRightPressed: if (__horizontal) range.increaseSingleStep()
Keys.onLeftPressed: if (__horizontal) range.decreaseSingleStep()
diff --git a/src/controls/SpinBox.qml b/src/controls/SpinBox.qml
index 95ce2b47..96d8d0a2 100644
--- a/src/controls/SpinBox.qml
+++ b/src/controls/SpinBox.qml
@@ -208,7 +208,7 @@ Control {
*/
property Component menu: input.editMenu.defaultMenu
- style: Qt.createComponent(Settings.style + "/SpinBoxStyle.qml", spinbox)
+ style: Settings.styleComponent(Settings.style, "SpinBoxStyle.qml", spinbox)
/*! \internal */
function __increment() {
diff --git a/src/controls/StatusBar.qml b/src/controls/StatusBar.qml
index 4f0dd374..74df9439 100644
--- a/src/controls/StatusBar.qml
+++ b/src/controls/StatusBar.qml
@@ -82,7 +82,7 @@ FocusScope {
+ Math.max(container.layoutHeight, __panel ? __panel.implicitHeight : 0)
/*! \internal */
- property Component style: Qt.createComponent(Settings.style + "/StatusBarStyle.qml", statusbar)
+ property Component style: Settings.styleComponent(Settings.style, "StatusBarStyle.qml", statusbar)
/*! \internal */
property alias __style: styleLoader.item
diff --git a/src/extras/Styles/Base/CircularButtonStyle.qml b/src/controls/Styles/Base/CircularButtonStyle.qml
index 9e29a534..e4576226 100644
--- a/src/extras/Styles/Base/CircularButtonStyle.qml
+++ b/src/controls/Styles/Base/CircularButtonStyle.qml
@@ -35,8 +35,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls.Styles 1.1
-import QtQuick.Extras.Styles 1.3
+import QtQuick.Controls.Styles 1.4
import QtQuick.Extras.Private 1.0
ButtonStyle {
diff --git a/src/extras/Styles/Base/CircularGaugeStyle.qml b/src/controls/Styles/Base/CircularGaugeStyle.qml
index 2030f775..99b0091b 100644
--- a/src/extras/Styles/Base/CircularGaugeStyle.qml
+++ b/src/controls/Styles/Base/CircularGaugeStyle.qml
@@ -36,17 +36,17 @@
import QtQuick 2.2
import QtGraphicalEffects 1.0
-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 CircularGaugeStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.0
- \ingroup extrasstyles
+ \inqmlmodule QtQuick.Controls.Styles
+ \since 5.5
+ \ingroup controlsstyling
\brief Provides custom styling for CircularGauge.
You can create a custom circular gauge by replacing the following delegates:
@@ -96,8 +96,6 @@ Style {
id: circularGaugeStyle
/*!
- \since 1.3
-
The \l CircularGauge that this style is attached to.
*/
readonly property CircularGauge control: __control
@@ -241,8 +239,6 @@ Style {
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
diff --git a/src/extras/Styles/Base/CircularTickmarkLabelStyle.qml b/src/controls/Styles/Base/CircularTickmarkLabelStyle.qml
index 010e9245..010e9245 100644
--- a/src/extras/Styles/Base/CircularTickmarkLabelStyle.qml
+++ b/src/controls/Styles/Base/CircularTickmarkLabelStyle.qml
diff --git a/src/extras/Styles/Base/CommonStyleHelper.qml b/src/controls/Styles/Base/CommonStyleHelper.qml
index 4263a743..4263a743 100644
--- a/src/extras/Styles/Base/CommonStyleHelper.qml
+++ b/src/controls/Styles/Base/CommonStyleHelper.qml
diff --git a/src/extras/Styles/Base/DelayButtonStyle.qml b/src/controls/Styles/Base/DelayButtonStyle.qml
index e416550b..447932b7 100644
--- a/src/extras/Styles/Base/DelayButtonStyle.qml
+++ b/src/controls/Styles/Base/DelayButtonStyle.qml
@@ -36,16 +36,15 @@
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.Controls.Styles 1.4
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private.CppUtils 1.1
/*!
\qmltype DelayButtonStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.0
- \ingroup extrasstyles
+ \inqmlmodule QtQuick.Controls.Styles
+ \since 5.5
+ \ingroup controlsstyling
\brief Provides custom styling for DelayButton.
You can create a custom DelayButton by replacing the following delegates:
@@ -59,8 +58,6 @@ CircularButtonStyle {
id: delayButtonStyle
/*!
- \since 1.3
-
The \l DelayButton that this style is attached to.
*/
readonly property DelayButton control: __control
diff --git a/src/extras/Styles/Base/DialStyle.qml b/src/controls/Styles/Base/DialStyle.qml
index 3523f500..dc4f370d 100644
--- a/src/extras/Styles/Base/DialStyle.qml
+++ b/src/controls/Styles/Base/DialStyle.qml
@@ -35,18 +35,18 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.2
+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
import QtQuick.Extras.Private.CppUtils 1.0
/*!
\qmltype DialStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.0
- \ingroup extrasstyles
+ \inqmlmodule QtQuick.Controls.Styles
+ \since 5.5
+ \ingroup controlsstyling
\brief Provides custom styling for Dial.
You can create a custom dial by replacing the following delegates:
@@ -59,15 +59,11 @@ 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
@@ -77,16 +73,12 @@ Style {
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,
@@ -97,8 +89,6 @@ Style {
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.
*/
@@ -106,8 +96,6 @@ Style {
/*!
- \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
@@ -118,8 +106,6 @@ Style {
readonly property int tickmarkCount: control.__panel.circularTickmarkLabel.tickmarkCount
/*!
- \since QtQuick.Extras 1.1
-
The amount of minor tickmarks between each tickmark.
\sa tickmarkCount
@@ -127,24 +113,18 @@ Style {
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),
@@ -155,8 +135,6 @@ Style {
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
@@ -167,8 +145,6 @@ Style {
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
@@ -240,8 +216,6 @@ Style {
}
/*!
- \since 1.2
-
The handle of the dial.
The handle is automatically positioned within the dial, based on the
@@ -262,8 +236,6 @@ Style {
}
/*!
- \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
@@ -289,8 +261,6 @@ Style {
}
/*!
- \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
@@ -310,8 +280,6 @@ Style {
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:
diff --git a/src/extras/Styles/Base/GaugeStyle.qml b/src/controls/Styles/Base/GaugeStyle.qml
index 49ea6f29..35da65d5 100644
--- a/src/extras/Styles/Base/GaugeStyle.qml
+++ b/src/controls/Styles/Base/GaugeStyle.qml
@@ -35,17 +35,17 @@
****************************************************************************/
import QtQuick 2.2
-import QtQuick.Controls 1.1
-import QtQuick.Controls.Styles 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
/*!
\qmltype GaugeStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.0
- \ingroup extrasstyles
+ \inqmlmodule QtQuick.Controls.Styles
+ \since 5.5
+ \ingroup controlsstyling
\brief Provides custom styling for Gauge.
You can create a custom gauge by replacing the following delegates:
@@ -60,9 +60,9 @@ import QtQuick.Extras.Private 1.0
\code
import QtQuick 2.2
- import QtQuick.Controls 1.1
- import QtQuick.Extras 1.3
- import QtQuick.Extras.Styles 1.3
+ import QtQuick.Controls 1.4
+ import QtQuick.Controls.Styles 1.4
+ import QtQuick.Extras 1.4
Rectangle {
width: 80
@@ -107,15 +107,11 @@ 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.
diff --git a/src/extras/Styles/Base/HandleStyle.qml b/src/controls/Styles/Base/HandleStyle.qml
index 38588417..fd89ecac 100644
--- a/src/extras/Styles/Base/HandleStyle.qml
+++ b/src/controls/Styles/Base/HandleStyle.qml
@@ -36,7 +36,7 @@
import QtQuick 2.2
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
+import QtQuick.Extras 1.4
Style {
id: handleStyle
diff --git a/src/extras/Styles/Base/HandleStyleHelper.qml b/src/controls/Styles/Base/HandleStyleHelper.qml
index 61ad3bb3..61ad3bb3 100644
--- a/src/extras/Styles/Base/HandleStyleHelper.qml
+++ b/src/controls/Styles/Base/HandleStyleHelper.qml
diff --git a/src/extras/Styles/Base/PieMenuStyle.qml b/src/controls/Styles/Base/PieMenuStyle.qml
index c7cd1dda..916a0c9e 100644
--- a/src/extras/Styles/Base/PieMenuStyle.qml
+++ b/src/controls/Styles/Base/PieMenuStyle.qml
@@ -36,18 +36,18 @@
import QtQuick 2.2
import QtGraphicalEffects 1.0
-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
import QtQuick.Extras.Private.CppUtils 1.0
/*!
\qmltype PieMenuStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.0
- \ingroup extrasstyles
+ \inqmlmodule QtQuick.Controls.Styles
+ \since 5.5
+ \ingroup controlsstyling
\brief Provides custom styling for PieMenu.
PieMenuStyle is a style for PieMenu that draws each section of the menu as a
@@ -105,8 +105,6 @@ Style {
id: pieMenuStyle
/*!
- \since 1.3
-
The \l PieMenu that this style is attached to.
*/
readonly property PieMenu control: __control
@@ -224,8 +222,6 @@ Style {
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.
@@ -260,7 +256,6 @@ Style {
\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 {
diff --git a/src/extras/Styles/Base/StatusIndicatorStyle.qml b/src/controls/Styles/Base/StatusIndicatorStyle.qml
index ddfd1b45..62ed1038 100644
--- a/src/extras/Styles/Base/StatusIndicatorStyle.qml
+++ b/src/controls/Styles/Base/StatusIndicatorStyle.qml
@@ -37,13 +37,13 @@
import QtQuick 2.2
import QtGraphicalEffects 1.0
import QtQuick.Controls.Private 1.0
-import QtQuick.Extras 1.3
+import QtQuick.Extras 1.4
/*!
\qmltype StatusIndicatorStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.1
- \ingroup extrasstyles
+ \inqmlmodule QtQuick.Controls.Styles
+ \since 5.5
+ \ingroup controlsstyling
\brief Provides custom styling for StatusIndicatorStyle.
You can create a custom status indicator by defining the \l indicator
@@ -54,15 +54,11 @@ 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}
diff --git a/src/extras/Styles/Base/ToggleButtonStyle.qml b/src/controls/Styles/Base/ToggleButtonStyle.qml
index 507c0314..de06d72b 100644
--- a/src/extras/Styles/Base/ToggleButtonStyle.qml
+++ b/src/controls/Styles/Base/ToggleButtonStyle.qml
@@ -36,17 +36,16 @@
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.Controls.Styles 1.4
+import QtQuick.Extras 1.4
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
+ \inqmlmodule QtQuick.Controls.Styles
+ \since 5.5
+ \ingroup controlsstyling
\brief Provides custom styling for ToggleButton.
You can create a custom toggle button by replacing the same delegates that
@@ -57,8 +56,6 @@ CircularButtonStyle {
id: circularButtonStyle
/*!
- \since 1.3
-
The \l ToggleButton that this style is attached to.
*/
readonly property ToggleButton control: __control
diff --git a/src/extras/Styles/Base/TumblerStyle.qml b/src/controls/Styles/Base/TumblerStyle.qml
index 3ebcb7a2..2661837e 100644
--- a/src/extras/Styles/Base/TumblerStyle.qml
+++ b/src/controls/Styles/Base/TumblerStyle.qml
@@ -36,17 +36,17 @@
import QtQuick 2.0
import QtGraphicalEffects 1.0
-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.Styles 1.3
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
/*!
\qmltype TumblerStyle
- \inqmlmodule QtQuick.Extras.Styles
- \since QtQuick.Extras.Styles 1.2
- \ingroup extrasstyles
+ \inqmlmodule QtQuick.Controls.Styles
+ \since 5.5
+ \ingroup controlsstyling
\brief Provides custom styling for Tumbler.
\note TumblerStyle requires Qt 5.3.2 or later.
@@ -71,8 +71,6 @@ Style {
padding.bottom: __padding
/*!
- \since 1.3
-
The \l Tumbler that this style is attached to.
*/
readonly property Tumbler control: __control
diff --git a/src/extras/Styles/Base/images/knob.png b/src/controls/Styles/Base/images/knob.png
index ecac4d09..ecac4d09 100644
--- a/src/extras/Styles/Base/images/knob.png
+++ b/src/controls/Styles/Base/images/knob.png
Binary files differ
diff --git a/src/extras/Styles/Base/images/needle.png b/src/controls/Styles/Base/images/needle.png
index 8237e516..8237e516 100644
--- a/src/extras/Styles/Base/images/needle.png
+++ b/src/controls/Styles/Base/images/needle.png
Binary files differ
diff --git a/src/controls/Styles/qmldir b/src/controls/Styles/qmldir
index 582a7898..4b2f9844 100644
--- a/src/controls/Styles/qmldir
+++ b/src/controls/Styles/qmldir
@@ -20,4 +20,19 @@ TextAreaStyle 1.1 Base/TextAreaStyle.qml
TextFieldStyle 1.0 Base/TextFieldStyle.qml
ToolBarStyle 1.0 Base/ToolBarStyle.qml
StatusBarStyle 1.0 Base/StatusBarStyle.qml
+
+CircularGaugeStyle 1.0 Base/CircularGaugeStyle.qml
+CircularButtonStyle 1.0 Base/CircularButtonStyle.qml
+CircularTickmarkLabelStyle 1.0 Base/CircularTickmarkLabelStyle.qml
+CommonStyleHelper 1.0 Base/CommonStyleHelper.qml
+DelayButtonStyle 1.0 Base/DelayButtonStyle.qml
+DialStyle 1.1 Base/DialStyle.qml
+GaugeStyle 1.0 Base/GaugeStyle.qml
+HandleStyle 1.0 Base/HandleStyle.qml
+HandleStyleHelper 1.0 Base/HandleStyleHelper.qml
+PieMenuStyle 1.3 Base/PieMenuStyle.qml
+StatusIndicatorStyle 1.1 Base/StatusIndicatorStyle.qml
+ToggleButtonStyle 1.0 Base/ToggleButtonStyle.qml
+TumblerStyle 1.2 Base/TumblerStyle.qml
+
designersupported
diff --git a/src/controls/Styles/styles.pri b/src/controls/Styles/styles.pri
index f91a9d1a..eaad43ea 100644
--- a/src/controls/Styles/styles.pri
+++ b/src/controls/Styles/styles.pri
@@ -27,6 +27,22 @@ STYLES_QML_FILES = \
$$PWD/Base/ToolBarStyle.qml \
$$PWD/Base/ToolButtonStyle.qml
+# Extras
+STYLES_QML_FILES += \
+ $$PWD/Base/CircularGaugeStyle.qml \
+ $$PWD/Base/CircularButtonStyle.qml \
+ $$PWD/Base/CircularTickmarkLabelStyle.qml \
+ $$PWD/Base/CommonStyleHelper.qml \
+ $$PWD/Base/DelayButtonStyle.qml \
+ $$PWD/Base/DialStyle.qml \
+ $$PWD/Base/GaugeStyle.qml \
+ $$PWD/Base/HandleStyle.qml \
+ $$PWD/Base/HandleStyleHelper.qml \
+ $$PWD/Base/PieMenuStyle.qml \
+ $$PWD/Base/StatusIndicatorStyle.qml \
+ $$PWD/Base/ToggleButtonStyle.qml \
+ $$PWD/Base/TumblerStyle.qml
+
# Desktop
!no_desktop {
STYLES_QML_FILES += \
@@ -88,7 +104,9 @@ STYLES_QML_FILES += \
$$PWD/Base/images/spinner_medium.png \
$$PWD/Base/images/spinner_large.png \
$$PWD/Base/images/check.png \
- $$PWD/Base/images/check@2x.png
+ $$PWD/Base/images/check@2x.png \
+ $$PWD/Base/images/knob.png \
+ $$PWD/Base/images/needle.png
STYLES_QML_FILES += $$PWD/qmldir
diff --git a/src/controls/Switch.qml b/src/controls/Switch.qml
index abfb79b0..d416b7f3 100644
--- a/src/controls/Switch.qml
+++ b/src/controls/Switch.qml
@@ -159,5 +159,5 @@ Control {
\codeline Qt.createComponent("path/to/style.qml", switchId);
*/
- style: Qt.createComponent(Settings.style + "/SwitchStyle.qml", root)
+ style: Settings.styleComponent(Settings.style, "SwitchStyle.qml", root)
}
diff --git a/src/controls/TabView.qml b/src/controls/TabView.qml
index ebab068a..ea8bf4bd 100644
--- a/src/controls/TabView.qml
+++ b/src/controls/TabView.qml
@@ -176,7 +176,7 @@ FocusScope {
property ListModel __tabs: ListModel { }
/*! \internal */
- property Component style: Qt.createComponent(Settings.style + "/TabViewStyle.qml", root)
+ property Component style: Settings.styleComponent(Settings.style, "TabViewStyle.qml", root)
/*! \internal */
property var __styleItem: loader.item
diff --git a/src/controls/TableView.qml b/src/controls/TableView.qml
index 198ec3c7..e4357739 100644
--- a/src/controls/TableView.qml
+++ b/src/controls/TableView.qml
@@ -281,7 +281,7 @@ BasicTableView {
onModelChanged: selection.clear()
- style: Qt.createComponent(Settings.style + "/TableViewStyle.qml", root)
+ style: Settings.styleComponent(Settings.style, "TableViewStyle.qml", root)
Accessible.role: Accessible.Table
diff --git a/src/controls/TextArea.qml b/src/controls/TextArea.qml
index 0199cc81..c141f9e2 100644
--- a/src/controls/TextArea.qml
+++ b/src/controls/TextArea.qml
@@ -695,7 +695,7 @@ ScrollView {
Accessible.role: Accessible.EditableText
- style: Qt.createComponent(Settings.style + "/TextAreaStyle.qml", area)
+ style: Settings.styleComponent(Settings.style, "TextAreaStyle.qml", area)
/*!
\qmlproperty TextDocument TextArea::textDocument
diff --git a/src/controls/TextField.qml b/src/controls/TextField.qml
index 078fee2d..db42cfb7 100644
--- a/src/controls/TextField.qml
+++ b/src/controls/TextField.qml
@@ -611,7 +611,7 @@ Control {
/*! \internal */
property alias __baselineOffset: textInput.baselineOffset
- style: Qt.createComponent(Settings.style + "/TextFieldStyle.qml", textInput)
+ style: Settings.styleComponent(Settings.style, "TextFieldStyle.qml", textInput)
activeFocusOnTab: true
diff --git a/src/controls/ToolBar.qml b/src/controls/ToolBar.qml
index 796d25dd..48f62f16 100644
--- a/src/controls/ToolBar.qml
+++ b/src/controls/ToolBar.qml
@@ -100,7 +100,7 @@ FocusScope {
+ Math.max(container.layoutHeight, __panel ? __panel.implicitHeight : 0)
/*! \internal */
- property Component style: Qt.createComponent(Settings.style + "/ToolBarStyle.qml", toolbar)
+ property Component style: Settings.styleComponent(Settings.style, "ToolBarStyle.qml", toolbar)
/*! \internal */
property alias __style: styleLoader.item
diff --git a/src/controls/ToolButton.qml b/src/controls/ToolButton.qml
index e98f7ffd..a9904e11 100644
--- a/src/controls/ToolButton.qml
+++ b/src/controls/ToolButton.qml
@@ -80,5 +80,5 @@ import QtQuick.Controls.Private 1.0
Button {
id: button
- style: Qt.createComponent(Settings.style + "/ToolButtonStyle.qml", button)
+ style: Settings.styleComponent(Settings.style, "ToolButtonStyle.qml", button)
}
diff --git a/src/controls/TreeView.qml b/src/controls/TreeView.qml
index 8aaf3bbf..f1175b72 100644
--- a/src/controls/TreeView.qml
+++ b/src/controls/TreeView.qml
@@ -252,7 +252,7 @@ BasicTableView {
modelAdaptor.expand(index)
}
- style: Qt.createComponent(Settings.style + "/TreeViewStyle.qml", root)
+ style: Settings.styleComponent(Settings.style, "TreeViewStyle.qml", root)
// Internal stuff. Do not look
diff --git a/src/controls/controls.pro b/src/controls/controls.pro
index 151ccb4b..7261b5c6 100644
--- a/src/controls/controls.pro
+++ b/src/controls/controls.pro
@@ -43,6 +43,8 @@ QML_FILES += $$CONTROLS_QML_FILES
SOURCES += $$PWD/plugin.cpp
HEADERS += $$PWD/plugin.h
+OTHER_FILES += doc/src/*
+
include(plugin.pri)
include(Private/private.pri)
include(Styles/styles.pri)
diff --git a/src/extras/doc/images/circulargauge-angles.png b/src/controls/doc/images/circulargauge-angles.png
index fb93bcaa..fb93bcaa 100644
--- a/src/extras/doc/images/circulargauge-angles.png
+++ b/src/controls/doc/images/circulargauge-angles.png
Binary files differ
diff --git a/src/extras/doc/images/circulargauge-needle-example-2.png b/src/controls/doc/images/circulargauge-needle-example-2.png
index a2b5f322..a2b5f322 100644
--- a/src/extras/doc/images/circulargauge-needle-example-2.png
+++ b/src/controls/doc/images/circulargauge-needle-example-2.png
Binary files differ
diff --git a/src/extras/doc/images/circulargauge-needle.png b/src/controls/doc/images/circulargauge-needle.png
index b2780b41..b2780b41 100644
--- a/src/extras/doc/images/circulargauge-needle.png
+++ b/src/controls/doc/images/circulargauge-needle.png
Binary files differ
diff --git a/src/extras/doc/images/circulargauge-reversed.png b/src/controls/doc/images/circulargauge-reversed.png
index aeadfbcc..aeadfbcc 100644
--- a/src/extras/doc/images/circulargauge-reversed.png
+++ b/src/controls/doc/images/circulargauge-reversed.png
Binary files differ
diff --git a/src/extras/doc/images/circulargauge-tickmark-indices-values.png b/src/controls/doc/images/circulargauge-tickmark-indices-values.png
index d117f483..d117f483 100644
--- a/src/extras/doc/images/circulargauge-tickmark-indices-values.png
+++ b/src/controls/doc/images/circulargauge-tickmark-indices-values.png
Binary files differ
diff --git a/src/extras/doc/images/gauge-minorTickmark-example.png b/src/controls/doc/images/gauge-minorTickmark-example.png
index 591120d6..591120d6 100644
--- a/src/extras/doc/images/gauge-minorTickmark-example.png
+++ b/src/controls/doc/images/gauge-minorTickmark-example.png
Binary files differ
diff --git a/src/extras/doc/images/gauge-temperature.png b/src/controls/doc/images/gauge-temperature.png
index 95fc1679..95fc1679 100644
--- a/src/extras/doc/images/gauge-temperature.png
+++ b/src/controls/doc/images/gauge-temperature.png
Binary files differ
diff --git a/src/extras/doc/images/gauge-tickmark-example.png b/src/controls/doc/images/gauge-tickmark-example.png
index c46fb8a5..c46fb8a5 100644
--- a/src/extras/doc/images/gauge-tickmark-example.png
+++ b/src/controls/doc/images/gauge-tickmark-example.png
Binary files differ
diff --git a/src/extras/doc/images/piemenu-menuitem-example.png b/src/controls/doc/images/piemenu-menuitem-example.png
index 57a2f956..57a2f956 100644
--- a/src/extras/doc/images/piemenu-menuitem-example.png
+++ b/src/controls/doc/images/piemenu-menuitem-example.png
Binary files differ
diff --git a/src/extras/doc/images/styling-circulargauge-background-example.png b/src/controls/doc/images/styling-circulargauge-background-example.png
index e816c6f6..e816c6f6 100644
--- a/src/extras/doc/images/styling-circulargauge-background-example.png
+++ b/src/controls/doc/images/styling-circulargauge-background-example.png
Binary files differ
diff --git a/src/extras/doc/images/styling-circulargauge-knob-example.png b/src/controls/doc/images/styling-circulargauge-knob-example.png
index 793a36c2..793a36c2 100644
--- a/src/extras/doc/images/styling-circulargauge-knob-example.png
+++ b/src/controls/doc/images/styling-circulargauge-knob-example.png
Binary files differ
diff --git a/src/extras/doc/images/styling-circulargauge-minorTickmark-example.png b/src/controls/doc/images/styling-circulargauge-minorTickmark-example.png
index f3f2d8d7..f3f2d8d7 100644
--- a/src/extras/doc/images/styling-circulargauge-minorTickmark-example.png
+++ b/src/controls/doc/images/styling-circulargauge-minorTickmark-example.png
Binary files differ
diff --git a/src/extras/doc/images/styling-circulargauge-needle-example.png b/src/controls/doc/images/styling-circulargauge-needle-example.png
index 08049fc9..08049fc9 100644
--- a/src/extras/doc/images/styling-circulargauge-needle-example.png
+++ b/src/controls/doc/images/styling-circulargauge-needle-example.png
Binary files differ
diff --git a/src/extras/doc/images/styling-circulargauge-tickmark-example.png b/src/controls/doc/images/styling-circulargauge-tickmark-example.png
index 01c71cd1..01c71cd1 100644
--- a/src/extras/doc/images/styling-circulargauge-tickmark-example.png
+++ b/src/controls/doc/images/styling-circulargauge-tickmark-example.png
Binary files differ
diff --git a/src/extras/doc/images/styling-circulargauge-tickmarkLabel-example.png b/src/controls/doc/images/styling-circulargauge-tickmarkLabel-example.png
index 7520827e..7520827e 100644
--- a/src/extras/doc/images/styling-circulargauge-tickmarkLabel-example.png
+++ b/src/controls/doc/images/styling-circulargauge-tickmarkLabel-example.png
Binary files differ
diff --git a/src/extras/doc/images/styling-gauge-font-size.png b/src/controls/doc/images/styling-gauge-font-size.png
index 97d7ebb2..97d7ebb2 100644
--- a/src/extras/doc/images/styling-gauge-font-size.png
+++ b/src/controls/doc/images/styling-gauge-font-size.png
Binary files differ
diff --git a/src/extras/doc/images/styling-gauge-foreground.png b/src/controls/doc/images/styling-gauge-foreground.png
index 5a4f65b9..5a4f65b9 100644
--- a/src/extras/doc/images/styling-gauge-foreground.png
+++ b/src/controls/doc/images/styling-gauge-foreground.png
Binary files differ
diff --git a/src/extras/doc/images/styling-gauge-minorTickmark.png b/src/controls/doc/images/styling-gauge-minorTickmark.png
index 34e36192..34e36192 100644
--- a/src/extras/doc/images/styling-gauge-minorTickmark.png
+++ b/src/controls/doc/images/styling-gauge-minorTickmark.png
Binary files differ
diff --git a/src/extras/doc/images/styling-gauge-tickmark.png b/src/controls/doc/images/styling-gauge-tickmark.png
index 1cd4fb8b..1cd4fb8b 100644
--- a/src/extras/doc/images/styling-gauge-tickmark.png
+++ b/src/controls/doc/images/styling-gauge-tickmark.png
Binary files differ
diff --git a/src/extras/doc/images/styling-gauge-valueBar.png b/src/controls/doc/images/styling-gauge-valueBar.png
index 581b8240..581b8240 100644
--- a/src/extras/doc/images/styling-gauge-valueBar.png
+++ b/src/controls/doc/images/styling-gauge-valueBar.png
Binary files differ
diff --git a/src/controls/doc/qtquickcontrols.qdocconf b/src/controls/doc/qtquickcontrols.qdocconf
index 6b4b14c7..8d41247e 100644
--- a/src/controls/doc/qtquickcontrols.qdocconf
+++ b/src/controls/doc/qtquickcontrols.qdocconf
@@ -28,12 +28,13 @@ qhp.QtQuickControls.subprojects.qtquickcontrolsstyles.title = Qt Quick Cont
qhp.QtQuickControls.subprojects.qtquickcontrolsstyles.indexTitle = Qt Quick Controls Styles Structure
qhp.QtQuickControls.subprojects.qtquickcontrolsstyles.type = manual
-depends = qtqml qtquick qtgui qtwidgets qtdoc qtquicklayouts qtquickdialogs qtcore
+depends = qtcore qtdoc qtgui qtwidgets qtqml qtquick qtquicklayouts qtquickdialogs qtquickextras
# Specify the install path under QT_INSTALL_EXAMPLES
# Examples will be installed under quick/controls - 'controls' subdirectory
# is given as part of \example commands
-exampledirs += ../../../examples/quick/controls
+exampledirs += ../../../examples/quick/controls \
+ snippets
examplesinstallpath = quick/controls
headerdirs += ../ \
@@ -54,7 +55,8 @@ sources += ../Private/AbstractCheckable.qml \
../Private/qquickabstractstyle.h \
../Private/qquickabstractstyle.cpp
-imagedirs += images
+imagedirs += images \
+ ../../extras/doc/images
navigation.landingpage = "Qt Quick Controls"
navigation.qmltypespage = "Qt Quick Controls QML Types"
diff --git a/src/extras/doc/snippets/circulargauge-background-range.qml b/src/controls/doc/snippets/circulargauge-background-range.qml
index 619fc465..f218e916 100644
--- a/src/extras/doc/snippets/circulargauge-background-range.qml
+++ b/src/controls/doc/snippets/circulargauge-background-range.qml
@@ -27,9 +27,9 @@
//! [range]
import QtQuick 2.0
-import QtQuick.Controls 1.1
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4
+import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
Rectangle {
diff --git a/src/extras/doc/snippets/circulargauge-tickmark-indices-values.qml b/src/controls/doc/snippets/circulargauge-tickmark-indices-values.qml
index 33781baa..d3afd6f4 100644
--- a/src/extras/doc/snippets/circulargauge-tickmark-indices-values.qml
+++ b/src/controls/doc/snippets/circulargauge-tickmark-indices-values.qml
@@ -27,8 +27,8 @@
//! [tickmarks]
import QtQuick 2.0
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
+import QtQuick.Controls.Styles 1.4
+import QtQuick.Extras 1.4
Rectangle {
width: 400
diff --git a/src/extras/doc/snippets/styling-gauge.qml b/src/controls/doc/snippets/styling-gauge.qml
index 48cb95ed..e999832b 100644
--- a/src/extras/doc/snippets/styling-gauge.qml
+++ b/src/controls/doc/snippets/styling-gauge.qml
@@ -27,9 +27,9 @@
//! [all]
import QtQuick 2.2
-import QtQuick.Controls 1.1
-import QtQuick.Extras 1.3
-import QtQuick.Extras.Styles 1.3
+import QtQuick.Controls 1.4
+import QtQuick.Controls.Styles 1.4
+import QtQuick.Extras 1.4
Rectangle {
width: 100
diff --git a/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc b/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc
index d9c813e4..59951190 100644
--- a/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc
+++ b/src/controls/doc/src/qtquickcontrolsstyles-index.qdoc
@@ -48,6 +48,11 @@
\internal
*/
+/*!
+ \group stylingtutorials
+ \title Styling Tutorials
+*/
+
/*!
\page qtquickcontrolsstyles-index.html
@@ -66,12 +71,48 @@
import QtQuick.Controls.Styles 1.4
\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.
+
+ \image tumbler-flat-style.png
+ \caption The Flat Style Tumbler.
+
+ \section2 Selecting Styles
+
+ 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 Styling Views
\annotatedlist viewsstyling
\section1 Styling Controls
\annotatedlist controlsstyling
+ \section1 Styling Tutorials
+ \annotatedlist stylingtutorials
+
\section1 Related information
\list
diff --git a/src/extras/doc/src/styling-circulargauge.qdoc b/src/controls/doc/src/styling-circulargauge.qdoc
index 9cf94087..e0260db4 100644
--- a/src/extras/doc/src/styling-circulargauge.qdoc
+++ b/src/controls/doc/src/styling-circulargauge.qdoc
@@ -29,12 +29,12 @@
\page styling-circulargauge.html
\title Styling CircularGauge
\brief Tutorial for styling CircularGauge.
- \ingroup extrasstyling
+ \ingroup stylingtutorials
\target styling-circulargauge-needle
\section2 The Needle Component
- The \l {QtQuick.Extras.Styles::CircularGaugeStyle::}{needle}
+ The \l {QtQuick.Controls.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:
@@ -43,11 +43,11 @@
\image styling-circulargauge-needle-example.png
- As mentioned in the documentation for \l {QtQuick.Extras.Styles::}
+ As mentioned in the documentation for \l {QtQuick.Controls.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}
+ \l {QtQuick.Controls.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.
@@ -56,7 +56,7 @@
\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::}
+ replace it. The \l {QtQuick.Controls.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):
@@ -130,7 +130,7 @@
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()}
+ \l {QtQuick.Controls.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.
diff --git a/src/extras/doc/src/styling-gauge.qdoc b/src/controls/doc/src/styling-gauge.qdoc
index accdd425..195cc4c8 100644
--- a/src/extras/doc/src/styling-gauge.qdoc
+++ b/src/controls/doc/src/styling-gauge.qdoc
@@ -29,7 +29,7 @@
\page styling-gauge.html
\title Styling Gauge
\brief Tutorial for styling the Gauge control.
- \ingroup extrasstyling
+ \ingroup stylingtutorials
As GaugeStyle's documentation adequately covers common use cases, this
tutorial will cover a different scenario: one where the gauge's tickmarks
@@ -38,7 +38,7 @@
\target styling-gauge-valueBar
\section2 The Value Bar Component
- The \l {QtQuick.Extras.Styles::GaugeStyle::}{valueBar}
+ The \l {QtQuick.Controls.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.
@@ -55,7 +55,7 @@
\target styling-gauge-foreground
\section2 The Foreground Component
- The \l {QtQuick.Extras.Styles::GaugeStyle::}{foreground}
+ The \l {QtQuick.Controls.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
@@ -68,7 +68,7 @@
\target styling-gauge-tickmark
\section2 The Tickmark Component
- The \l {QtQuick.Extras.Styles::GaugeStyle::}{tickmark}
+ The \l {QtQuick.Controls.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
@@ -103,7 +103,7 @@
\target styling-gauge-minorTickmark
\section2 The Minor Tickmark Component
- The \l {QtQuick.Extras.Styles::GaugeStyle::}{minorTickmark}
+ The \l {QtQuick.Controls.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
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/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/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/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/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/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"