aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-12-19 12:53:44 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-12-20 13:36:18 +0000
commit4367be99cc89c733b8667a30c8a82dac21ba08bb (patch)
tree4085b1332ff2720d5e0f63a144aef0071e1cabbe
parentaaedef9fec97329b7ca5568670de571f5b8e8df8 (diff)
Make tst_customization easier to maintain
Maintain the tested controls and delegates in a single array that can be re-used for testing all styles without repetitive and error-prone hand-written data rows. For this to work, the structure of the tested styles must match. The "incomplete" and "override" styles filled in all possible delegates, whereas the "simple" style filled in only the normally used delegates. The test styles have now been synced with the structure of our built- in styles. For example, Dials and Sliders don't normally have a content item, and CheckBoxes and RadioButtons don't normally have a background. Change-Id: I48a26ee170f66882c55b54a282f2e4b3a3875f9a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--tests/auto/customization/data/styles/incomplete/CheckBox.qml4
-rw-r--r--tests/auto/customization/data/styles/incomplete/Dial.qml4
-rw-r--r--tests/auto/customization/data/styles/incomplete/RadioButton.qml4
-rw-r--r--tests/auto/customization/data/styles/incomplete/RangeSlider.qml4
-rw-r--r--tests/auto/customization/data/styles/incomplete/ScrollView.qml4
-rw-r--r--tests/auto/customization/data/styles/incomplete/Slider.qml4
-rw-r--r--tests/auto/customization/data/styles/incomplete/Switch.qml4
-rw-r--r--tests/auto/customization/data/styles/override/CheckBox.qml4
-rw-r--r--tests/auto/customization/data/styles/override/Dial.qml4
-rw-r--r--tests/auto/customization/data/styles/override/RadioButton.qml4
-rw-r--r--tests/auto/customization/data/styles/override/RangeSlider.qml4
-rw-r--r--tests/auto/customization/data/styles/override/ScrollView.qml4
-rw-r--r--tests/auto/customization/data/styles/override/Slider.qml4
-rw-r--r--tests/auto/customization/data/styles/override/Switch.qml4
-rw-r--r--tests/auto/customization/data/styles/simple/ScrollView.qml4
-rw-r--r--tests/auto/customization/tst_customization.cpp265
16 files changed, 69 insertions, 256 deletions
diff --git a/tests/auto/customization/data/styles/incomplete/CheckBox.qml b/tests/auto/customization/data/styles/incomplete/CheckBox.qml
index 2f1afa7a..3c299892 100644
--- a/tests/auto/customization/data/styles/incomplete/CheckBox.qml
+++ b/tests/auto/customization/data/styles/incomplete/CheckBox.qml
@@ -62,8 +62,4 @@ T.CheckBox {
contentItem: Item {
objectName: "checkbox-contentItem-incomplete"
}
-
- background: Item {
- objectName: "checkbox-background-incomplete"
- }
}
diff --git a/tests/auto/customization/data/styles/incomplete/Dial.qml b/tests/auto/customization/data/styles/incomplete/Dial.qml
index 3e896cdf..bc318f72 100644
--- a/tests/auto/customization/data/styles/incomplete/Dial.qml
+++ b/tests/auto/customization/data/styles/incomplete/Dial.qml
@@ -59,10 +59,6 @@ T.Dial {
objectName: "dial-handle-incomplete"
}
- contentItem: Item {
- objectName: "dial-contentItem-incomplete"
- }
-
background: Item {
objectName: "dial-background-incomplete"
}
diff --git a/tests/auto/customization/data/styles/incomplete/RadioButton.qml b/tests/auto/customization/data/styles/incomplete/RadioButton.qml
index 8def1447..28b62af9 100644
--- a/tests/auto/customization/data/styles/incomplete/RadioButton.qml
+++ b/tests/auto/customization/data/styles/incomplete/RadioButton.qml
@@ -62,8 +62,4 @@ T.RadioButton {
contentItem: Item {
objectName: "radiobutton-contentItem-incomplete"
}
-
- background: Item {
- objectName: "radiobutton-background-incomplete"
- }
}
diff --git a/tests/auto/customization/data/styles/incomplete/RangeSlider.qml b/tests/auto/customization/data/styles/incomplete/RangeSlider.qml
index 1905d7ec..3bc3dfcb 100644
--- a/tests/auto/customization/data/styles/incomplete/RangeSlider.qml
+++ b/tests/auto/customization/data/styles/incomplete/RangeSlider.qml
@@ -63,10 +63,6 @@ T.RangeSlider {
objectName: "rangeslider-second.handle-incomplete"
}
- contentItem: Item {
- objectName: "rangeslider-contentItem-incomplete"
- }
-
background: Item {
objectName: "rangeslider-background-incomplete"
}
diff --git a/tests/auto/customization/data/styles/incomplete/ScrollView.qml b/tests/auto/customization/data/styles/incomplete/ScrollView.qml
index ef0d6f36..48088a67 100644
--- a/tests/auto/customization/data/styles/incomplete/ScrollView.qml
+++ b/tests/auto/customization/data/styles/incomplete/ScrollView.qml
@@ -55,10 +55,6 @@ T.ScrollView {
id: control
objectName: "scrollview-incomplete"
- contentItem: Flickable {
- objectName: "scrollview-contentItem-incomplete"
- }
-
background: Item {
objectName: "scrollview-background-incomplete"
}
diff --git a/tests/auto/customization/data/styles/incomplete/Slider.qml b/tests/auto/customization/data/styles/incomplete/Slider.qml
index 1dfa4d59..54978965 100644
--- a/tests/auto/customization/data/styles/incomplete/Slider.qml
+++ b/tests/auto/customization/data/styles/incomplete/Slider.qml
@@ -59,10 +59,6 @@ T.Slider {
objectName: "slider-handle-incomplete"
}
- contentItem: Item {
- objectName: "slider-contentItem-incomplete"
- }
-
background: Item {
objectName: "slider-background-incomplete"
}
diff --git a/tests/auto/customization/data/styles/incomplete/Switch.qml b/tests/auto/customization/data/styles/incomplete/Switch.qml
index ef661b43..94f6cd8b 100644
--- a/tests/auto/customization/data/styles/incomplete/Switch.qml
+++ b/tests/auto/customization/data/styles/incomplete/Switch.qml
@@ -62,8 +62,4 @@ T.Switch {
contentItem: Item {
objectName: "switch-contentItem-incomplete"
}
-
- background: Item {
- objectName: "switch-background-incomplete"
- }
}
diff --git a/tests/auto/customization/data/styles/override/CheckBox.qml b/tests/auto/customization/data/styles/override/CheckBox.qml
index 538cbdb1..dfaba8a4 100644
--- a/tests/auto/customization/data/styles/override/CheckBox.qml
+++ b/tests/auto/customization/data/styles/override/CheckBox.qml
@@ -62,8 +62,4 @@ Simple.CheckBox {
contentItem: Item {
objectName: "checkbox-contentItem-override"
}
-
- background: Item {
- objectName: "checkbox-background-override"
- }
}
diff --git a/tests/auto/customization/data/styles/override/Dial.qml b/tests/auto/customization/data/styles/override/Dial.qml
index f843a4ca..4b84a30a 100644
--- a/tests/auto/customization/data/styles/override/Dial.qml
+++ b/tests/auto/customization/data/styles/override/Dial.qml
@@ -59,10 +59,6 @@ Simple.Dial {
objectName: "dial-handle-override"
}
- contentItem: Item {
- objectName: "dial-contentItem-override"
- }
-
background: Item {
objectName: "dial-background-override"
}
diff --git a/tests/auto/customization/data/styles/override/RadioButton.qml b/tests/auto/customization/data/styles/override/RadioButton.qml
index 0ecec7e3..42397f08 100644
--- a/tests/auto/customization/data/styles/override/RadioButton.qml
+++ b/tests/auto/customization/data/styles/override/RadioButton.qml
@@ -62,8 +62,4 @@ Simple.RadioButton {
contentItem: Item {
objectName: "radiobutton-contentItem-override"
}
-
- background: Item {
- objectName: "radiobutton-background-override"
- }
}
diff --git a/tests/auto/customization/data/styles/override/RangeSlider.qml b/tests/auto/customization/data/styles/override/RangeSlider.qml
index b10ff8a2..575926e5 100644
--- a/tests/auto/customization/data/styles/override/RangeSlider.qml
+++ b/tests/auto/customization/data/styles/override/RangeSlider.qml
@@ -63,10 +63,6 @@ Simple.RangeSlider {
objectName: "rangeslider-second.handle-override"
}
- contentItem: Item {
- objectName: "rangeslider-contentItem-override"
- }
-
background: Item {
objectName: "rangeslider-background-override"
}
diff --git a/tests/auto/customization/data/styles/override/ScrollView.qml b/tests/auto/customization/data/styles/override/ScrollView.qml
index 0c8bd774..040c9815 100644
--- a/tests/auto/customization/data/styles/override/ScrollView.qml
+++ b/tests/auto/customization/data/styles/override/ScrollView.qml
@@ -55,10 +55,6 @@ Simple.ScrollView {
id: control
objectName: "scrollview-override"
- contentItem: Flickable {
- objectName: "scrollview-contentItem-override"
- }
-
background: Item {
objectName: "scrollview-background-override"
}
diff --git a/tests/auto/customization/data/styles/override/Slider.qml b/tests/auto/customization/data/styles/override/Slider.qml
index dc4fb8d7..0ca6f6c4 100644
--- a/tests/auto/customization/data/styles/override/Slider.qml
+++ b/tests/auto/customization/data/styles/override/Slider.qml
@@ -59,10 +59,6 @@ Simple.Slider {
objectName: "slider-handle-override"
}
- contentItem: Item {
- objectName: "slider-contentItem-override"
- }
-
background: Item {
objectName: "slider-background-override"
}
diff --git a/tests/auto/customization/data/styles/override/Switch.qml b/tests/auto/customization/data/styles/override/Switch.qml
index 60e7c829..4ab8ffe7 100644
--- a/tests/auto/customization/data/styles/override/Switch.qml
+++ b/tests/auto/customization/data/styles/override/Switch.qml
@@ -62,8 +62,4 @@ Simple.Switch {
contentItem: Item {
objectName: "switch-contentItem-override"
}
-
- background: Item {
- objectName: "switch-background-override"
- }
}
diff --git a/tests/auto/customization/data/styles/simple/ScrollView.qml b/tests/auto/customization/data/styles/simple/ScrollView.qml
index d0b0c5d8..1aabc897 100644
--- a/tests/auto/customization/data/styles/simple/ScrollView.qml
+++ b/tests/auto/customization/data/styles/simple/ScrollView.qml
@@ -58,10 +58,6 @@ T.ScrollView {
implicitWidth: Math.max(contentItem.implicitWidth, background.implicitWidth)
implicitHeight: Math.max(contentItem.implicitHeight, background.implicitHeight)
- contentItem: Flickable {
- objectName: "scrollview-contentItem-simple"
- }
-
background: Rectangle {
objectName: "scrollview-background-simple"
}
diff --git a/tests/auto/customization/tst_customization.cpp b/tests/auto/customization/tst_customization.cpp
index 34c56785..10525e9e 100644
--- a/tests/auto/customization/tst_customization.cpp
+++ b/tests/auto/customization/tst_customization.cpp
@@ -46,6 +46,64 @@
using namespace QQuickVisualTestUtil;
+struct ControlInfo
+{
+ QString type;
+ QStringList delegates;
+};
+
+static const ControlInfo ControlInfos[] = {
+ { "AbstractButton", QStringList() << "background" << "contentItem" << "indicator" },
+ { "ApplicationWindow", QStringList() << "background" },
+ { "BusyIndicator", QStringList() << "background" << "contentItem" },
+ { "Button", QStringList() << "background" << "contentItem" },
+ { "CheckBox", QStringList() << "contentItem" << "indicator" },
+ { "CheckDelegate", QStringList() << "background" << "contentItem" << "indicator" },
+ { "ComboBox", QStringList() << "background" << "contentItem" << "indicator" }, // popup not created until needed
+ { "Container", QStringList() << "background" << "contentItem" },
+ { "Control", QStringList() << "background" << "contentItem" },
+ { "DelayButton", QStringList() << "background" << "contentItem" },
+ { "Dial", QStringList() << "background" << "handle" },
+ { "Dialog", QStringList() << "background" << "contentItem" },
+ { "DialogButtonBox", QStringList() << "background" << "contentItem" },
+ { "Drawer", QStringList() << "background" << "contentItem" },
+ { "Frame", QStringList() << "background" << "contentItem" },
+ { "GroupBox", QStringList() << "background" << "contentItem" << "label" },
+ { "ItemDelegate", QStringList() << "background" << "contentItem" },
+ { "Label", QStringList() << "background" },
+ { "Menu", QStringList() << "background" << "contentItem" },
+ { "MenuItem", QStringList() << "background" << "contentItem" << "indicator" },
+ { "MenuSeparator", QStringList() << "background" << "contentItem" },
+ { "Page", QStringList() << "background" << "contentItem" },
+ { "PageIndicator", QStringList() << "background" << "contentItem" },
+ { "Pane", QStringList() << "background" << "contentItem" },
+ { "Popup", QStringList() << "background" << "contentItem" },
+ { "ProgressBar", QStringList() << "background" << "contentItem" },
+ { "RadioButton", QStringList() << "contentItem" << "indicator" },
+ { "RadioDelegate", QStringList() << "background" << "contentItem" << "indicator" },
+ { "RangeSlider", QStringList() << "background" << "first.handle" << "second.handle" },
+ { "RoundButton", QStringList() << "background" << "contentItem" },
+ { "ScrollBar", QStringList() << "background" << "contentItem" },
+ { "ScrollIndicator", QStringList() << "background" << "contentItem" },
+ { "ScrollView", QStringList() << "background" },
+ { "Slider", QStringList() << "background" << "handle" },
+ { "SpinBox", QStringList() << "background" << "contentItem" << "up.indicator" << "down.indicator" },
+ { "StackView", QStringList() << "background" << "contentItem" },
+ { "SwipeDelegate", QStringList() << "background" << "contentItem" },
+ { "SwipeView", QStringList() << "background" << "contentItem" },
+ { "Switch", QStringList() << "contentItem" << "indicator" },
+ { "SwitchDelegate", QStringList() << "background" << "contentItem" << "indicator" },
+ { "TabBar", QStringList() << "background" << "contentItem" },
+ { "TabButton", QStringList() << "background" << "contentItem" },
+ { "TextField", QStringList() << "background" },
+ { "TextArea", QStringList() << "background" },
+ { "ToolBar", QStringList() << "background" << "contentItem" },
+ { "ToolButton", QStringList() << "background" << "contentItem" },
+ { "ToolSeparator", QStringList() << "background" << "contentItem" },
+ { "ToolTip", QStringList() << "background" << "contentItem" },
+ { "Tumbler", QStringList() << "background" << "contentItem" }
+};
+
class tst_customization : public QQmlDataTest
{
Q_OBJECT
@@ -140,208 +198,20 @@ void tst_customization::creation_data()
QTest::addColumn<QStringList>("delegates");
// the "empty" style does not contain any delegates
- QTest::newRow("empty:AbstractButton") << "empty" << "AbstractButton"<< QStringList();
- QTest::newRow("empty:ApplicationWindow") << "empty" << "ApplicationWindow"<< QStringList();
- QTest::newRow("empty:BusyIndicator") << "empty" << "BusyIndicator"<< QStringList();
- QTest::newRow("empty:Button") << "empty" << "Button"<< QStringList();
- QTest::newRow("empty:CheckBox") << "empty" << "CheckBox" << QStringList();
- QTest::newRow("empty:CheckDelegate") << "empty" << "CheckDelegate" << QStringList();
- QTest::newRow("empty:ComboBox") << "empty" << "ComboBox" << QStringList();
- QTest::newRow("empty:Container") << "empty" << "Container"<< QStringList();
- QTest::newRow("empty:Control") << "empty" << "Control"<< QStringList();
- QTest::newRow("empty:DelayButton") << "empty" << "DelayButton"<< QStringList();
- QTest::newRow("empty:Dial") << "empty" << "Dial" << QStringList();
- QTest::newRow("empty:Dialog") << "empty" << "Dialog" << QStringList();
- QTest::newRow("empty:DialogButtonBox") << "empty" << "DialogButtonBox" << QStringList();
- QTest::newRow("empty:Drawer") << "empty" << "Drawer" << QStringList();
- QTest::newRow("empty:Frame") << "empty" << "Frame"<< QStringList();
- QTest::newRow("empty:GroupBox") << "empty" << "GroupBox"<< QStringList();
- QTest::newRow("empty:ItemDelegate") << "empty" << "ItemDelegate" << QStringList();
- QTest::newRow("empty:Label") << "empty" << "Label"<< QStringList();
- QTest::newRow("empty:Menu") << "empty" << "Menu" << QStringList();
- QTest::newRow("empty:MenuItem") << "empty" << "MenuItem"<< QStringList();
- QTest::newRow("empty:MenuSeparator") << "empty" << "MenuSeparator"<< QStringList();
- QTest::newRow("empty:Page") << "empty" << "Page"<< QStringList();
- QTest::newRow("empty:PageIndicator") << "empty" << "PageIndicator"<< QStringList();
- QTest::newRow("empty:Pane") << "empty" << "Pane"<< QStringList();
- QTest::newRow("empty:Popup") << "empty" << "Popup" << QStringList();
- QTest::newRow("empty:ProgressBar") << "empty" << "ProgressBar"<< QStringList();
- QTest::newRow("empty:RadioButton") << "empty" << "RadioButton" << QStringList();
- QTest::newRow("empty:RadioDelegate") << "empty" << "RadioDelegate" << QStringList();
- QTest::newRow("empty:RangeSlider") << "empty" << "RangeSlider" << QStringList();
- QTest::newRow("empty:RoundButton") << "empty" << "RoundButton" << QStringList();
- QTest::newRow("empty:ScrollBar") << "empty" << "ScrollBar"<< QStringList();
- QTest::newRow("empty:ScrollIndicator") << "empty" << "ScrollIndicator"<< QStringList();
- QTest::newRow("empty:ScrollView") << "empty" << "ScrollView"<< QStringList();
- QTest::newRow("empty:Slider") << "empty" << "Slider" << QStringList();
- QTest::newRow("empty:SpinBox") << "empty" << "SpinBox" << QStringList();
- QTest::newRow("empty:StackView") << "empty" << "StackView" << QStringList();
- QTest::newRow("empty:SwipeDelegate") << "empty" << "SwipeDelegate" << QStringList();
- QTest::newRow("empty:SwipeView") << "empty" << "SwipeView" << QStringList();
- QTest::newRow("empty:Switch") << "empty" << "Switch" << QStringList();
- QTest::newRow("empty:SwitchDelegate") << "empty" << "SwitchDelegate" << QStringList();
- QTest::newRow("empty:TabBar") << "empty" << "TabBar"<< QStringList();
- QTest::newRow("empty:TabButton") << "empty" << "TabButton"<< QStringList();
- QTest::newRow("empty:TextField") << "empty" << "TextField"<< QStringList();
- QTest::newRow("empty:TextArea") << "empty" << "TextArea"<< QStringList();
- QTest::newRow("empty:ToolBar") << "empty" << "ToolBar"<< QStringList();
- QTest::newRow("empty:ToolButton") << "empty" << "ToolButton"<< QStringList();
- QTest::newRow("empty:ToolSeparator") << "empty" << "ToolSeparator"<< QStringList();
- QTest::newRow("empty:ToolTip") << "empty" << "ToolTip"<< QStringList();
- // QTest::newRow("empty:Tumbler") << "empty" << "Tumbler"<< QStringList(); // ### TODO: fix crash with contentItem-less Tumbler
+ for (const ControlInfo &control : ControlInfos)
+ QTest::newRow(qPrintable("empty:" + control.type)) << "empty" << control.type << QStringList();
// the "incomplete" style is missing bindings to the delegates (must be created regardless)
- QTest::newRow("incomplete:AbstractButton") << "incomplete" << "AbstractButton" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("incomplete:ApplicationWindow") << "incomplete" << "ApplicationWindow" << (QStringList() << "background");
- QTest::newRow("incomplete:BusyIndicator") << "incomplete" << "BusyIndicator" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:Button") << "incomplete" << "Button" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:CheckBox") << "incomplete" << "CheckBox" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("incomplete:CheckDelegate") << "incomplete" << "CheckDelegate" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("incomplete:ComboBox") << "incomplete" << "ComboBox" << (QStringList() << "background" << "contentItem" << "indicator"); // popup not created until needed
- QTest::newRow("incomplete:Container") << "incomplete" << "Container" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:Control") << "incomplete" << "Control" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:DelayButton") << "incomplete" << "DelayButton" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:Dial") << "incomplete" << "Dial" << (QStringList() << "background" << "contentItem" << "handle");
- QTest::newRow("incomplete:Dialog") << "incomplete" << "Dialog" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:DialogButtonBox") << "incomplete" << "DialogButtonBox" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:Drawer") << "incomplete" << "Drawer" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:Frame") << "incomplete" << "Frame"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:GroupBox") << "incomplete" << "GroupBox"<< (QStringList() << "background" << "contentItem" << "label");
- QTest::newRow("incomplete:ItemDelegate") << "incomplete" << "ItemDelegate" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:Label") << "incomplete" << "Label" << (QStringList() << "background");
- QTest::newRow("incomplete:Menu") << "incomplete" << "Menu" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:MenuItem") << "incomplete" << "MenuItem" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("incomplete:MenuSeparator") << "incomplete" << "MenuSeparator" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:Page") << "incomplete" << "Page" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:PageIndicator") << "incomplete" << "PageIndicator" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:Pane") << "incomplete" << "Pane" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:Popup") << "incomplete" << "Popup" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:ProgressBar") << "incomplete" << "ProgressBar" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:RadioButton") << "incomplete" << "RadioButton" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("incomplete:RadioDelegate") << "incomplete" << "RadioDelegate" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("incomplete:RangeSlider") << "incomplete" << "RangeSlider" << (QStringList() << "background" << "contentItem" << "first.handle" << "second.handle");
- QTest::newRow("incomplete:RoundButton") << "incomplete" << "RoundButton" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:ScrollBar") << "incomplete" << "ScrollBar" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:ScrollIndicator") << "incomplete" << "ScrollIndicator" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:ScrollView") << "incomplete" << "ScrollView" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:Slider") << "incomplete" << "Slider" << (QStringList() << "background" << "contentItem" << "handle");
- QTest::newRow("incomplete:SpinBox") << "incomplete" << "SpinBox" << (QStringList() << "background" << "contentItem" << "up.indicator" << "down.indicator");
- QTest::newRow("incomplete:StackView") << "incomplete" << "StackView" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:SwipeDelegate") << "incomplete" << "SwipeDelegate" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:SwipeView") << "incomplete" << "SwipeView" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:Switch") << "incomplete" << "Switch" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("incomplete:SwitchDelegate") << "incomplete" << "SwitchDelegate" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("incomplete:TabBar") << "incomplete" << "TabBar"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:TabButton") << "incomplete" << "TabButton"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:TextField") << "incomplete" << "TextField" << (QStringList() << "background");
- QTest::newRow("incomplete:TextArea") << "incomplete" << "TextArea" << (QStringList() << "background");
- QTest::newRow("incomplete:ToolBar") << "incomplete" << "ToolBar"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:ToolButton") << "incomplete" << "ToolButton"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:ToolSeparator") << "incomplete" << "ToolSeparator"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:ToolTip") << "incomplete" << "ToolTip" << (QStringList() << "background" << "contentItem");
- QTest::newRow("incomplete:Tumbler") << "incomplete" << "Tumbler"<< (QStringList() << "background" << "contentItem");
+ for (const ControlInfo &control : ControlInfos)
+ QTest::newRow(qPrintable("incomplete:" + control.type)) << "incomplete" << control.type << control.delegates;
// the "simple" style simulates a proper style and contains bindings to/in delegates
- QTest::newRow("simple:AbstractButton") << "simple" << "AbstractButton" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("simple:ApplicationWindow") << "simple" << "ApplicationWindow" << (QStringList() << "background");
- QTest::newRow("simple:BusyIndicator") << "simple" << "BusyIndicator" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:Button") << "simple" << "Button" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:CheckBox") << "simple" << "CheckBox" << (QStringList() << "contentItem" << "indicator");
- QTest::newRow("simple:CheckDelegate") << "simple" << "CheckDelegate" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("simple:ComboBox") << "simple" << "ComboBox" << (QStringList() << "background" << "contentItem" << "indicator"); // popup not created until needed
- QTest::newRow("simple:Container") << "simple" << "Container" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:Control") << "simple" << "Control" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:DelayButton") << "simple" << "DelayButton" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:Dial") << "simple" << "Dial" << (QStringList() << "background" << "handle");
- QTest::newRow("simple:Dialog") << "simple" << "Dialog" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:DialogButtonBox") << "simple" << "DialogButtonBox" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:Drawer") << "simple" << "Drawer" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:Frame") << "simple" << "Frame"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:GroupBox") << "simple" << "GroupBox"<< (QStringList() << "background" << "contentItem" << "label");
- QTest::newRow("simple:ItemDelegate") << "simple" << "ItemDelegate" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:Label") << "simple" << "Label" << (QStringList() << "background");
- QTest::newRow("simple:Menu") << "simple" << "Menu" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:MenuItem") << "simple" << "MenuItem" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("simple:MenuSeparator") << "simple" << "MenuSeparator" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:Page") << "simple" << "Page" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:PageIndicator") << "simple" << "PageIndicator" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:Pane") << "simple" << "Pane" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:Popup") << "simple" << "Popup" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:ProgressBar") << "simple" << "ProgressBar" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:RadioButton") << "simple" << "RadioButton" << (QStringList() << "contentItem" << "indicator");
- QTest::newRow("simple:RadioDelegate") << "simple" << "RadioDelegate" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("simple:RangeSlider") << "simple" << "RangeSlider" << (QStringList() << "background" << "first.handle" << "second.handle");
- QTest::newRow("simple:RoundButton") << "simple" << "RoundButton" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:ScrollBar") << "simple" << "ScrollBar" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:ScrollIndicator") << "simple" << "ScrollIndicator" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:ScrollView") << "simple" << "ScrollView" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:Slider") << "simple" << "Slider" << (QStringList() << "background" << "handle");
- QTest::newRow("simple:SpinBox") << "simple" << "SpinBox" << (QStringList() << "background" << "contentItem" << "up.indicator" << "down.indicator");
- QTest::newRow("simple:StackView") << "simple" << "StackView" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:SwipeDelegate") << "simple" << "SwipeDelegate" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:SwipeView") << "simple" << "SwipeView" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:Switch") << "simple" << "Switch" << (QStringList() << "contentItem" << "indicator");
- QTest::newRow("simple:SwitchDelegate") << "simple" << "SwitchDelegate" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("simple:TabBar") << "simple" << "TabBar"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:TabButton") << "simple" << "TabButton"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:TextField") << "simple" << "TextField" << (QStringList() << "background");
- QTest::newRow("simple:TextArea") << "simple" << "TextArea" << (QStringList() << "background");
- QTest::newRow("simple:ToolBar") << "simple" << "ToolBar"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:ToolButton") << "simple" << "ToolButton"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:ToolSeparator") << "simple" << "ToolSeparator"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:ToolTip") << "simple" << "ToolTip" << (QStringList() << "background" << "contentItem");
- QTest::newRow("simple:Tumbler") << "simple" << "Tumbler"<< (QStringList() << "background" << "contentItem");
+ for (const ControlInfo &control : ControlInfos)
+ QTest::newRow(qPrintable("simple:" + control.type)) << "simple" << control.type << control.delegates;
// the "override" style overrides all delegates in the "simple" style
- QTest::newRow("override:AbstractButton") << "override" << "AbstractButton" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("override:ApplicationWindow") << "override" << "ApplicationWindow" << (QStringList() << "background");
- QTest::newRow("override:BusyIndicator") << "override" << "BusyIndicator" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:Button") << "override" << "Button" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:CheckBox") << "override" << "CheckBox" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("override:CheckDelegate") << "override" << "CheckDelegate" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("override:ComboBox") << "override" << "ComboBox" << (QStringList() << "background" << "contentItem" << "indicator"); // popup not created until needed
- QTest::newRow("override:Container") << "override" << "Container" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:Control") << "override" << "Control" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:DelayButton") << "override" << "DelayButton" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:Dial") << "override" << "Dial" << (QStringList() << "background" << "contentItem" << "handle");
- QTest::newRow("override:Dialog") << "override" << "Dialog" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:DialogButtonBox") << "override" << "DialogButtonBox" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:Drawer") << "override" << "Drawer" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:Frame") << "override" << "Frame"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("override:GroupBox") << "override" << "GroupBox"<< (QStringList() << "background" << "contentItem" << "label");
- QTest::newRow("override:ItemDelegate") << "override" << "ItemDelegate" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:Label") << "override" << "Label" << (QStringList() << "background");
- QTest::newRow("override:Menu") << "override" << "Menu" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:MenuItem") << "override" << "MenuItem" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("override:MenuSeparator") << "override" << "MenuSeparator" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:Page") << "override" << "Page" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:PageIndicator") << "override" << "PageIndicator" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:Pane") << "override" << "Pane" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:Popup") << "override" << "Popup" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:ProgressBar") << "override" << "ProgressBar" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:RadioButton") << "override" << "RadioButton" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("override:RadioDelegate") << "override" << "RadioDelegate" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("override:RangeSlider") << "override" << "RangeSlider" << (QStringList() << "background" << "contentItem" << "first.handle" << "second.handle");
- QTest::newRow("override:RoundButton") << "override" << "RoundButton" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:ScrollBar") << "override" << "ScrollBar" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:ScrollIndicator") << "override" << "ScrollIndicator" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:ScrollView") << "override" << "ScrollView" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:Slider") << "override" << "Slider" << (QStringList() << "background" << "contentItem" << "handle");
- QTest::newRow("override:SpinBox") << "override" << "SpinBox" << (QStringList() << "background" << "contentItem" << "up.indicator" << "down.indicator");
- QTest::newRow("override:StackView") << "override" << "StackView" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:SwipeDelegate") << "override" << "SwipeDelegate" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:SwipeView") << "override" << "SwipeView" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:Switch") << "override" << "Switch" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("override:SwitchDelegate") << "override" << "SwitchDelegate" << (QStringList() << "background" << "contentItem" << "indicator");
- QTest::newRow("override:TabBar") << "override" << "TabBar"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("override:TabButton") << "override" << "TabButton"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("override:TextField") << "override" << "TextField" << (QStringList() << "background");
- QTest::newRow("override:TextArea") << "override" << "TextArea" << (QStringList() << "background");
- QTest::newRow("override:ToolBar") << "override" << "ToolBar"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("override:ToolButton") << "override" << "ToolButton"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("override:ToolSeparator") << "override" << "ToolSeparator"<< (QStringList() << "background" << "contentItem");
- QTest::newRow("override:ToolTip") << "override" << "ToolTip" << (QStringList() << "background" << "contentItem");
- QTest::newRow("override:Tumbler") << "override" << "Tumbler"<< (QStringList() << "background" << "contentItem");
+ for (const ControlInfo &control : ControlInfos)
+ QTest::newRow(qPrintable("override:" + control.type)) << "override" << control.type << control.delegates;
}
void tst_customization::creation()
@@ -350,6 +220,9 @@ void tst_customization::creation()
QFETCH(QString, type);
QFETCH(QStringList, delegates);
+ if (!qstrcmp(QTest::currentDataTag(), "empty:Tumbler"))
+ QSKIP("TODO: fix crash with contentItem-less Tumbler");
+
QQuickStyle::setStyle(testFile("styles/" + style));
QString error;