MenuBar QML Type
Eine native Menüleiste. Mehr...
Import Statement: | import Qt.labs.platform |
Inherits: |
Eigenschaften
Methoden
- void addMenu(Menu menu)
- void clear()
- void insertMenu(int index, Menu menu)
- void removeMenu(Menu menu)
Detaillierte Beschreibung
Der MenuBar-Typ bietet eine QML-API für plattformeigene Menüleisten.
Eine Menüleiste besteht aus einer Liste von Dropdown-Menüs.
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 ist derzeit auf den folgenden Plattformen verfügbar:
- macOS
- Android
- Linux (nur auf Desktop-Umgebungen verfügbar, die eine globale D-Bus-Menüleiste bereitstellen)
- Windows
Hinweis: Es ist nicht garantiert, dass Typen in Qt.labs-Modulen in zukünftigen Versionen kompatibel bleiben.
Siehe auch Menu.
Eigenschaft Dokumentation
window : Window |
Methode Dokumentation
void addMenu(Menu menu) |
Fügt ein menu am Ende der Menüleiste ein.
void clear() |
Entfernt alle Menüs aus der Menuleiste.
void removeMenu(Menu menu) |
Entfernt ein menu aus der Menüleiste.
© 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.