diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-10-26 11:36:24 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-10-26 11:38:15 +0000 |
commit | 8cde7790a69a152c1840f16ccc7471b81c190cba (patch) | |
tree | 1a0f7b84e7bc049548b713bf676907833aad5bfb /tests | |
parent | 4d2bd6929af05009b4a1f0502fe214fa57d5da2e (diff) |
Improve testbench
- Add delegate types
- Make Dials smaller
Change-Id: If95115b13a1aba61921d9924a0d37e4a263b798b
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manual/testbench/testbench.qml | 140 |
1 files changed, 138 insertions, 2 deletions
diff --git a/tests/manual/testbench/testbench.qml b/tests/manual/testbench/testbench.qml index 2fdc52af..3e8b3d0f 100644 --- a/tests/manual/testbench/testbench.qml +++ b/tests/manual/testbench/testbench.qml @@ -625,14 +625,14 @@ ApplicationWindow { Frame { Tumbler { model: 5 - implicitWidth: 100 + implicitWidth: 80 implicitHeight: 100 } } Frame { Tumbler { model: 5 - implicitWidth: 100 + implicitWidth: 80 implicitHeight: 100 enabled: false } @@ -641,11 +641,147 @@ ApplicationWindow { RowLayout { Dial { + implicitWidth: 100 + implicitHeight: 100 } Dial { + implicitWidth: 100 + implicitHeight: 100 enabled: false } } + + ListModel { + id: checkableDelegateModel + ListElement { label: "Normal" } + ListElement { label: "Pressed"; press: true } + ListElement { label: "Checked"; check: true } + ListElement { label: "CH + PR"; check: true; press: true } + ListElement { label: "Disabled"; disabled: true } + } + + RowLayout { + Frame { + Column { + width: 200 + + Repeater { + model: checkableDelegateModel + delegate: CheckDelegate { + text: label + width: parent.width + down: press + checked: check + enabled: !disabled + ButtonGroup.group: radioButtonGroup + } + } + } + } + + ButtonGroup { + id: radioButtonGroup + } + + Frame { + Column { + width: 200 + + Repeater { + model: checkableDelegateModel + delegate: RadioDelegate { + text: label + down: press + width: parent.width + checked: check + enabled: !disabled + ButtonGroup.group: radioButtonGroup + } + } + } + } + + Frame { + Column { + width: 200 + + Repeater { + model: checkableDelegateModel + delegate: SwitchDelegate { + text: label + width: parent.width + checked: check + down: press + enabled: !disabled + } + } + } + } + } + + ListModel { + id: regularDelegateModel + ListElement { label: "Normal" } + ListElement { label: "Pressed"; press: true } + ListElement { label: "Disabled"; disabled: true } + } + + RowLayout { + Frame { + Column { + width: 200 + + Repeater { + model: regularDelegateModel + delegate: ItemDelegate { + text: label + width: parent.width + down: press + enabled: !disabled + } + } + } + } + Frame { + Column { + id: listView + width: 200 + clip: true + + Repeater { + model: regularDelegateModel + delegate: SwipeDelegate { + id: swipeDelegate + text: label + width: parent.width + down: press + enabled: !disabled + + Component { + id: removeComponent + + Rectangle { + color: swipeDelegate.swipe.complete && swipeDelegate.pressed ? "#333" : "#444" + width: parent.width + height: parent.height + clip: true + + Label { + font.pixelSize: swipeDelegate.font.pixelSize + text: "Boop" + color: "white" + anchors.centerIn: parent + } + } + } + + swipe.left: removeComponent + swipe.right: removeComponent + } + } + } + } + } } } } |