diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-09-07 13:28:15 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-09-07 11:59:43 +0000 |
commit | 1c6a510c16b35c937af202f517604620b4a97ff0 (patch) | |
tree | a745089765089e20cc472a677387bfb610563eaf /tests/auto/controls | |
parent | f770dbe9d38214a37e12adb591498dcd1ad0293e (diff) | |
download | qtquickcontrols-1c6a510c16b35c937af202f517604620b4a97ff0.tar.gz |
Button: only enable mnemonic if button itself is enabled.
Otherwise users can trigger shortcuts even when buttons are disabled.
Change-Id: If97c6a3c3df574a4271c53cf7bcfd8fdb1a059d6
Task-number: QTBUG-48144
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'tests/auto/controls')
-rw-r--r-- | tests/auto/controls/data/tst_button.qml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_button.qml b/tests/auto/controls/data/tst_button.qml index 136f82cc..0d226ffc 100644 --- a/tests/auto/controls/data/tst_button.qml +++ b/tests/auto/controls/data/tst_button.qml @@ -40,6 +40,7 @@ import QtQuick 2.2 import QtTest 1.0 +import QtQuick.Controls 1.4 import QtQuickControlsTests 1.0 Item { @@ -278,5 +279,26 @@ TestCase { button.destroy() } + + Component { + id: mnemonicButtonComponent + + Button { + text: "&Hi" + enabled: false + } + } + + function test_mnemonic() { + var button = mnemonicButtonComponent.createObject(container); + verify(button); + + clickSpy.clear(); + clickSpy.target = button; + keyClick(Qt.Key_H, Qt.AltModifier); + compare(clickSpy.count, 0); + + button.destroy(); + } } } |