Home · All Classes · Main Classes · Deprecated |
MApplicationMenu widget shows a menu containing action commands. More...
Inherits MSceneWindow.
Public Member Functions | |
MApplicationMenu (const QString &viewType=QString()) | |
virtual | ~MApplicationMenu () |
MApplicationMenu widget shows a menu containing action commands.
Application menu is a menu element that contains MAction and MWidgetAction commands which get executed on activation. It consists of the title area (icon and optional title) for the menu, displayed in the command area of the UI. Application menu can be opened (and closed) by tapping on the menu title area. It contains commands and view settings for the view in question. Application menu is available in landscape and portrait modes.
This class is not recommended to be used directly instead action can be added to the page using: action->setLocation(MAction::ApplicationMenuLocation);
Here is a simple example that shows how actions are added to the menu.
MApplicationMenu* menu = new MApplicationMenu(); MAction * action = new MAction("Pictures", this); action->setLocation(MAction::ApplicationMenuLocation); menu->addAction(action); //adding a style action MAction * styleAction = new MAction("", this); styleAction->setLocation(MAction::ApplicationMenuLocation); styleAction->setStyleAction(true); menu->addAction(styleAction); //adding a style action which is checked MAction * styleAction = new MAction("", this); styleAction->setLocation(MAction::ApplicationMenuLocation); styleAction->setStyleAction(true); styleAction->setCheckable(true); styleAction->setChecked(true); menu->addAction(styleAction);
In some cases, an application may want to assign its own widget to an action. In principle, any widget can be assigned to an action, but in the case when an action is added to the application menu (via a call to setLocation(MAction::ApplicationMenuLocation) ), only MButtons and MComboBoxes are supported. When an application-supplied Widget is set on an action, it MUST do this before adding the action to the page. The following example shows this process:
MWidgetAction * action = new MWidgetAction("Format", this); action->setLocation(MAction::ApplicationMenuLocation); MComboBox * formats = new MComboBox(this); action->setWidget(formats); menu->addAction(action);
Constructs menu containing no actions with optional viewType.
MApplicationMenu::~MApplicationMenu | ( | ) | [virtual] |
Destructs menu.
Copyright © 2010 Nokia Corporation | MeeGo Touch |