【发布时间】:2016-02-10 14:26:48
【问题描述】:
我正在使用 QML 为平板电脑编写应用程序。
应用程序的主 QML 文件是这样的:
ApplicationWindow {
id: mainWindow
visible: true
title: "MyApp"
menuBar: MenuBar {
Menu {
title: qsTr("File")
MenuItem {
text: qsTr("Open project")
}
MenuItem {
text: qsTr("Exit")
onTriggered: Qt.quit();
}
}
}
}
如果我在 Android 设备上运行应用程序,菜单的样式类似于标准 Android 菜单,即右上角的按钮(带有“3 点”图标)。这个很好。
如果我在 Windows 设备上运行应用程序,菜单就像标准桌面应用程序菜单(传统的文件菜单...)。这种风格不适合平板电脑应用。
有没有办法选择应用程序的样式? 谢谢!
【问题讨论】:
-
经过大量与库存 QML 组件的斗争后,我找到的解决方案是“不要使用库存 QML 组件”