QML 菜单操作
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.5
import QtQuick.Controls 1.4 as Ctrl
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
menuBar:MenuBar{
Menu {
title: qsTr('&File')
Action { text: "Cut" }
Action { text: "Copy" }
Action { text: "Paste" }
MenuSeparator { }
Menu {
title: qsTr("Find/Replace")
Action { text: "Find Next" }
Action { text: "Find Previous" }
Action { text: "Replace" }
}
}
Menu {
title: qsTr('&Help')
Action {
id: aboutAct
text: "&About" }
}
Connections {
target: aboutAct