aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2022-11-17 15:35:18 +0800
committerMitch Curtis <mitch.curtis@qt.io>2022-12-12 13:38:14 +0800
commit81b12a5f73bfd61c9e7ca912a3e3f7ab57ff45cd (patch)
treee035f40e04b778ce9dc99dc63c504d096d11b271 /tests/manual
parent7e38a9e6efc72cc42af16d9cef6f94703b06474b (diff)
Update Material Switch to Material 3
Fixes: QTBUG-108555 Change-Id: I6c17812c9cf0dab71ac212ab7cb28cad646f9dfc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/quickcontrols/material/CMakeLists.txt1
-rw-r--r--tests/manual/quickcontrols/material/material.qml2
-rw-r--r--tests/manual/quickcontrols/material/pages/SwitchPage.qml75
3 files changed, 77 insertions, 1 deletions
diff --git a/tests/manual/quickcontrols/material/CMakeLists.txt b/tests/manual/quickcontrols/material/CMakeLists.txt
index 1cd3a98d0f..004d3e8708 100644
--- a/tests/manual/quickcontrols/material/CMakeLists.txt
+++ b/tests/manual/quickcontrols/material/CMakeLists.txt
@@ -23,6 +23,7 @@ set(qmake_immediate_resource_files
"pages/ButtonPage.qml"
"pages/DelayButtonPage.qml"
"pages/RoundButtonPage.qml"
+ "pages/SwitchPage.qml"
"qmldir"
)
diff --git a/tests/manual/quickcontrols/material/material.qml b/tests/manual/quickcontrols/material/material.qml
index 720ff0a5ec..78efaf72e3 100644
--- a/tests/manual/quickcontrols/material/material.qml
+++ b/tests/manual/quickcontrols/material/material.qml
@@ -97,7 +97,7 @@ ApplicationWindow {
focus: true
currentIndex: settings.currentControlIndex
anchors.fill: parent
- model: ["Button", "DelayButton", "RoundButton"]
+ model: ["Button", "DelayButton", "RoundButton", "Switch"]
delegate: ItemDelegate {
width: listView.width
text: modelData
diff --git a/tests/manual/quickcontrols/material/pages/SwitchPage.qml b/tests/manual/quickcontrols/material/pages/SwitchPage.qml
new file mode 100644
index 0000000000..5335fa6290
--- /dev/null
+++ b/tests/manual/quickcontrols/material/pages/SwitchPage.qml
@@ -0,0 +1,75 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+import QtQuick
+import QtQuick.Controls.Material
+import QtQuick.Layouts
+
+import ".."
+
+Page {
+ topPadding: Constants.pageTopPadding
+
+ ColumnLayout {
+ width: parent.width
+
+ RowLayout {
+ spacing: 40
+
+ Switch {
+ text: "Switch"
+ }
+
+ Switch {
+ text: "Checked Switch"
+ checked: true
+ }
+
+ Switch {
+ text: "Disabled Switch"
+ enabled: false
+ }
+
+ Switch {
+ text: "Checked disabled Switch"
+ checked: true
+ enabled: false
+ }
+
+ Item {
+ Layout.fillWidth: true
+ }
+ }
+
+ RowLayout {
+ spacing: 40
+
+ Switch {
+ text: "Switch"
+ icon.source: Constants.iconSource
+ }
+
+ Switch {
+ text: "Checked Switch"
+ icon.source: Constants.iconSource
+ checked: true
+ }
+
+ Switch {
+ text: "Disabled Switch"
+ icon.source: Constants.iconSource
+ enabled: false
+ }
+
+ Switch {
+ text: "Checked disabled Switch"
+ icon.source: Constants.iconSource
+ checked: true
+ enabled: false
+ }
+
+ Item {
+ Layout.fillWidth: true
+ }
+ }
+ }
+}