A native menubar. 更多...
import 语句: | import Qt.labs.platform |
继承: |
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:
注意: Types in Qt.labs modules are not guaranteed to remain compatible in future versions.
另请参阅 Menu .
This default property holds the list of all objects declared as children of the menubar. The data property includes objects that are not Menu 实例,譬如 Timer and QtObject .
另请参阅 menus .
This property holds the list of menus in the menubar.
window : Window |
This property holds the menubar's window.
Unless explicitly set, the window is automatically resolved by iterating the QML parent objects until a Window 或 Item that has a window is found.
void addMenu ( Menu menu ) |
添加 menu to end of the menubar.
void clear () |
Removes all menus from the menubar.
插入 menu at the specified index in the menubar.
void removeMenu ( Menu menu ) |
Removes a menu from the menubar.