diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-10-09 16:29:28 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-10-09 14:45:04 +0000 |
commit | cb0519724e3d937feaa506f0ed65769347ad9de0 (patch) | |
tree | 6191605119cf8a377822d2324a3b5a3f7d92ce8b /tests/auto | |
parent | fdfb0e1d1cca04645bff07fbe7cc09f72f82b0da (diff) |
QQuickAction: don't uncheck the checked action of an exclusive group
The logic is adapted from QAction::activate().
Task-number: QTBUG-63674
Change-Id: I7af127ea917e40e6a8ca99c2528362cf6ad283b8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/controls/data/tst_abstractbutton.qml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_abstractbutton.qml b/tests/auto/controls/data/tst_abstractbutton.qml index 7579d410..168844a0 100644 --- a/tests/auto/controls/data/tst_abstractbutton.qml +++ b/tests/auto/controls/data/tst_abstractbutton.qml @@ -353,4 +353,45 @@ TestCase { verify(!control) keyClick(Qt.Key_H, Qt.AltModifier) } + + Component { + id: actionGroup + ActionGroup { + Action { id: action1; checkable: true; checked: true } + Action { id: action2; checkable: true } + Action { id: action3; checkable: true } + } + } + + function test_actionGroup() { + var group = createTemporaryObject(actionGroup, testCase) + verify(group) + + var button1 = createTemporaryObject(button, testCase, {action: group.actions[0], width: 10, height: 10}) + var button2 = createTemporaryObject(button, testCase, {action: group.actions[1], width: 10, height: 10, y: 10}) + var button3 = createTemporaryObject(button, testCase, {action: group.actions[2], width: 10, height: 10, y: 20}) + + verify(button1) + compare(button1.checked, true) + compare(button1.action.checked, true) + + verify(button2) + compare(button2.checked, false) + compare(button2.action.checked, false) + + verify(button3) + compare(button3.checked, false) + compare(button3.action.checked, false) + + mouseClick(button2) + + compare(button1.checked, false) + compare(button1.action.checked, false) + + compare(button2.checked, true) + compare(button2.action.checked, true) + + compare(button3.checked, false) + compare(button3.action.checked, false) + } } |