aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@theqtcompany.com>2015-10-21 15:01:33 +0200
committerMitch Curtis <mitch.curtis@theqtcompany.com>2015-10-21 13:36:36 +0000
commit8e1df766cf9e74661b50de4f4ed489af5b4edfc8 (patch)
tree690eed7ebb2c536053b93f3b6dbbe40d7c3fa4a7 /tests
parent0d220ed532cd3a034e754d7a0cca21c04f27744d (diff)
Add testbench as a manual test
This allows us to see every state for each control, and will help with collaboration with designers. Change-Id: I5589b05ef3abf768d26f14bbd85aa674107d956b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/testbench/deployment.pri14
-rw-r--r--tests/manual/testbench/main.cpp53
-rw-r--r--tests/manual/testbench/main.qml413
-rw-r--r--tests/manual/testbench/qml.qrc6
-rw-r--r--tests/manual/testbench/testbench.pro15
5 files changed, 501 insertions, 0 deletions
diff --git a/tests/manual/testbench/deployment.pri b/tests/manual/testbench/deployment.pri
new file mode 100644
index 00000000..c89af25a
--- /dev/null
+++ b/tests/manual/testbench/deployment.pri
@@ -0,0 +1,14 @@
+unix:!android {
+ isEmpty(target.path) {
+ qnx {
+ target.path = /tmp/$${TARGET}/bin
+ } else {
+ target.path = /opt/$${TARGET}/bin
+ }
+ export(target.path)
+ }
+ INSTALLS += target
+}
+
+export(INSTALLS)
+
diff --git a/tests/manual/testbench/main.cpp b/tests/manual/testbench/main.cpp
new file mode 100644
index 00000000..6462562a
--- /dev/null
+++ b/tests/manual/testbench/main.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
+
+ return app.exec();
+}
+
diff --git a/tests/manual/testbench/main.qml b/tests/manual/testbench/main.qml
new file mode 100644
index 00000000..44d7678d
--- /dev/null
+++ b/tests/manual/testbench/main.qml
@@ -0,0 +1,413 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.3
+import QtQuick.Window 2.2
+import QtQuick.Layouts 1.0
+import Qt.labs.controls 1.0
+
+ApplicationWindow {
+ visible: true
+ width: 700
+ height: 1000
+
+ Flow {
+ id: mainColumn
+ anchors.fill: parent
+ anchors.margins: 30
+ spacing: 30
+
+ RowLayout {
+ BusyIndicator {
+ }
+ BusyIndicator {
+ enabled: false
+ }
+ }
+
+ RowLayout {
+ Button {
+ text: "Normal"
+ }
+ Button {
+ text: "Pressed"
+ pressed: true
+ }
+ Button {
+ text: "Disabled"
+ enabled: false
+ }
+ }
+
+ RowLayout {
+ CheckBox {
+ text: "Normal"
+ }
+ CheckBox {
+ text: "Pressed"
+ pressed: true
+ }
+ CheckBox {
+ text: "Checked"
+ checked: true
+ }
+ CheckBox {
+ text: "Checked + Pressed"
+ checked: true
+ pressed: true
+ }
+ CheckBox {
+ text: "Disabled"
+ enabled: false
+ }
+ }
+
+ RowLayout {
+ Dial {
+ }
+ Dial {
+ enabled: false
+ }
+ }
+
+ RowLayout {
+ Frame {
+ Text {
+ text: "Normal"
+ }
+ }
+ Frame {
+ enabled: false
+
+ Text {
+ text: "Disabled"
+ }
+ }
+ }
+
+ RowLayout {
+ GroupBox {
+ title: "Normal"
+
+ Item {
+ width: 100
+ height: 20
+ }
+ }
+ GroupBox {
+ enabled: false
+ title: "Disabled"
+
+ Item {
+ width: 100
+ height: 20
+ }
+ }
+ }
+
+ RowLayout {
+ Label {
+ text: "Normal"
+ }
+ Label {
+ text: "Disabled"
+ enabled: false
+ }
+ }
+
+ RowLayout {
+ PageIndicator {
+ count: 5
+ }
+ PageIndicator {
+ count: 5
+ enabled: false
+ }
+ }
+
+ RowLayout {
+ ProgressBar {
+ value: 0.5
+ }
+ ProgressBar {
+ value: 0.5
+ enabled: false
+ }
+ }
+
+ RowLayout {
+ RadioButton {
+ text: "Normal"
+ }
+ RadioButton {
+ text: "Pressed"
+ pressed: true
+ }
+ RadioButton {
+ text: "Checked"
+ checked: true
+ }
+ RadioButton {
+ text: "Checked + Pressed"
+ checked: true
+ pressed: true
+ }
+ RadioButton {
+ text: "Disabled"
+ enabled: false
+ }
+ }
+
+ RowLayout {
+ RangeSlider {
+ first.value: 0.25
+ second.value: 0.75
+ }
+ RangeSlider {
+ first.value: 0.25
+ first.pressed: true
+ second.value: 0.75
+ }
+ RangeSlider {
+ first.value: 0.25
+ second.value: 0.75
+ enabled: false
+ }
+ }
+
+ RowLayout {
+ Rectangle {
+ width: 100
+ height: 100
+ border.color: Theme.frameColor
+
+ ScrollBar {
+ size: 0.3
+ position: 0.2
+ active: true
+ orientation: Qt.Vertical
+ height: parent.height
+ anchors.right: parent.right
+ }
+ }
+
+ Rectangle {
+ width: 100
+ height: 100
+ border.color: Theme.frameColor
+
+ ScrollBar {
+ size: 0.3
+ position: 0.2
+ active: true
+ orientation: Qt.Vertical
+ height: parent.height
+ anchors.right: parent.right
+ pressed: true
+ }
+ }
+
+ Rectangle {
+ width: 100
+ height: 100
+ border.color: Theme.frameColor
+
+ ScrollBar {
+ size: 0.3
+ position: 0.2
+ active: true
+ orientation: Qt.Vertical
+ height: parent.height
+ anchors.right: parent.right
+ enabled: false
+ }
+ }
+ }
+
+ RowLayout {
+ Rectangle {
+ width: 100
+ height: 100
+ border.color: Theme.frameColor
+
+ ScrollIndicator {
+ size: 0.3
+ position: 0.2
+ active: true
+ orientation: Qt.Vertical
+ height: parent.height
+ anchors.right: parent.right
+ }
+ }
+
+ Rectangle {
+ width: 100
+ height: 100
+ border.color: Theme.frameColor
+
+ ScrollIndicator {
+ size: 0.3
+ position: 0.2
+ active: true
+ orientation: Qt.Vertical
+ height: parent.height
+ anchors.right: parent.right
+ enabled: false
+ }
+ }
+ }
+
+ RowLayout {
+ Slider {
+ value: 0.5
+ }
+ Slider {
+ value: 0.5
+ pressed: true
+ }
+ Slider {
+ value: 0.5
+ enabled: false
+ }
+ }
+
+ RowLayout {
+ Switch {
+ text: "Normal"
+ }
+ Switch {
+ text: "Pressed"
+ pressed: true
+ }
+ Switch {
+ text: "Checked"
+ checked: true
+ }
+ Switch {
+ text: "Checked + Pressed"
+ checked: true
+ pressed: true
+ }
+ Switch {
+ text: "Disabled"
+ enabled: false
+ }
+ }
+
+ RowLayout {
+ TabBar {
+ TabButton {
+ text: "Normal"
+ }
+ TabButton {
+ text: "Pressed"
+ pressed: true
+ }
+ TabButton {
+ text: "Disabled"
+ enabled: false
+ }
+ }
+ }
+
+ RowLayout {
+ TextArea {
+ text: "Normal"
+ }
+ TextArea {
+ text: "Disabled"
+ enabled: false
+ }
+ }
+
+ RowLayout {
+ TextField {
+ text: "Normal"
+ }
+ TextField {
+ text: "Disabled"
+ enabled: false
+ }
+ }
+
+ RowLayout {
+ ToolBar {
+ Row {
+ ToolButton {
+ text: "Normal"
+ }
+ ToolButton {
+ text: "Pressed"
+ pressed: true
+ }
+ ToolButton {
+ text: "Disabled"
+ enabled: false
+ }
+ }
+ }
+ }
+
+ RowLayout {
+ Rectangle {
+ width: 100
+ height: 100
+ border.color: Theme.frameColor
+
+ Tumbler {
+ model: 5
+ anchors.fill: parent
+ }
+ }
+ Rectangle {
+ width: 100
+ height: 100
+ border.color: Theme.frameColor
+
+ Tumbler {
+ model: 5
+ anchors.fill: parent
+ enabled: false
+ }
+ }
+ }
+ }
+}
+
diff --git a/tests/manual/testbench/qml.qrc b/tests/manual/testbench/qml.qrc
new file mode 100644
index 00000000..0ff3892d
--- /dev/null
+++ b/tests/manual/testbench/qml.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource prefix="/">
+ <file>main.qml</file>
+ </qresource>
+</RCC>
+
diff --git a/tests/manual/testbench/testbench.pro b/tests/manual/testbench/testbench.pro
new file mode 100644
index 00000000..92eef0a0
--- /dev/null
+++ b/tests/manual/testbench/testbench.pro
@@ -0,0 +1,15 @@
+TEMPLATE = app
+
+QT += qml quick
+CONFIG += c++11
+
+SOURCES += main.cpp
+
+RESOURCES += qml.qrc
+
+# Additional import path used to resolve QML modules in Qt Creator's code model
+QML_IMPORT_PATH =
+
+# Default rules for deployment.
+include(deployment.pri)
+