MenuBarItem QML Type

MenuBar 中显示下拉菜单 ... 更多...

Import Statement: import QtQuick.Controls
Inherits:

AbstractButton

属性

信号

详细说明

MenuBarItem 在MenuBar 中显示一个菜单。当通过键盘、鼠标或触摸triggered 时,将显示相应的下拉菜单。

MenuBarItem 用作MenuBar 的默认delegate 类型。请注意,使用MenuBar 时不必手工声明 MenuBarItem 实例。只需将 Menu 实例声明为MenuBar 的子菜单,相应的项目就会自动创建。

另请参阅 自定义菜单栏MenuBar菜单控件

属性文档

highlighted : bool

该属性表示用户是否高亮显示菜单栏项目。

菜单栏项目可通过鼠标悬停或键盘导航高亮显示。

默认值为false


该属性显示该项目在菜单栏中显示的菜单,如果该项目没有菜单,则显示null


此属性保存包含此项目的菜单栏,如果此项目不在菜单栏中,则保存null


信号文档

void triggered()

该信号在用户触发菜单栏项目时发出。

注: 相应的处理程序是onTriggered


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.