diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-02-17 13:53:44 +0100 |
---|---|---|
committer | Caroline Chao <caroline.chao@theqtcompany.com> | 2015-03-02 13:52:13 +0000 |
commit | f0c227f8a9a5c5e3ed83f86702626092457175aa (patch) | |
tree | 9d5903b76206906a7dc5abff7a8c06bfcfc3f129 /tests/auto/extras/data/tst_statusindicator.qml | |
parent | b80076c53c045076afdba44a975a533d130a7b60 (diff) | |
download | qtquickcontrols-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 'tests/auto/extras/data/tst_statusindicator.qml')
-rw-r--r-- | tests/auto/extras/data/tst_statusindicator.qml | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/auto/extras/data/tst_statusindicator.qml b/tests/auto/extras/data/tst_statusindicator.qml index e9fa6ac9..da38f9fc 100644 --- a/tests/auto/extras/data/tst_statusindicator.qml +++ b/tests/auto/extras/data/tst_statusindicator.qml @@ -36,8 +36,9 @@ import QtTest 1.0 import QtQuick 2.1 -import QtQuick.Extras 1.3 -import QtQuick.Extras.Private 1.0 +import QtQuick.Controls 1.4 +import QtQuick.Controls.Private 1.0 +import QtQuick.Extras 1.4 TestCase { id: testCase @@ -55,13 +56,13 @@ TestCase { } function test_instance() { - indicator = Qt.createQmlObject("import QtQuick.Extras 1.3; StatusIndicator { }", testCase, ""); + indicator = Qt.createQmlObject("import QtQuick.Extras 1.4; StatusIndicator { }", testCase, ""); verify(indicator, "StatusIndicator: failed to create an instance") verify(indicator.__style); } function test_active_data() { - if (StyleSettings.styleName === "Flat") { + if (Settings.styleName === "Flat") { return [ { tag: "active", active: true, expectedColor: { r: 18, g: 136, b: 203 } }, { tag: "inactive", active: false, expectedColor: { r: 179, g: 179, b: 179 } } @@ -75,13 +76,13 @@ TestCase { } function test_active(data) { - indicator = Qt.createQmlObject("import QtQuick.Extras 1.3; StatusIndicator { }", testCase, ""); + indicator = Qt.createQmlObject("import QtQuick.Extras 1.4; StatusIndicator { }", testCase, ""); verify(indicator); compare(indicator.active, false); indicator.active = data.active; // Color is slightly different on some platforms/machines, like Windows. - var lenience = StyleSettings.styleName === "Flat" ? 0 : 2; + var lenience = Settings.styleName === "Flat" ? 0 : 2; waitForRendering(indicator); var image = grabImage(indicator); @@ -91,9 +92,9 @@ TestCase { } function test_color() { - var flatStyle = StyleSettings.styleName === "Flat"; + var flatStyle = Settings.styleName === "Flat"; - indicator = Qt.createQmlObject("import QtQuick.Extras 1.3; StatusIndicator { }", testCase, ""); + indicator = Qt.createQmlObject("import QtQuick.Extras 1.4; StatusIndicator { }", testCase, ""); verify(indicator); compare(indicator.color, flatStyle ? "#1288cb" : "#ff0000"); @@ -113,10 +114,10 @@ TestCase { } function test_baseStyleHasOuterShadow() { - if (StyleSettings.styleName !== "Base") + if (Settings.styleName !== "Base") return; - indicator = Qt.createQmlObject("import QtQuick.Extras 1.3; StatusIndicator { }", testCase, ""); + indicator = Qt.createQmlObject("import QtQuick.Extras 1.4; StatusIndicator { }", testCase, ""); verify(indicator); // There should be a "shadow" here... |