Home · All Classes · Main Classes · Deprecated |
Cut/Copy/Paste etc. popup-toolbar for MTextEdit[View]. More...
Inherits MStylableWidget.
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 |
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.
MEditorToolbar::MEditorToolbar | ( | MWidget * | actionSource | ) | [explicit] |
Construct MEditorToolbar to follow actions of actionSource.
MEditorToolbar::~MEditorToolbar | ( | ) | [virtual] |
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 |
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.
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.
void MEditorToolbar::setForbiddenRegion | ( | const QRegion & | forbiddenRegion | ) |
Define which region should not be covered by toolbar, if it is possible.
forbiddenRegion | Region which sould be avoided by toolbar. |
void MEditorToolbar::setPosition | ( | const QPointF & | pos, | |
ToolbarPlacement | placement | |||
) |
Set position of the toolbar.
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.
MEditorToolbar::autoHide [read, write] |
Controls auto-hiding of MEditorToolbar after a timeout.
Copyright © 2010 Nokia Corporation | MeeGo Touch |