在 QML 中,我无法获得 CheckBox 的快捷方式

问题描述 投票:0回答:0

在下面的QML菜单中,我可以获得“文件”和“新建”的快捷方式,但不能获得“自动保存”的快捷方式:

menuBar: MenuBar {
    Menu {
        title: qsTr("&File")
        Action { text: qsTr("&New...") }
        CheckBox {
           id: autoSaveButton
           checked: true
           text: qsTr("&Auto Save")
           action: autoSaveAction
        }
}

CheckBox 的行为与 Action 不同的原因是什么?

我试图将 CheckBox 移出菜单,在工具栏上,但没有任何改进。

Qt 版本:6.4

qt qml qtquick2
© www.soinside.com 2019 - 2024. All rights reserved.