QElectroTech  0.70
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MovePartsCommand Class Reference

#include <editorcommands.h>

Public Member Functions

 MovePartsCommand (const QPointF &, ElementScene *, const QList< QGraphicsItem *> &, QUndoCommand *=nullptr)
 
 ~MovePartsCommand () override
 Destructeur. More...
 
void undo () override
 Annule le deplacement. More...
 
void redo () override
 Refait le deplacement. More...
 
- Public Member Functions inherited from ElementEditionCommand
 ElementEditionCommand (ElementScene *=nullptr, ElementView *=nullptr, QUndoCommand *=nullptr)
 
 ElementEditionCommand (const QString &, ElementScene *=nullptr, ElementView *=nullptr, QUndoCommand *=nullptr)
 
 ~ElementEditionCommand () override
 
ElementSceneelementScene () const
 
void setElementScene (ElementScene *)
 
ElementViewelementView () const
 
void setElementView (ElementView *)
 

Private Member Functions

 MovePartsCommand (const MovePartsCommand &)
 

Private Attributes

QList< QGraphicsItem * > moved_parts
 List of moved primitives. More...
 
QPointF movement
 applied movement More...
 
bool first_redo
 Prevent the first call to redo() More...
 

Additional Inherited Members

- Protected Attributes inherited from ElementEditionCommand
ElementScenem_scene
 Element editor/view/scene the command should take place on. More...
 
ElementViewm_view
 

Detailed Description

This command moves primitives when editing an electrical element.

Definition at line 125 of file editorcommands.h.

Constructor & Destructor Documentation

◆ MovePartsCommand() [1/2]

MovePartsCommand::MovePartsCommand ( const QPointF &  m,
ElementScene scene,
const QList< QGraphicsItem *> &  parts,
QUndoCommand *  parent = nullptr 
)

Constructeur

Parameters
mMouvement sous forme de QPointF
sceneElementScene concernee
partsListe des parties deplacees
parentQUndoCommand parent

Definition at line 224 of file editorcommands.cpp.

References moved_parts.

◆ ~MovePartsCommand()

MovePartsCommand::~MovePartsCommand ( )
override

Destructeur.

Definition at line 238 of file editorcommands.cpp.

◆ MovePartsCommand() [2/2]

MovePartsCommand::MovePartsCommand ( const MovePartsCommand )
private

Member Function Documentation

◆ redo()

void MovePartsCommand::redo ( )
override

Refait le deplacement.

Definition at line 247 of file editorcommands.cpp.

References first_redo, moved_parts, and movement.

◆ undo()

void MovePartsCommand::undo ( )
override

Annule le deplacement.

Definition at line 242 of file editorcommands.cpp.

References moved_parts, and movement.

Member Data Documentation

◆ first_redo

bool MovePartsCommand::first_redo
private

Prevent the first call to redo()

Definition at line 145 of file editorcommands.h.

Referenced by redo().

◆ moved_parts

QList<QGraphicsItem *> MovePartsCommand::moved_parts
private

List of moved primitives.

Definition at line 141 of file editorcommands.h.

Referenced by MovePartsCommand(), redo(), and undo().

◆ movement

QPointF MovePartsCommand::movement
private

applied movement

Definition at line 143 of file editorcommands.h.

Referenced by redo(), and undo().


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