MenuBar QML Type
A native menubar. More...
Import Statement: | import Qt.labs.platform 1.1 |
Since: | Qt 5.8 |
Properties
Methods
- void addMenu(menu)
- void clear()
- void insertMenu(index, Menu menu)
- void removeMenu(menu)
Detailed Description
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.
See also Menu.
Property Documentation
menus : list<Menu> |
This property holds the list of menus in the menubar.
This property holds the menubar's window.
Unless explicitly set, the window is automatically resolved by iterating the QML parent objects until a Window or an Item that has a window is found.
Method Documentation
void insertMenu(index, Menu menu) |
Inserts a menu at the specified index in the menubar.