diff options
author | Richard Moe Gustavsen <[email protected]> | 2024-07-04 12:33:13 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <[email protected]> | 2024-07-04 16:14:08 +0200 |
commit | fdac10eb0db071f7d6afbe08122b0c5160f6d663 (patch) | |
tree | 6c149431f5e45517d83d6b6898d4e16777dbc305 | |
parent | eb3a71007d3aeebcfe14f20191f6a51b44b00e6a (diff) |
testbench: don't use native menus or menubars
The purpose of the tool is to show the styled controls.
So don't use native menus or menubars. Also, since the
menubar will warn (since Qt 6.8) if you add a MenuBarItem
to a MenuBar without a Menu, give each MenuBarItem a dummy
menu.
Pick-to: 6.8
Change-Id: I51972deea0308e7c994460ab4c6cca4fa9b5a9ab
Reviewed-by: Doris Verria <[email protected]>
-rw-r--r-- | tests/manual/quickcontrols/testbench/controls/MenuBar.qml | 4 | ||||
-rw-r--r-- | tests/manual/quickcontrols/testbench/main.cpp | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/manual/quickcontrols/testbench/controls/MenuBar.qml b/tests/manual/quickcontrols/testbench/controls/MenuBar.qml index 3ea2e2be83..0d53cf8cb6 100644 --- a/tests/manual/quickcontrols/testbench/controls/MenuBar.qml +++ b/tests/manual/quickcontrols/testbench/controls/MenuBar.qml @@ -15,18 +15,22 @@ QtObject { property Component component: MenuBar { MenuBarItem { text: qsTr("Normal") + menu: Menu { Action { text: "action" } } } MenuBarItem { text: qsTr("Pressed") down: true + menu: Menu { Action { text: "action" } } } MenuBarItem { text: qsTr("Highlighted") highlighted: true + menu: Menu { Action { text: "action" } } } MenuBarItem { text: qsTr("Disabled") enabled: false + menu: Menu { Action { text: "action" } } } } } diff --git a/tests/manual/quickcontrols/testbench/main.cpp b/tests/manual/quickcontrols/testbench/main.cpp index 14da6e7b2c..f0ae272cd9 100644 --- a/tests/manual/quickcontrols/testbench/main.cpp +++ b/tests/manual/quickcontrols/testbench/main.cpp @@ -18,6 +18,8 @@ int main(int argc, char *argv[]) { QGuiApplication::setApplicationName("testbench"); QGuiApplication::setOrganizationName("QtProject"); + QGuiApplication::setAttribute(Qt::AA_DontUseNativeMenuBar); + QGuiApplication::setAttribute(Qt::AA_DontUseNativeMenuWindows); QGuiApplication app(argc, argv); |