Home · All Classes · Main Classes · Deprecated
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Properties

MEditorToolbar Class Reference

Cut/Copy/Paste etc. popup-toolbar for MTextEdit[View]. More...

Inherits MStylableWidget.

List of all members.

Public Types

enum  ToolbarPlacement { BelowPointOfInterest, AbovePointOfInterest }

Public Slots

void appear ()
void disappear ()

Signals

void sizeChanged ()

Public Member Functions

 MEditorToolbar (MWidget *actionSource)
virtual ~MEditorToolbar ()
void setForbiddenRegion (const QRegion &forbiddenRegion)
void setPosition (const QPointF &pos, ToolbarPlacement placement)
bool isAppeared () const
bool isAutoHideEnabled () const
void setAutoHideEnabled (bool enable)

Protected Slots

virtual void updateGeometry ()

Properties

bool autoHide

Detailed Description

Cut/Copy/Paste etc. popup-toolbar for MTextEdit[View].

Actions such as MTextEdit's default cut, copy and paste are added to MEditorToolbar as standard QActions using QGraphicsWidget::addAction(). You can only append actions, inserting to arbitrary positions is not supported. Actions are represented as clickable buttons.

The only supported action properties are visible and text.

The only supported action property changes are changes to the visible property.

While MEditorToolbar inherits from MStylableWidget, you must not try to control visibility using hide(), show(), setVisible() and isVisibile(). Use appear, disappear and isAppeared instead. This widget actually becomes a child of an internal overlay widget.

There is no specific reason why this class could not be used with widgets other than MTextEdit but no promises about applicability to other use cases are made.


Member Enumeration Documentation

Configure placement of the toolbar with respect to its position.

Enumerator:
BelowPointOfInterest 

Below origin, arrow pointing upwards.

AbovePointOfInterest 

Above origin, arrow pointing downwards.


Constructor & Destructor Documentation

MEditorToolbar::MEditorToolbar ( MWidget actionSource  )  [explicit]

Construct MEditorToolbar to follow actions of actionSource.

Parameters:
actionSource An MWidget whose actions are to be shown in toolbar. Also the widget is positioned as if actionSource was its parent item, with setPosition. This parameter must point to MWidget that has been added to MScene.
MEditorToolbar::~MEditorToolbar (  )  [virtual]

Member Function Documentation

void MEditorToolbar::appear (  )  [slot]

Show the toolbar.

Nothing is shown unless/until at least one action is in visible state.

void MEditorToolbar::disappear (  )  [slot]

Hide the toolbar.

bool MEditorToolbar::isAppeared (  )  const
Returns:
whether the widget is appeared or not.

Widget is considered appeared always after appear() is called, even if there is no buttons to show and widget would seem to be hidden.

bool MEditorToolbar::isAutoHideEnabled (  )  const

Query whether auto-hiding is enabled.

Auto-hiding will hide the toolbar after a timeout, defined in style by the attribute hide-timeout.

See also:
setAutoHideEnabled
void MEditorToolbar::setAutoHideEnabled ( bool  enable  ) 

Enables or disables auto-hiding.

When auto-hiding is enabled the toolbar will disappear after a period of time. If toolbar is initially disappeared the countdown for disappearance will not start until appear() is called.

See also:
isAutoHideEnabled
void MEditorToolbar::setForbiddenRegion ( const QRegion forbiddenRegion  ) 

Define which region should not be covered by toolbar, if it is possible.

Parameters:
forbiddenRegion Region which sould be avoided by toolbar.
void MEditorToolbar::setPosition ( const QPointF pos,
ToolbarPlacement  placement 
)

Set position of the toolbar.

Parameters:
pos position in the local coordinate system of actionSource given to the constructor. Position should be the point MEditorToolbar actions apply to, such as cursor or selection.
placement Placement of the toolbar with respect to the point of interest pos.
void MEditorToolbar::sizeChanged (  )  [signal]

Emitted when the size of the toolbar is changed.

void MEditorToolbar::updateGeometry (  )  [protected, virtual, slot]

Reimplemented from QGraphicsWidget.


Property Documentation

MEditorToolbar::autoHide [read, write]

Controls auto-hiding of MEditorToolbar after a timeout.

See also:
isAutoHideEnabled, setAutoHideEnabled

Copyright © 2010 Nokia Corporation
MeeGo Touch