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

#include <diagramcommands.h>

Public Member Functions

 MoveConductorsTextsCommand (Diagram *, QUndoCommand *=nullptr)
 
 ~MoveConductorsTextsCommand () override
 Destructeur. More...
 
void undo () override
 annule le deplacement More...
 
void redo () override
 refait le deplacement More...
 
virtual void addTextMovement (ConductorTextItem *, const QPointF &, const QPointF &, bool=false)
 

Private Member Functions

 MoveConductorsTextsCommand (const MoveConductorsTextsCommand &)
 
void regenerateTextLabel ()
 

Private Attributes

Diagramdiagram
 diagram the movement takes place on. More...
 
QHash< ConductorTextItem *, QPair< QPointF, bool > > texts_to_move_
 text items to be moved More...
 
bool first_redo
 prevent the first call to redo() More...
 

Detailed Description

This command moves text items related to conductors on a particular diagram.

Definition at line 160 of file diagramcommands.h.

Constructor & Destructor Documentation

◆ MoveConductorsTextsCommand() [1/2]

MoveConductorsTextsCommand::MoveConductorsTextsCommand ( Diagram diagram,
QUndoCommand *  parent = nullptr 
)

Constructeur

Parameters
diagramSchema sur lequel on deplace des champs de texte
textsTextes deplaces : chaque ConductorTextItem est associe a un couple de position : avant et apres le deplacement
mtranslation subie par les elements
parentQUndoCommand parent

Definition at line 303 of file diagramcommands.cpp.

◆ ~MoveConductorsTextsCommand()

MoveConductorsTextsCommand::~MoveConductorsTextsCommand ( )
override

Destructeur.

Definition at line 314 of file diagramcommands.cpp.

◆ MoveConductorsTextsCommand() [2/2]

MoveConductorsTextsCommand::MoveConductorsTextsCommand ( const MoveConductorsTextsCommand )
private

Member Function Documentation

◆ addTextMovement()

void MoveConductorsTextsCommand::addTextMovement ( ConductorTextItem text_item,
const QPointF &  old_pos,
const QPointF &  new_pos,
bool  already_moved = false 
)
virtual

Ajout un mouvement de champ de texte a cet objet

Parameters
text_itemChamp de texte deplace ; si celui-ci est deja connu de l'objet d'annulation, il sera ignore
old_posPosition du champ de texte avant le mouvement
new_posPosition du champ de texte apres le mouvement
alread_movedtrue si le champ de texte etait deja a une position personnalisee par l'utilisateur, false sinon

Definition at line 353 of file diagramcommands.cpp.

References regenerateTextLabel(), and texts_to_move_.

◆ redo()

void MoveConductorsTextsCommand::redo ( )
override

refait le deplacement

Definition at line 332 of file diagramcommands.cpp.

References diagram, first_redo, and texts_to_move_.

◆ regenerateTextLabel()

void MoveConductorsTextsCommand::regenerateTextLabel ( )
private

Genere la description de l'objet d'annulation

Definition at line 367 of file diagramcommands.cpp.

References QET::ElementsAndConductorsSentence(), texts_to_move_, and QET::Icons::tr.

Referenced by addTextMovement().

◆ undo()

void MoveConductorsTextsCommand::undo ( )
override

annule le deplacement

Definition at line 318 of file diagramcommands.cpp.

References diagram, and texts_to_move_.

Member Data Documentation

◆ diagram

Diagram* MoveConductorsTextsCommand::diagram
private

diagram the movement takes place on.

Definition at line 180 of file diagramcommands.h.

Referenced by redo(), and undo().

◆ first_redo

bool MoveConductorsTextsCommand::first_redo
private

prevent the first call to redo()

Definition at line 184 of file diagramcommands.h.

Referenced by redo().

◆ texts_to_move_

QHash<ConductorTextItem *, QPair<QPointF, bool> > MoveConductorsTextsCommand::texts_to_move_
private

text items to be moved

Definition at line 182 of file diagramcommands.h.

Referenced by addTextMovement(), redo(), regenerateTextLabel(), and undo().


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