MenuBar QML Type

MenuBar defines an application menu bar structure. More...

Import Statement: import Lomiri.Components.Labs 1.3

Properties

Methods

Detailed Description

Example usage:

import QtQuick 2.4
import Lomiri.Components 1.3
import Lomiri.Components.Labs 1.0
MainView {
    MenuBar {
        Menu {
            text: "_File"

            MenuItem {
                text: "_New"
                shortcut: "Ctrl+N"
            }

            MenuItem {
                text: "_Open"
                shortcut: "Ctrl+O"
            }

            MenuSeparator {}

            MenuItem {
                action: exitAction
            }
        }

        Menu {
            text: "_Edit"

            MenuItem {
                text: "_Undo"
                iconSource: "image://theme/undo"
            }
        }
        Menu {
            text: "_Window"

            MenuItem {
                text: "Fullscreen"
                checkable: true
                checked: false
            }
        }
    }
    Action {
        id: boundAction
        text: "E_xit"
        onTriggered: {
            Qt.quit();
        }
    }
}

Property Documentation

List of Menus in this MenuBar.


Method Documentation

void appendMenu(Menu menu)

* * Append a Menu to the MenuBar


void insertMenu(int index, Menu menu)

* * Insert a Menu to the MenuBar at the specified position


void removeMenu(Menu menu)

* * Remove a Menu from the MenuBar