diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-06-29 14:20:19 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-06-29 16:17:11 +0000 |
commit | 97fe98a269d0f05ba4ced62946af4ab5e7b3c624 (patch) | |
tree | 4c14be62343b93072f718dc31a7975035f2578ac /tests | |
parent | 1be2cab39eb1dfc26891942e29f934700b46ab4e (diff) |
QQuickAbstractButton: fix shortcut handling part 2
Make sure to trigger the associated action if a button is activated via
its shortcut.
Change-Id: I73899a5540285c7c2b11a2481a9621ec6e83c6b8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_abstractbutton.qml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_abstractbutton.qml b/tests/auto/controls/data/tst_abstractbutton.qml index 9118c221..7579d410 100644 --- a/tests/auto/controls/data/tst_abstractbutton.qml +++ b/tests/auto/controls/data/tst_abstractbutton.qml @@ -71,6 +71,11 @@ TestCase { } Component { + id: action + Action { } + } + + Component { id: signalSpy SignalSpy { } } @@ -332,6 +337,15 @@ TestCase { keyClick(Qt.Key_H, Qt.AltModifier) compare(clickSpy.count, 4) + control.action = action.createObject(control, {text: "&Action"}) + + var actionSpy = signalSpy.createObject(control, {target: control.action, signalName: "triggered"}) + verify(actionSpy.valid) + + keyClick(Qt.Key_A, Qt.AltModifier) + compare(actionSpy.count, 1) + compare(clickSpy.count, 5) + // ungrab on destruction (don't crash) control.Component.onDestruction.connect(function() { control = null }) control.destroy() |