Home · All Classes · Main Classes · Deprecated |
The MWidgetAction class extends MAction by an interface for inserting custom widgets into action based containers, such as MToolBar. More...
Inherits MAction.
Public Member Functions | |
MWidgetAction (QObject *parent) | |
virtual | ~MWidgetAction () |
void | setWidget (MWidget *w) |
MWidget * | widget () const |
MWidget * | requestWidget (MWidget *parent) |
void | releaseWidget (MWidget *widget) |
bool | isWidgetInUse () const |
The MWidgetAction class extends MAction by an interface for inserting custom widgets into action based containers, such as MToolBar.
A custom widget can be set using setWidget() and that widget will then be used if the action is added to a MToolBar, or in general to an action container that supports MWidgetAction. If a MWidgetAction is added to two toolbars (e.g.) at the same time then the widget is shown only in the first toolbar the action was added to. MWidgetAction takes over ownership of the widget.
Note that it is up to the widget to activate the action, for example by reimplementing mouse event handlers and calling MAction::trigger().
MWidgetAction::MWidgetAction | ( | QObject * | parent | ) | [explicit] |
Default constructor.
parent | Pointer to parent object |
MWidgetAction::~MWidgetAction | ( | ) | [virtual] |
Destructor.
bool MWidgetAction::isWidgetInUse | ( | ) | const |
Returns the status whether the default widget is in use or not.
void MWidgetAction::releaseWidget | ( | MWidget * | widget | ) |
Releases the specified widget.
Container widgets that support actions call this function when a widget action is removed.
Returns a widget that represents the action, with the given parent.
Container widgets that support actions can call this function to request a widget as visual representation of the action.
void MWidgetAction::setWidget | ( | MWidget * | w | ) |
Sets widget to the action.
The ownership is transferred to MWidgetAction.
MWidget * MWidgetAction::widget | ( | ) | const |
Returns the widget attached.
Copyright © 2010 Nokia Corporation | MeeGo Touch |