Home · All Classes · Main Classes · Deprecated
Public Member Functions

MWidgetAction Class Reference

The MWidgetAction class extends MAction by an interface for inserting custom widgets into action based containers, such as MToolBar. More...

Inherits MAction.

List of all members.

Public Member Functions

 MWidgetAction (QObject *parent)
virtual ~MWidgetAction ()
void setWidget (MWidget *w)
MWidgetwidget () const
MWidgetrequestWidget (MWidget *parent)
void releaseWidget (MWidget *widget)
bool isWidgetInUse () const

Detailed Description

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().

See also:
MAction

Constructor & Destructor Documentation

MWidgetAction::MWidgetAction ( QObject parent  )  [explicit]

Default constructor.

Parameters:
parent Pointer to parent object
MWidgetAction::~MWidgetAction (  )  [virtual]

Destructor.


Member Function Documentation

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.

See also:
requestWidget(), widget()
MWidget * MWidgetAction::requestWidget ( MWidget parent  ) 

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.

See also:
releaseWidget(), widget()
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