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

#include <editorcommands.h>

Public Member Functions

 ChangeNamesCommand (ElementScene *, const NamesList &, const NamesList &, QUndoCommand *=nullptr)
 
 ~ChangeNamesCommand () override
 Destructeur. More...
 
void undo () override
 Annule le changement. More...
 
void redo () override
 Refait le changement. 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

 ChangeNamesCommand (const ChangeNamesCommand &)
 

Private Attributes

NamesList names_before
 List of former names. More...
 
NamesList names_after
 List of new names. 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 changes the translated names of an electrical element.

Definition at line 175 of file editorcommands.h.

Constructor & Destructor Documentation

◆ ChangeNamesCommand() [1/2]

ChangeNamesCommand::ChangeNamesCommand ( ElementScene element_scene,
const NamesList before,
const NamesList after,
QUndoCommand *  parent = nullptr 
)

Constructeur

Parameters
element_sceneElement edite
beforeListes des noms avant changement
afterListes des noms apres changement
parentQUndoCommand parent

Definition at line 312 of file editorcommands.cpp.

◆ ~ChangeNamesCommand()

ChangeNamesCommand::~ChangeNamesCommand ( )
override

Destructeur.

Definition at line 325 of file editorcommands.cpp.

◆ ChangeNamesCommand() [2/2]

ChangeNamesCommand::ChangeNamesCommand ( const ChangeNamesCommand )
private

Member Function Documentation

◆ redo()

void ChangeNamesCommand::redo ( )
override

Refait le changement.

Definition at line 334 of file editorcommands.cpp.

References ElementEditionCommand::m_scene, and names_after.

◆ undo()

void ChangeNamesCommand::undo ( )
override

Annule le changement.

Definition at line 329 of file editorcommands.cpp.

References ElementEditionCommand::m_scene, and names_before.

Member Data Documentation

◆ names_after

NamesList ChangeNamesCommand::names_after
private

List of new names.

Definition at line 193 of file editorcommands.h.

Referenced by redo().

◆ names_before

NamesList ChangeNamesCommand::names_before
private

List of former names.

Definition at line 191 of file editorcommands.h.

Referenced by undo().


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