MenuItem

Since: BlackBerry 10.0.0

#include <bb/system/MenuItem>

To link against this class, add the following line to your .pro file: LIBS += -lbbsystem

A menu entry that can be invoked directly or may contain additional sub-menu entries.

A menu item contains information (labels and an icon) that can be used to present the menu to the user. It also provides the action to take when the item is selected. Selecting a menu item can either initiate the invocation of a target using specific data, MIME type, and/or URI, or it can result in the presentation of a submenu to give the user more options to choose from.

To determine which action to take, check the following:
  • invoke().isValid() : If this returns true, the menu item contains a valid invocation request that should be run when the menu item is selected.

  • subMenu().isValid() : If this returns true, then the menu item contains a submenu that should be displayed when the menu item is selected.


Overview

Public Functions Index

MenuItem ()
MenuItem (const MenuItem &other)
~MenuItem ()
QUrlicon () const
MenuItemInvokeParamsinvoke () const
QStringlabel () const
MenuItem &operator= (const MenuItem &other)
QUrlsecondaryIcon () const
QStringsecondaryLabel () const
MenusubMenu () const
QStringtertiaryLabel () const

Public Functions

MenuItem ()

Creates a new MenuItem object.

Since:

BlackBerry 10.0.0

MenuItem (

Creates a copy of an existing MenuItem object.

Parameters
other

The source MenuItem object to copy.

Since:

BlackBerry 10.0.0

~MenuItem ()

Destructor.

Since:

BlackBerry 10.0.0

QUrl icon ()

Returns a path to a localized icon file that represents the menu item.

Return:

A path to a localized icon file that represents the menu item.

Since:

BlackBerry 10.0.0

MenuItemInvokeParams invoke ()

Returns the invocation parameters that will be used to invoke the action associated with this menu item when it is selected.

Return:

The invocation parameters for this menu item.

Since:

BlackBerry 10.0.0

QString label ()

Returns the localized label describing the menu item.

Return:

The localized label describing the menu item.

Since:

BlackBerry 10.0.0

MenuItem & operator= (

Copies the data from an existing MenuItem object to this object.

Parameters
other

The source MenuItem object to copy.

Return:

The MenuItem instance.

Since:

BlackBerry 10.0.0

QUrl secondaryIcon ()

Returns an optional path to a localized icon file that represents the menu item.

Return:

A path to a localized icon file that represents the menu item, or an empty QUrl if not present.

Since:

BlackBerry 10.2.0

QString secondaryLabel ()

Returns an optional secondary label describing the menu item.

Return:

The localized secondary label describing the menu item, or an empty string if not present.

Since:

BlackBerry 10.0.0

Menu subMenu ()

Returns the sub-menu that should be presented when this menu item is selected.

Return:

The sub-menu to be presented.

Since:

BlackBerry 10.0.0

QString tertiaryLabel ()

Returns an optional tertiary label describing the menu item.

Return:

The localized tertiary label describing the menu item, or an empty string if not present.

Since:

BlackBerry 10.0.0

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus