【发布时间】:2019-06-21 16:31:37
【问题描述】:
我正在使用 QML 开发一个仅包含一个菜单栏的 macOS 应用程序:
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.4
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
menuBar: MenuBar {
Menu {
title: qsTr("&File")
Action { text: qsTr("&New...") }
Action { text: qsTr("&Open...") }
Action { text: qsTr("&Save") }
Action { text: qsTr("Save &As...") }
MenuSeparator { }
Action { text: qsTr("&Quit") }
}
Menu {
title: qsTr("&Edit")
Action { text: qsTr("Cu&t") }
Action { text: qsTr("&Copy") }
Action { text: qsTr("&Paste") }
}
Menu {
title: qsTr("&Help")
Action { text: qsTr("&About") }
}
}
}
很遗憾,菜单看起来不像预期的那样:
通常,菜单项出现在 Apple 菜单旁边,此处仅包含 MenuTest:
【问题讨论】:
-
也许this 链接可能有用。