SymbolEditor  1.3.0
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
MoveToCommand Class Reference

Move to command class. More...

#include <Commands.h>

Inheritance diagram for MoveToCommand:
Collaboration diagram for MoveToCommand:

Public Member Functions

 MoveToCommand (Editor *editor, const QPointF &to)
 
virtual ~MoveToCommand ()
 
virtual void undo ()
 
virtual void redo ()
 

Private Attributes

Editorm_editor
 
QPointF m_to
 
QPainterPath m_path
 

Detailed Description

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.

Constructor & Destructor Documentation

MoveToCommand::MoveToCommand ( Editor editor,
const QPointF &  to 
)

Constructor

Parameters
editora pointer to the Editor
toa const reference to a QPointF representing the point to move to

Definition at line 71 of file Commands.cpp.

MoveToCommand::~MoveToCommand ( )
virtual

Destructor

Definition at line 82 of file Commands.cpp.

Member Function Documentation

void MoveToCommand::redo ( )
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.

Here is the call graph for this function:

void MoveToCommand::undo ( )
virtual

Undo the move to command. Restores the path saved during redo.

Definition at line 90 of file Commands.cpp.

Here is the call graph for this function:

Member Data Documentation

Editor* MoveToCommand::m_editor
private

pointer to the editor

Definition at line 50 of file Commands.h.

QPainterPath MoveToCommand::m_path
private

original path to be restored on undo

Definition at line 52 of file Commands.h.

QPointF MoveToCommand::m_to
private

point to move to

Definition at line 51 of file Commands.h.


The documentation for this class was generated from the following files: