SymbolEditor
1.3.0
|
Move to command class. More...
#include <Commands.h>
Public Member Functions | |
MoveToCommand (Editor *editor, const QPointF &to) | |
virtual | ~MoveToCommand () |
virtual void | undo () |
virtual void | redo () |
Private Attributes | |
Editor * | m_editor |
QPointF | m_to |
QPainterPath | m_path |
Move to command class.
Implement a move to operation on the QPainterPath for the current symbol. If this is the first operation it updates the start position of the path, otherwise it ends the current sub path and starts a new sub path at the specified point.
The original path is stored for a possible undo.
Definition at line 40 of file Commands.h.
MoveToCommand::MoveToCommand | ( | Editor * | editor, |
const QPointF & | to | ||
) |
Constructor
editor | a pointer to the Editor |
to | a const reference to a QPointF representing the point to move to |
Definition at line 71 of file Commands.cpp.
|
virtual |
Destructor
Definition at line 82 of file Commands.cpp.
|
virtual |
Redo the move command. Call the Editor moveTo function with the m_to point returning the QPainterPath existing before the moveTo which is saved for undo.
Definition at line 100 of file Commands.cpp.
|
virtual |
Undo the move to command. Restores the path saved during redo.
Definition at line 90 of file Commands.cpp.
|
private |
pointer to the editor
Definition at line 50 of file Commands.h.
|
private |
original path to be restored on undo
Definition at line 52 of file Commands.h.
|
private |
point to move to
Definition at line 51 of file Commands.h.