diff options
author | 2024-09-10 19:15:25 +0900 | |
---|---|---|
committer | 2024-09-11 18:40:18 +0900 | |
commit | 5c8f09d2c3c99f621b467ed5c1be4fac3a708e85 (patch) | |
tree | 9312e269961b14945a00db47ed236ca53ffbb149 /GUIModel/Menu/Menu.qml | |
parent | 17b016d08cf1680f58cbb9102f35949c8436207c (diff) |
Port the cluster-refgui demo supports both Qt5 and Qt6HEADtrout_19.90.0trout/19.90.019.90.0master
This demo can now run on both Qt5 and Qt6, also added a macro to switch with or without the backend so that it can be developed easily on the Windows desktop.
Bug-AGL: SPEC-5243
Change-Id: I99b12ad9779a477784df13b83a850387747bb588
Signed-off-by: Jiu Shanheng <shanheng.jiu@qt.io>
Diffstat (limited to 'GUIModel/Menu/Menu.qml')
-rw-r--r-- | GUIModel/Menu/Menu.qml | 68 |
1 files changed, 31 insertions, 37 deletions
diff --git a/GUIModel/Menu/Menu.qml b/GUIModel/Menu/Menu.qml index 9610b49..7a6d534 100644 --- a/GUIModel/Menu/Menu.qml +++ b/GUIModel/Menu/Menu.qml @@ -15,65 +15,63 @@ */ import QtQuick 2.0 -import QtGraphicalEffects 1.0 import QtQuick.Shapes 1.11 - -Item{ +Item { id: menuRoot - Connections{ + Connections { target: rootItem - onTransNormalToAdas:{ - menuMain.startAnimationNormalToAdas() - menuContents.startAnimationNormalToAdas() - menuShade.startAnimationNormalToAdas() + onTransNormalToAdas: { + menuMain.startAnimationNormalToAdas(); + menuContents.startAnimationNormalToAdas(); + menuShade.startAnimationNormalToAdas(); } - onKeyPressed_Up:{ - if(menu.state === "open"){ - menuMain.incrementIndex() + onKeyPressed_Up: { + if (menu.state === "open") { + menuMain.incrementIndex(); } } - onKeyPressed_Down:{ - if(menu.state === "open"){ - menuMain.decrementIndex() + onKeyPressed_Down: { + if (menu.state === "open") { + menuMain.decrementIndex(); } } - onKeyPressed_Left:{ - if(menu.state === "close"){ - menuContents.decrementIndex() + onKeyPressed_Left: { + if (menu.state === "close") { + menuContents.decrementIndex(); } } - onKeyPressed_Right:{ - if(menu.state === "close"){ - menuContents.incrementIndex() + onKeyPressed_Right: { + if (menu.state === "close") { + menuContents.incrementIndex(); } } - onKeyPressed_Enter:{ - if(menu.state === "close"){ - menuContents.enter() - }else if(menu.state === "open"){ - menuContents.close() - menuMain.close() - menu.state = "close" + onKeyPressed_Enter: { + if (menu.state === "close") { + menuContents.enter(); + } else if (menu.state === "open") { + menuContents.close(); + menuMain.close(); + menu.state = "close"; } } - onKeyPressed_Menu:{ - if(menu.state === "close"){ - menuContents.open() - menuMain.open() - menu.state = "open" + onKeyPressed_Menu: { + if (menu.state === "close") { + menuContents.open(); + menuMain.open(); + menu.state = "open"; } } } - Item{ + Item { id: menu property var mode: "normal" /* Normal or Adas */ @@ -92,8 +90,4 @@ Item{ id: menuShade } } - - - - } |