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

#include <editorcommands.h>

Public Member Functions

 PastePartsCommand (ElementView *, const ElementContent &, QUndoCommand *=nullptr)
 
 ~PastePartsCommand () override
 Destructeur. More...
 
void undo () override
 annule le coller More...
 
void redo () override
 refait le coller More...
 
virtual void setOffset (int, const QPointF &, int, const QPointF &)
 
- 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

 PastePartsCommand (const PastePartsCommand &)
 

Private Attributes

ElementContent content_
 Pasted content. More...
 
int old_offset_paste_count_
 Data required to undo a copy/paste with offset. More...
 
QPointF old_start_top_left_corner_
 
int new_offset_paste_count_
 
QPointF new_start_top_left_corner_
 
bool uses_offset
 
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 pastes primitives when editing an electrical element.

Definition at line 82 of file editorcommands.h.

Constructor & Destructor Documentation

◆ PastePartsCommand() [1/2]

PastePartsCommand::PastePartsCommand ( ElementView view,
const ElementContent c,
QUndoCommand *  parent = nullptr 
)

Constructeur

Parameters
viewElementView concernee
cListe des parties collees
parentQUndoCommand parent

Definition at line 129 of file editorcommands.cpp.

References content_, ElementEditionCommand::m_scene, and QET::Icons::tr.

◆ ~PastePartsCommand()

PastePartsCommand::~PastePartsCommand ( )
override

Destructeur.

Definition at line 144 of file editorcommands.cpp.

References content_, and ElementEditionCommand::m_scene.

◆ PastePartsCommand() [2/2]

PastePartsCommand::PastePartsCommand ( const PastePartsCommand )
private

Member Function Documentation

◆ redo()

void PastePartsCommand::redo ( )
override

◆ setOffset()

void PastePartsCommand::setOffset ( int  old_offset_pc,
const QPointF &  old_start_tlc,
int  new_offset_pc,
const QPointF &  new_start_tlc 
)
virtual

Indique a cet objet d'annulation que le c/c a annuler ou refaire etait un c/c avec decalage ; il faut plus d'informations pour annuler ce type de collage.

Definition at line 187 of file editorcommands.cpp.

References new_offset_paste_count_, new_start_top_left_corner_, old_offset_paste_count_, old_start_top_left_corner_, and uses_offset.

◆ undo()

void PastePartsCommand::undo ( )
override

Member Data Documentation

◆ content_

ElementContent PastePartsCommand::content_
private

Pasted content.

Definition at line 99 of file editorcommands.h.

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

◆ first_redo

bool PastePartsCommand::first_redo
private

Prevent the first call to redo()

Definition at line 107 of file editorcommands.h.

Referenced by redo().

◆ new_offset_paste_count_

int PastePartsCommand::new_offset_paste_count_
private

Definition at line 103 of file editorcommands.h.

Referenced by redo(), and setOffset().

◆ new_start_top_left_corner_

QPointF PastePartsCommand::new_start_top_left_corner_
private

Definition at line 104 of file editorcommands.h.

Referenced by redo(), and setOffset().

◆ old_offset_paste_count_

int PastePartsCommand::old_offset_paste_count_
private

Data required to undo a copy/paste with offset.

Definition at line 101 of file editorcommands.h.

Referenced by setOffset(), and undo().

◆ old_start_top_left_corner_

QPointF PastePartsCommand::old_start_top_left_corner_
private

Definition at line 102 of file editorcommands.h.

Referenced by setOffset(), and undo().

◆ uses_offset

bool PastePartsCommand::uses_offset
private

Definition at line 105 of file editorcommands.h.

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


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