diff options
author | Mitch Curtis <[email protected]> | 2024-01-17 15:06:20 +0800 |
---|---|---|
committer | Mitch Curtis <[email protected]> | 2024-01-22 12:52:07 +0800 |
commit | 9563db876387d2c4248ed1d6a2a846d31fdf40be (patch) | |
tree | 21d946ce2dcd10a99da00be401f76dab6b27bffb /tests/manual/quickcontrols | |
parent | 330caeceffb0ae7b881b2c8c1fb398b86df45213 (diff) |
Add checkable Actions to menus manual test
This can't reliably be auto-tested because we can't interact with menu
items with the mouse, and there's no way to know if a native menu is
focused in order to interact with it via keyboard.
Task-number: QTBUG-69558
Change-Id: I21134743ccc64ca1bf99f085f09c00d66a3ca3dc
Reviewed-by: Richard Moe Gustavsen <[email protected]>
Diffstat (limited to 'tests/manual/quickcontrols')
-rw-r--r-- | tests/manual/quickcontrols/menus/main.qml | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/tests/manual/quickcontrols/menus/main.qml b/tests/manual/quickcontrols/menus/main.qml index 59dfbac3fc..31a3a1b970 100644 --- a/tests/manual/quickcontrols/menus/main.qml +++ b/tests/manual/quickcontrols/menus/main.qml @@ -65,6 +65,7 @@ ApplicationWindow { + "Right click on the TextArea to access its edit context menu.\n\n" + "Things to check:\n\n" + "- Do the menu items trigger their actions (check console for output)?\n" + + "- Do checkable menu items work?\n" + "- Do the Edit menu items (in the MenuBar menu and edit context menu)" + " work as expected with the TextArea?\n" + " - Are they enabled/disabled as expected?\n" @@ -138,7 +139,9 @@ ApplicationWindow { } component ContextAction: Action { - onTriggered: print("triggered", text) + id: action + onCheckedChanged: print("checked of \"" + text + "\" changed to " + action.checked) + onTriggered: print("triggered \"" + text + "\"") } Menu { @@ -159,13 +162,16 @@ ApplicationWindow { } ContextAction { - text: qsTr("Context menu item 1") + text: qsTr("Context menu item") } ContextAction { - text: qsTr("Context menu item 2") + text: qsTr("Checkable context menu item") + checkable: true } ContextAction { - text: qsTr("Context menu item 3") + text: qsTr("Checked context menu item") + checkable: true + checked: true } // TODO: separator @@ -184,13 +190,16 @@ ApplicationWindow { } ContextAction { - text: qsTr("Sub-menu item 1") + text: qsTr("Sub-menu item") } ContextAction { - text: qsTr("Sub-menu item 2") + text: qsTr("Checkable sub-menu item") + checkable: true } ContextAction { - text: qsTr("Sub-menu item 3") + text: qsTr("Checked sub-menu item") + checkable: true + checked: true } } } |