aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/customization/tst_customization.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-12-14 15:12:00 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-12-14 18:07:04 +0000
commita31f0a1e7e187944eb8744c84c085f2e76752eb5 (patch)
treec8a86e0493a989fc91161a3f0367e77c2b7002c6 /tests/auto/customization/tst_customization.cpp
parenta60a28f8225709bfca338416630a0493853264e1 (diff)
Extend and improve tst_customization
Add more test cases, and clarify the roles of the test styles. - empty: no delegates at all - incomplete: has all delegates, but with no bindings that access delegates and therefore trigger creation (tests that delegates must be created regardless) - simple: has all delegates and creates bindings to simulate a full style - override: overrides the simple style and tests that the default instances of overridden delegates are not created There are still several non-popup controls that lack deferred execution. These are marked with QEXPECT_FAIL() to make it easy to track what's missing. This list still excludes all popups. Task-number: QTBUG-50992 Change-Id: I70ce42592e7a320251edebfab3030ccc7c0eb978 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/customization/tst_customization.cpp')
-rw-r--r--tests/auto/customization/tst_customization.cpp272
1 files changed, 208 insertions, 64 deletions
diff --git a/tests/auto/customization/tst_customization.cpp b/tests/auto/customization/tst_customization.cpp
index e7ce296a..b10fa71a 100644
--- a/tests/auto/customization/tst_customization.cpp
+++ b/tests/auto/customization/tst_customization.cpp
@@ -140,69 +140,188 @@ void tst_customization::creation_data()
QTest::addColumn<QStringList>("delegates");
// the "empty" style does not contain any delegates
- QTest::newRow("empty:ApplicationWindow") << "empty" << "ApplicationWindow"<< (QStringList() << "applicationwindow-empty");
- QTest::newRow("empty:Button") << "empty" << "Button"<< (QStringList() << "button-empty");
- QTest::newRow("empty:CheckBox") << "empty" << "CheckBox" << (QStringList() << "checkbox-empty");
- QTest::newRow("empty:ComboBox") << "empty" << "ComboBox" << (QStringList() << "combobox-empty");
- QTest::newRow("empty:Dial") << "empty" << "Dial" << (QStringList() << "dial-empty");
- QTest::newRow("empty:Frame") << "empty" << "Frame"<< (QStringList() << "frame-empty");
- QTest::newRow("empty:GroupBox") << "empty" << "GroupBox"<< (QStringList() << "groupbox-empty");
- QTest::newRow("empty:Label") << "empty" << "Label"<< (QStringList() << "label-empty");
- QTest::newRow("empty:Pane") << "empty" << "Pane"<< (QStringList() << "pane-empty");
- QTest::newRow("empty:RadioButton") << "empty" << "RadioButton" << (QStringList() << "radiobutton-empty");
- QTest::newRow("empty:RangeSlider") << "empty" << "RangeSlider" << (QStringList() << "rangeslider-empty");
- QTest::newRow("empty:Slider") << "empty" << "Slider" << (QStringList() << "slider-empty");
- QTest::newRow("empty:SpinBox") << "empty" << "SpinBox" << (QStringList() << "spinbox-empty");
- QTest::newRow("empty:TextField") << "empty" << "TextField"<< (QStringList() << "textfield-empty");
- QTest::newRow("empty:TextArea") << "empty" << "TextArea"<< (QStringList() << "textarea-empty");
- QTest::newRow("empty:ToolBar") << "empty" << "ToolBar"<< (QStringList() << "toolbar-empty");
-
- // the "incomplete" style is missing most delegates
- QTest::newRow("incomplete:Button") << "incomplete" << "Button" << (QStringList() << "button-incomplete" << "button-background-incomplete");
- QTest::newRow("incomplete:CheckBox") << "incomplete" << "CheckBox" << (QStringList() << "checkbox-incomplete" << "checkbox-contentItem-incomplete");
- QTest::newRow("incomplete:ComboBox") << "incomplete" << "ComboBox" << (QStringList() << "combobox-incomplete" << "combobox-contentItem-incomplete");
- QTest::newRow("incomplete:Dial") << "incomplete" << "Dial" << (QStringList() << "dial-incomplete" << "dial-handle-incomplete");
- QTest::newRow("incomplete:GroupBox") << "incomplete" << "GroupBox"<< (QStringList() << "groupbox-incomplete" << "groupbox-label-incomplete");
- QTest::newRow("incomplete:RadioButton") << "incomplete" << "RadioButton" << (QStringList() << "radiobutton-incomplete" << "radiobutton-indicator-incomplete");
- QTest::newRow("incomplete:RangeSlider") << "incomplete" << "RangeSlider" << (QStringList() << "rangeslider-incomplete" << "rangeslider-first-handle-incomplete" << "rangeslider-second-handle-incomplete");
- QTest::newRow("incomplete:Slider") << "incomplete" << "Slider" << (QStringList() << "slider-incomplete" << "slider-handle-incomplete");
- QTest::newRow("incomplete:SpinBox") << "incomplete" << "SpinBox" << (QStringList() << "spinbox-incomplete" << "spinbox-up-indicator-incomplete" << "spinbox-down-indicator-incomplete");
-
- // the "simple" style simulates a proper style and contains most delegates
- QTest::newRow("simple:ApplicationWindow") << "simple" << "ApplicationWindow" << (QStringList() << "applicationwindow-simple" << "applicationwindow-background-simple");
- QTest::newRow("simple:Button") << "simple" << "Button" << (QStringList() << "button-simple" << "button-background-simple" << "button-contentItem-simple");
- QTest::newRow("simple:CheckBox") << "simple" << "CheckBox" << (QStringList() << "checkbox-simple" << "checkbox-contentItem-simple" << "checkbox-indicator-simple");
- QTest::newRow("simple:ComboBox") << "simple" << "ComboBox" << (QStringList() << "combobox-simple" << "combobox-background-simple" << "combobox-contentItem-simple" << "combobox-indicator-simple");
- QTest::newRow("simple:Dial") << "simple" << "Dial" << (QStringList() << "dial-simple" << "dial-background-simple" << "dial-handle-simple");
- QTest::newRow("simple:Frame") << "simple" << "Frame" << (QStringList() << "frame-simple" << "frame-background-simple");
- QTest::newRow("simple:GroupBox") << "simple" << "GroupBox" << (QStringList() << "groupbox-simple" << "groupbox-background-simple" << "groupbox-label-simple");
- QTest::newRow("simple:Label") << "simple" << "Label" << (QStringList() << "label-simple" << "label-background-simple");
- QTest::newRow("simple:Pane") << "simple" << "Pane" << (QStringList() << "pane-simple" << "pane-background-simple");
- QTest::newRow("simple:RadioButton") << "simple" << "RadioButton" << (QStringList() << "radiobutton-simple" << "radiobutton-contentItem-simple" << "radiobutton-indicator-simple");
- QTest::newRow("simple:RangeSlider") << "simple" << "RangeSlider" << (QStringList() << "rangeslider-simple" << "rangeslider-background-simple" << "rangeslider-first-handle-simple" << "rangeslider-second-handle-simple");
- QTest::newRow("simple:Slider") << "simple" << "Slider" << (QStringList() << "slider-simple" << "slider-background-simple" << "slider-handle-simple");
- QTest::newRow("simple:SpinBox") << "simple" << "SpinBox" << (QStringList() << "spinbox-simple" << "spinbox-background-simple" << "spinbox-contentItem-simple" << "spinbox-up-indicator-simple" << "spinbox-down-indicator-simple");
- QTest::newRow("simple:TextField") << "simple" << "TextField" << (QStringList() << "textfield-simple" << "textfield-background-simple");
- QTest::newRow("simple:TextArea") << "simple" << "TextArea" << (QStringList() << "textarea-simple" << "textarea-background-simple");
- QTest::newRow("simple:ToolBar") << "simple" << "ToolBar" << (QStringList() << "toolbar-simple" << "toolbar-background-simple");
-
- // the "override" style overrides various delegates in the above styles
- QTest::newRow("override:ApplicationWindow") << "override" << "ApplicationWindow" << (QStringList() << "applicationwindow-override" << "applicationwindow-background-override");
- QTest::newRow("override:Button") << "override" << "Button" << (QStringList() << "button-override" << "button-background-override" << "button-contentItem-override");
- QTest::newRow("override:CheckBox") << "override" << "CheckBox" << (QStringList() << "checkbox-override" << "checkbox-background-override" << "checkbox-contentItem-incomplete");
- QTest::newRow("override:ComboBox") << "override" << "ComboBox" << (QStringList() << "combobox-override" << "combobox-background-override" << "combobox-contentItem-simple" << "combobox-indicator-simple");
- QTest::newRow("override:Dial") << "override" << "Dial" << (QStringList() << "dial-override" << "dial-background-override" << "dial-handle-override");
- QTest::newRow("override:Frame") << "override" << "Frame" << (QStringList() << "frame-override" << "frame-background-override");
- QTest::newRow("override:GroupBox") << "override" << "GroupBox" << (QStringList() << "groupbox-override" << "groupbox-background-override" << "groupbox-label-override");
- QTest::newRow("override:Label") << "override" << "Label" << (QStringList() << "label-override" << "label-background-override");
- QTest::newRow("override:Pane") << "override" << "Pane" << (QStringList() << "pane-override" << "pane-background-override");
- QTest::newRow("override:RadioButton") << "override" << "RadioButton" << (QStringList() << "radiobutton-override" << "radiobutton-background-override" << "radiobutton-contentItem-simple" << "radiobutton-indicator-override");
- QTest::newRow("override:RangeSlider") << "override" << "RangeSlider" << (QStringList() << "rangeslider-override" << "rangeslider-background-override" << "rangeslider-first-handle-override" << "rangeslider-second-handle-override");
- QTest::newRow("override:Slider") << "override" << "Slider" << (QStringList() << "slider-override" << "slider-background-override" << "slider-handle-override");
- QTest::newRow("override:SpinBox") << "override" << "SpinBox" << (QStringList() << "spinbox-override" << "spinbox-background-override" << "spinbox-contentItem-simple" << "spinbox-up-indicator-override" << "spinbox-down-indicator-override");
- QTest::newRow("override:TextField") << "override" << "TextField" << (QStringList() << "textfield-override" << "textfield-background-override");
- QTest::newRow("override:TextArea") << "override" << "TextArea" << (QStringList() << "textarea-override" << "textarea-background-override");
- QTest::newRow("override:ToolBar") << "override" << "ToolBar" << (QStringList() << "toolbar-override" << "toolbar-background-override");
+ 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:DialogButtonBox") << "empty" << "DialogButtonBox" << 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: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: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:Tumbler") << "empty" << "Tumbler"<< QStringList(); // ### TODO: fix crash with contentItem-less Tumbler
+
+ // 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:DialogButtonBox") << "incomplete" << "DialogButtonBox" << (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: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: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:Tumbler") << "incomplete" << "Tumbler"<< (QStringList() << "background" << "contentItem");
+
+ // 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:DialogButtonBox") << "simple" << "DialogButtonBox" << (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: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: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:Tumbler") << "simple" << "Tumbler"<< (QStringList() << "background" << "contentItem");
+
+ // 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:DialogButtonBox") << "override" << "DialogButtonBox" << (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: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: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:Tumbler") << "override" << "Tumbler"<< (QStringList() << "background" << "contentItem");
}
void tst_customization::creation()
@@ -220,8 +339,33 @@ void tst_customization::creation()
QByteArray templateType = "QQuick" + type.toUtf8();
QVERIFY2(control->inherits(templateType), qPrintable(type + " does not inherit " + templateType + " (" + control->metaObject()->className() + ")"));
- for (const QString &delegate : delegates)
+ QString controlName = type.toLower() + "-" + style;
+ QVERIFY2(qt_createdQObjects()->removeOne(controlName), qPrintable(controlName + " was not created as expected"));
+
+ for (QString delegate : qAsConst(delegates)) {
+ if (!delegate.contains("-"))
+ delegate.append("-" + style);
+ delegate.prepend(type.toLower() + "-");
+
QVERIFY2(qt_createdQObjects()->removeOne(delegate), qPrintable(delegate + " was not created as expected"));
+ }
+
+ QEXPECT_FAIL("override:BusyIndicator", "TODO", Abort);
+ QEXPECT_FAIL("override:Container", "TODO", Abort);
+ QEXPECT_FAIL("override:Control", "TODO", Abort);
+ QEXPECT_FAIL("override:DialogButtonBox", "TODO", Abort);
+ QEXPECT_FAIL("override:MenuSeparator", "TODO", Abort);
+ QEXPECT_FAIL("override:Page", "TODO", Abort);
+ QEXPECT_FAIL("override:PageIndicator", "TODO", Abort);
+ QEXPECT_FAIL("override:ProgressBar", "TODO", Abort);
+ QEXPECT_FAIL("override:ScrollBar", "TODO", Abort);
+ QEXPECT_FAIL("override:ScrollIndicator", "TODO", Abort);
+ QEXPECT_FAIL("override:ScrollView", "TODO", Abort);
+ QEXPECT_FAIL("override:StackView", "TODO", Abort);
+ QEXPECT_FAIL("override:SwipeView", "TODO", Abort);
+ QEXPECT_FAIL("override:TabBar", "TODO", Abort);
+ QEXPECT_FAIL("override:ToolSeparator", "TODO", Abort);
+ QEXPECT_FAIL("override:Tumbler", "TODO", Abort);
QVERIFY2(qt_createdQObjects()->isEmpty(), qPrintable("unexpectedly created: " + qt_createdQObjects->join(", ")));
QVERIFY2(qt_destroyedQObjects()->isEmpty(), qPrintable("unexpectedly destroyed: " + qt_destroyedQObjects->join(", ") + " were unexpectedly destroyed"));