MenuBar QML Type
A native menubar. 更多...
Import Statement: | import Qt.labs.platform 1.0 |
开始支持版本: | Qt 5.8 |
基类: |
属性
方法
- void addMenu(Menu menu)
- void clear()
- void insertMenu(int index, Menu menu)
- void removeMenu(Menu menu)
详细描述
The MenuBar type provides a QML API for native platform menubars.
A menubar consists of a list of drop-down menus.
MenuBar { id: menuBar Menu { id: fileMenu title: qsTr("File") // ... } Menu { id: editMenu title: qsTr("&Edit") // ... } Menu { id: viewMenu title: qsTr("&View") // ... } Menu { id: helpMenu title: qsTr("&Help") // ... } }
MenuBar is currently available on the following platforms:
- macOS
- Android
- Linux (only available on desktop environments that provide a global D-Bus menu bar)
Note: Types in Qt.labs modules are not guaranteed to remain compatible in future versions.
参见 Menu.
属性
menus : list<Menu> |
This property holds the list of menus in the menubar.
window : Window |
成员
void addMenu(Menu menu) |
Adds a menu to end of the menubar.
void insertMenu(int index, Menu menu) |
Inserts a menu at the specified index in the menubar.
void removeMenu(Menu menu) |
Removes a menu from the menubar.