Qt Components Hildon  0.20
QML components for Maemo5 with Hildon styling.
 All Classes Functions Properties Groups Pages
Public Slots | Signals | Properties | List of all members
Menu Class Reference

A popup menu. More...

Public Slots

MenuItem addItem (string text)
 Adds a MenuItem with text and returns it.
Menu addMenu (string title)
 Adds a Menu with title and returns it.
MenuItem insertItem (int before, string text)
 Inserts a MenuItem with text before the item at index before and returns it.
Menu insertMenu (int before, string title)
 Inserts a Menu with title before the item at index before and returns it.
void popup ()
 Displays the menu at the current cursor position.
void removeItem (object item)
 Removes the item from the menu.

Signals

void aboutToHide ()
 Emitted when the menu is about to be hidden.
void aboutToShow ()
 Emitted when the menu is about to be displayed.

Properties

bool enabled
 Whether the menu is enabled.
string iconName
 The name of the icon to be used.
string iconSource
 The source of the icon to be used.
list< object > items
 The items of the menu.
string title
 The display title of the menu.
bool visible
 Whether the menu should be visible as a submenu of another Menu.

Detailed Description

A popup menu.

The Menu component is used to display a popup context menu.

Menu {
id: menu
text: qsTr("MenuItem One")
onTriggered: console.log(qsTr("MenuItem One triggered"))
}
text: qsTr("MenuItem Two")
onTriggered: console.log(qsTr("MenuItem Two triggered"))
}
Menu {
title: qsTr("Submenu One")
MenuItem {
text: qsTr("MenuItem Three")
onTriggered: console.log(qsTr("MenuItem Three triggered"))
}
}
}
See Also
MenuItem
Examples:
actions.qml, and menus.qml.

Member Function Documentation

void Menu::aboutToHide ( )
signal

Emitted when the menu is about to be hidden.

See Also
aboutToShow()
void Menu::aboutToShow ( )
signal

Emitted when the menu is about to be displayed.

See Also
aboutToHide()

Property Documentation

bool Menu::enabled
readwrite

Whether the menu is enabled.

The default value is true.

string Menu::iconName
readwrite

The name of the icon to be used.

See Also
iconSource
string Menu::iconSource
readwrite

The source of the icon to be used.

See Also
iconName
bool Menu::visible
readwrite

Whether the menu should be visible as a submenu of another Menu.

The default value is true.