diff options
author | Mitch Curtis <[email protected]> | 2024-02-21 14:38:16 +0800 |
---|---|---|
committer | Mitch Curtis <[email protected]> | 2024-04-23 13:48:01 +0800 |
commit | d2711e6961720362647421d48ebaea3c10fee03f (patch) | |
tree | 9a0b7bb3ed6d75aa7097ef7322a8cce3198136b7 /tests/manual/quickcontrols | |
parent | f08c3bcc2563da4c7550dda2259b83cf5b9957f8 (diff) |
menus: add shortcuts
Task-number: QTBUG-69558
Change-Id: I440fb7caff125d2417fb648df667219e42b375bc
Reviewed-by: Richard Moe Gustavsen <[email protected]>
Diffstat (limited to 'tests/manual/quickcontrols')
-rw-r--r-- | tests/manual/quickcontrols/menus/Main.qml | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/tests/manual/quickcontrols/menus/Main.qml b/tests/manual/quickcontrols/menus/Main.qml index cce1edbb0f..34b60fdfd3 100644 --- a/tests/manual/quickcontrols/menus/Main.qml +++ b/tests/manual/quickcontrols/menus/Main.qml @@ -62,6 +62,9 @@ ApplicationWindow { text: qsTr("Paste") enabled: textArea.activeFocus } + + MenuSeparator {} + Action { text: qsTr("Remove menu") onTriggered: menuBar.removeMenu(editMenu) @@ -71,6 +74,13 @@ ApplicationWindow { title: qsTr("Find / Replace") Action { text: qsTr("&Find") } } + + MenuSeparator {} + + ContextAction { + text: qsTr("Dummy Action") + shortcut: "Ctrl+I" + } } MenuBarItem { menu: Menu { @@ -113,9 +123,10 @@ ApplicationWindow { + " work as expected with the TextArea?\n" + " - Are they enabled/disabled as expected?\n" + " - Does the TextArea keep focus after interacting with the Edit menu items?\n" - + "- Does adding and removing menu items work?" - + "- Do the menus in the MenuBar work?" - + "- Can you add and remove menus from the MenuBar?") + + "- Does adding and removing menu items work?\n" + + "- Do the menus in the MenuBar work?\n" + + "- Can you add and remove menus from the MenuBar?\n" + + "- Do shortcuts work?") verticalAlignment: Text.AlignVCenter wrapMode: Text.Wrap @@ -262,6 +273,7 @@ ApplicationWindow { ContextAction { text: qsTr("Context menu item") + shortcut: "A" } ContextMenuItem { text: qsTr("Checkable context menu item") @@ -271,16 +283,19 @@ ApplicationWindow { text: qsTr("Checked context menu item") checkable: true checked: true + shortcut: "C" } ContextAction { text: qsTr("Disabled context menu item") enabled: false + shortcut: "D" } ContextAction { text: qsTr("Checked and disabled context menu item") checkable: true checked: true enabled: false + shortcut: "E" } MenuSeparator {} @@ -305,6 +320,7 @@ ApplicationWindow { ContextAction { text: qsTr("Checkable sub-menu item") checkable: true + shortcut: "G" } ContextAction { text: qsTr("Checked sub-menu item") @@ -317,12 +333,14 @@ ApplicationWindow { ContextAction { text: qsTr("Disabled sub-menu item") enabled: false + shortcut: "I" } ContextAction { text: qsTr("Checked and disabled sub-menu item") checkable: true checked: true enabled: false + shortcut: "J" } } } |