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

Line to command class. More...

#include <Commands.h>

Inheritance diagram for LineToCommand:
Collaboration diagram for LineToCommand:

Public Member Functions

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

Private Attributes

Editorm_editor
 
QPointF m_to
 
QPainterPath m_path
 

Detailed Description

Line to command class.

Implement a line to operation on the QPainterPath for the current symbol. The line is added to the current sub path.

The original path is stored for a possible undo.

Definition at line 64 of file Commands.h.

Constructor & Destructor Documentation

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

Constructor

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

Definition at line 112 of file Commands.cpp.

LineToCommand::~LineToCommand ( )
virtual

Destructor

Definition at line 123 of file Commands.cpp.

Member Function Documentation

void LineToCommand::redo ( )
virtual

Redo the line command. Call the Editor lineTo function with the m_to point returning the QPainterPath existing before the lineTo which is saved for undo.

Definition at line 141 of file Commands.cpp.

Here is the call graph for this function:

void LineToCommand::undo ( )
virtual

Undo the line command. Restore the path saved during redo.

Definition at line 131 of file Commands.cpp.

Here is the call graph for this function:

Member Data Documentation

Editor* LineToCommand::m_editor
private

pointer to the editor

Definition at line 74 of file Commands.h.

QPainterPath LineToCommand::m_path
private

original path to be restored on undo

Definition at line 76 of file Commands.h.

QPointF LineToCommand::m_to
private

point to draw to

Definition at line 75 of file Commands.h.


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