Menu QML Type

Displays a menu More...

Import Statement: import quey.ui 0.1
Inherits:

PopupBase

Properties

Signals

Detailed Description

import QtQuick 2.4
import quey.ui 0.1

ApplicationView {
    width: 640
    height: 480

    MenuButton {
        id: button
        anchors.centerIn: parent
        menu: Menu {
            parent: button
            items: [
                MenuItem {
                    text: "File"
                    iconName: "open"
                    actions: [
                        Action {
                            text: "New"
                            onTriggered: console.log("New triggered")
                        },
                        Action {
                            text: "Open"
                            onTriggered: console.log("Open triggered")
                        }
                    ]
                },
                MenuItem {
                    text: "Edit"
                    iconName: "edit"
                    onTriggered: console.log("Edit triggered")
                },
                MenuItem {
                    text: "Quit"
                    onTriggered: Qt.quit()
                }

            ]
        }
    }
}

Property Documentation

availableHeight : real

The available hight. Defaults to the parent height.


itemDelegate : Component

This delegate represents the items visually. Defaults to a MenuListItem.


items : MenuItem

A list of MenuItem.


selectedItem : var

The currently selected item.


Signal Documentation

itemTriggered(int index)

Emitted when an item was triggered.