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

#include <editorcommands.h>

Public Member Functions

 AddPartCommand (const QString &, ElementScene *, QGraphicsItem *, QUndoCommand *=nullptr)
 
 ~AddPartCommand () override
 Destructeur. More...
 
void undo () override
 Annule l'ajout. More...
 
void redo () override
 Refait l'ajout. 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

 AddPartCommand (const AddPartCommand &)
 

Private Attributes

QGraphicsItem * part
 Added primitive. 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 adds a primitive when editing an electrical element.

Definition at line 151 of file editorcommands.h.

Constructor & Destructor Documentation

◆ AddPartCommand() [1/2]

AddPartCommand::AddPartCommand ( const QString &  name,
ElementScene scene,
QGraphicsItem *  p,
QUndoCommand *  parent = nullptr 
)

Constructeur

Parameters
nameNom de la partie ajoutee
sceneElementScene concernee
ppartie ajoutee
parentQUndoCommand parent

Definition at line 264 of file editorcommands.cpp.

References ElementEditionCommand::m_scene, and part.

◆ ~AddPartCommand()

AddPartCommand::~AddPartCommand ( )
override

Destructeur.

Definition at line 278 of file editorcommands.cpp.

References ElementEditionCommand::m_scene, and part.

◆ AddPartCommand() [2/2]

AddPartCommand::AddPartCommand ( const AddPartCommand )
private

Member Function Documentation

◆ redo()

void AddPartCommand::redo ( )
override

◆ undo()

void AddPartCommand::undo ( )
override

Annule l'ajout.

Definition at line 283 of file editorcommands.cpp.

References ElementEditionCommand::m_scene, and part.

Member Data Documentation

◆ first_redo

bool AddPartCommand::first_redo
private

Prevent the first call to redo()

Definition at line 169 of file editorcommands.h.

Referenced by redo().

◆ part

QGraphicsItem* AddPartCommand::part
private

Added primitive.

Definition at line 167 of file editorcommands.h.

Referenced by AddPartCommand(), redo(), undo(), and ~AddPartCommand().


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