summaryrefslogtreecommitdiff
path: root/tests/manual/testbench
diff options
context:
space:
mode:
authorCaroline Chao <caroline.chao@digia.com>2013-04-05 12:36:55 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-25 19:42:17 +0200
commitf175c581ab047a39f55d5af79c071c4ec896a99c (patch)
tree5fb6471665cb366f9fdb5d8598aaa5697b6fba6a /tests/manual/testbench
parent788dd6bed414ff89dab5f01b94165ba88f3e1c20 (diff)
downloadqtquickcontrols-f175c581ab047a39f55d5af79c071c4ec896a99c.tar.gz
TestBench: Add option to load a custom style
Change-Id: I071f91837bde7827749de98150081fbf92f2cb7f Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'tests/manual/testbench')
-rw-r--r--tests/manual/testbench/content/Components.qml41
-rw-r--r--tests/manual/testbench/main.qml14
2 files changed, 55 insertions, 0 deletions
diff --git a/tests/manual/testbench/content/Components.qml b/tests/manual/testbench/content/Components.qml
index 531e68ad..aff42700 100644
--- a/tests/manual/testbench/content/Components.qml
+++ b/tests/manual/testbench/content/Components.qml
@@ -40,6 +40,7 @@
import QtQuick 2.1
import QtQuick.Controls 1.0
+import QtQuick.Controls.Styles 1.0
Item {
property Component button: Button { text: "Push me"}
@@ -130,4 +131,44 @@ Item {
append({ name: "Label", component: label});
}
}
+
+ property Component buttonStyle: ButtonStyle {}
+ property Component toolbuttonStyle: ToolButtonStyle {}
+ property Component checkboxStyle: CheckBoxStyle {}
+ property Component comboboxStyle: ComboBoxStyle {}
+ property Component radiobuttonStyle: RadioButtonStyle {}
+ property Component sliderStyle: SliderStyle {}
+ property Component progressbarStyle: ProgressBarStyle {}
+ property Component textfieldStyle: TextFieldStyle {}
+ property Component textareaStyle: null
+ property Component spinboxStyle: SpinBoxStyle {}
+ property Component toolbarStyle: ToolBarStyle {}
+ property Component statusbarStyle: StatusBarStyle {}
+ property Component tableviewStyle: TableViewStyle {}
+ property Component scrollviewStyle: ScrollViewStyle {}
+ property Component groupboxStyle: GroupBoxStyle {}
+ property Component tabViewStyle: TabViewStyle {}
+ property Component labelStyle: null
+
+ property var customStyles: ListModel {
+ Component.onCompleted: {
+ append({ name: "Button", component: buttonStyle});
+ append({ name: "ToolButton", component: toolbuttonStyle});
+ append({ name: "CheckBox", component: checkboxStyle});
+ append({ name: "ComboBox", component: comboboxStyle});
+ append({ name: "RadioButton", component: radiobuttonStyle});
+ append({ name: "Slider", component: sliderStyle});
+ append({ name: "ProgressBar", component: progressbarStyle});
+ append({ name: "TextField", component: textfieldStyle});
+ append({ name: "TextArea", component: textareaStyle});
+ append({ name: "SpinBox", component: spinboxStyle});
+ append({ name: "ToolBar", component: toolbarStyle});
+ append({ name: "StatusBar", component: statusbarStyle});
+ append({ name: "TableView", component: tableviewStyle});
+ append({ name: "ScrollView", component: scrollviewStyle});
+ append({ name: "GroupBox", component: groupboxStyle});
+ append({ name: "TabView", component: tabViewStyle});
+ append({ name: "Label", component: labelStyle});
+ }
+ }
}
diff --git a/tests/manual/testbench/main.qml b/tests/manual/testbench/main.qml
index 6c0cfaf3..3fe9facc 100644
--- a/tests/manual/testbench/main.qml
+++ b/tests/manual/testbench/main.qml
@@ -79,6 +79,18 @@ ApplicationWindow {
checked: false
text: "Background"
}
+ CheckBox {
+ id: customStyle
+ visible: components.customStyles.get(selector.currentIndex).component !== undefined
+ checked: false
+ text: !checked ? "Load Custom Style" : "Custom Style loaded"
+ onCheckedChanged: {
+ if (checked) {
+ loader.item.style = components.customStyles.get(selector.currentIndex).component
+ enabled = false
+ }
+ }
+ }
}
CheckBox {
@@ -158,6 +170,8 @@ ApplicationWindow {
onStatusChanged: {
startStopAnim.visible = false
+ customStyle.enabled = true
+ customStyle.checked = false
if (status == Loader.Ready) {
propertyMap = []