aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_dialogbuttonbox.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-02-15 13:55:50 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2018-02-17 13:28:09 +0000
commit5313a2b3fd9fe83b20b3e589f29e744be5fcab38 (patch)
tree93ba98a425577cbdb73dc4a3f60be003d6b00aa5 /tests/auto/controls/data/tst_dialogbuttonbox.qml
parentf6eb6a3661f5c8c47c539d38b5bcb0a33c22d904 (diff)
Add DialogButtonBox::buttonLayout
[ChangeLog][Controls][DialogButtonBox] Added buttonLayout property that can be used to arrange the buttons. Change-Id: I9160e5df86a0c9444b45ed9f585c50166c145671 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_dialogbuttonbox.qml')
-rw-r--r--tests/auto/controls/data/tst_dialogbuttonbox.qml25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_dialogbuttonbox.qml b/tests/auto/controls/data/tst_dialogbuttonbox.qml
index 044c9593..7d343cc6 100644
--- a/tests/auto/controls/data/tst_dialogbuttonbox.qml
+++ b/tests/auto/controls/data/tst_dialogbuttonbox.qml
@@ -195,4 +195,29 @@ TestCase {
compare(clickedSpy.signalArguments[0][0], button)
compare(roleSpy.count, 1)
}
+
+ function test_buttonLayout_data() {
+ return [
+ { tag: "WinLayout", buttonLayout: DialogButtonBox.WinLayout, button1Role: DialogButtonBox.AcceptRole, button2Role: DialogButtonBox.RejectRole },
+ { tag: "MacLayout", buttonLayout: DialogButtonBox.MacLayout, button1Role: DialogButtonBox.RejectRole, button2Role: DialogButtonBox.AcceptRole },
+ { tag: "KdeLayout", buttonLayout: DialogButtonBox.KdeLayout, button1Role: DialogButtonBox.AcceptRole, button2Role: DialogButtonBox.RejectRole },
+ { tag: "GnomeLayout", buttonLayout: DialogButtonBox.GnomeLayout, button1Role: DialogButtonBox.RejectRole, button2Role: DialogButtonBox.AcceptRole },
+ { tag: "AndroidLayout", buttonLayout: DialogButtonBox.AndroidLayout, button1Role: DialogButtonBox.RejectRole, button2Role: DialogButtonBox.AcceptRole }
+ ]
+ }
+
+ function test_buttonLayout(data) {
+ var control = createTemporaryObject(buttonBox, testCase, {buttonLayout: data.buttonLayout, standardButtons: DialogButtonBox.Ok|DialogButtonBox.Cancel})
+ verify(control)
+
+ compare(control.count, 2)
+
+ var button1 = control.itemAt(0)
+ verify(button1)
+ compare(button1.DialogButtonBox.buttonRole, data.button1Role)
+
+ var button2 = control.itemAt(1)
+ verify(button2)
+ compare(button2.DialogButtonBox.buttonRole, data.button2Role)
+ }
}