Home · All Classes · Annotated · Functions

QSoftMenuBar Class Reference

The QSoftMenuBar class allows the label in the phone soft menu bar to be set. More...

#include <QSoftMenuBar>

Public Types

Static Public Members


Detailed Description

The QSoftMenuBar class allows the label in the phone soft menu bar to be set.

QSoftMenuBar is only available in the Qtopia phone edition. It is used to set the icon/text in the soft menu bar to describe the action performed when pressing the associated soft button. Keep in mind that not all phones have soft keys and therefore may not have a visible soft menu bar. The application should be useable without soft key shortcuts.

The labels are updated whenever a widget gains or loses focus or their navigation focus state changes. Therefore, the labels should be set for each widget that may gain focus, and will respond to a soft key. The standard Qt and Qtopia widgets set the labels appropriately, so this is usually only necessary for custom widgets.

The rule for determining what label is displayed on the soft menu bar and where the key events are delivered is:

QSoftMenuBar labels specify both a pixmap and a text label. Currently, Qtopia Phone Edition will always use the pixmap rather than text. The text label must still be provided because future versions of Qtopia Phone Edition may allow the user to choose to view text labels.

QSoftMenuBar is only available in the Qtopia Phone Edition.

See also QWidget::hasEditFocus().


Member Type Documentation

enum QSoftMenuBar::FocusState

ConstantValueDescription
QSoftMenuBar::EditFocus1apply the label setting when the widget has edit focus.
QSoftMenuBar::NavigationFocus2apply the label setting when the widget does not have edit focus.
QSoftMenuBar::AnyFocus3apply the label setting regardless of focus state.

enum QSoftMenuBar::StandardLabel

ConstantValue
QSoftMenuBar::NoLabel0
QSoftMenuBar::Options1
QSoftMenuBar::Ok2
QSoftMenuBar::Edit3
QSoftMenuBar::Select4
QSoftMenuBar::View5
QSoftMenuBar::Cancel6
QSoftMenuBar::Back7
QSoftMenuBar::BackSpace8
QSoftMenuBar::Next9
QSoftMenuBar::Previous10


Member Function Documentation

void QSoftMenuBar::addMenuTo ( QWidget * widget, QMenu * menu, FocusState state = AnyFocus )   [static]

Adds QMenu menu to widget widget for focus state state.

See also removeMenuFrom().

void QSoftMenuBar::clearLabel ( QWidget * w, int key, FocusState state = AnyFocus )   [static]

Clears any label set for widget w, key key in state state.

See also setLabel().

QMenu * QSoftMenuBar::createEditMenu ()   [static]

Creates and returns a standard "Edit" menu used for QLineEdit and QTextEdit.

bool QSoftMenuBar::hasMenu ( QWidget * widget, FocusState state = AnyFocus )   [static]

Returns true if the widget widget has a menu assigned to it in focus state state.

See also menuFor().

const QList<int> & QSoftMenuBar::keys ()   [static]

Returns the list of soft keys (i.e. keys with a corresponding label in the soft menu bar).

QMenu * QSoftMenuBar::menuFor ( QWidget * widget, FocusState state = AnyFocus )   [static]

Returns the QMenu assigned to widget widget in focus state state. If a QMenu does not yet exist for the widget, an empty menu will be created with widget as its parent.

See also addMenuTo().

int QSoftMenuBar::menuKey ()   [static]

Returns the key that activates menus managed by the soft menu bar.

void QSoftMenuBar::removeMenuFrom ( QWidget * widget, QMenu * menu, FocusState state = AnyFocus )   [static]

Removes this QMenu menu from widget widget for focus state state.

See also addMenuTo().

void QSoftMenuBar::setCancelEnabled ( QWidget * widget, bool enable )   [static]

Sets whether cancel is available for widget widget when a menu attached to it is shown and the widget's top level window is a QDialog. If enable is true cancel will be available for the dialog.

void QSoftMenuBar::setHelpEnabled ( QWidget * widget, bool enable )   [static]

Sets whether help is available for widget widget when a menu attached to it is shown. If enable is true help will be available for the widget.

void QSoftMenuBar::setLabel ( QWidget * w, int key, const QString & pm, const QString & t, FocusState state = AnyFocus )   [static]

When widget w gains focus, sets the label in the soft menu bar for key key to text t and pixmap pm when in state state.

The pixmaps used in the soft menu bar may be no larger than 22x16 pixels.

void QSoftMenuBar::setLabel ( QWidget * w, int key, StandardLabel label, FocusState state = AnyFocus )   [static]

This is an overloaded member function, provided for convenience.

When widget w gains focus, sets the label in the soft menu bar for key key to the standard label label when in state state.


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7