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

#include <templatecommands.h>

Public Member Functions

 PasteTemplateCellsCommand (TitleBlockTemplate *, QUndoCommand *=nullptr)
 
 ~PasteTemplateCellsCommand () override
 
void undo () override
 
void redo () override
 
virtual void addPastedCell (TitleBlockCell *, const TitleBlockCell &)
 
virtual void addErasedCell (TitleBlockCell *, const TitleBlockCell &)
 
virtual void addCell (TitleBlockCell *, const TitleBlockCell &, const TitleBlockCell &)
 
- Public Member Functions inherited from TitleBlockTemplateCommand
 TitleBlockTemplateCommand (TitleBlockTemplate *=nullptr, QUndoCommand *=nullptr)
 
 ~TitleBlockTemplateCommand () override
 
TitleBlockTemplatetitleBlockTemplate () const
 
void setTitleBlockTemplate (TitleBlockTemplate *)
 
TitleBlockTemplateViewview () const
 
void setView (TitleBlockTemplateView *)
 
void refreshView ()
 
void refreshLayout ()
 

Public Attributes

QHash< TitleBlockCell *, QPair< int, int > > spans_before_
 Spans before operation. More...
 
QHash< TitleBlockCell *, TitleBlockCellpasted_cells_
 Pasted cells. More...
 
QHash< TitleBlockCell *, TitleBlockCellerased_cells_
 Existing cells impacted by the paste operation. More...
 

Protected Member Functions

virtual void updateText ()
 

Private Member Functions

 PasteTemplateCellsCommand (const PasteTemplateCellsCommand &)
 

Additional Inherited Members

- Protected Attributes inherited from TitleBlockTemplateCommand
TitleBlockTemplatetbtemplate_
 Modified TitleBlock Template. More...
 
TitleBlockTemplateViewview_
 This class may trigger a view update. More...
 

Detailed Description

This class represents the action of pasting a cells set.

Definition at line 290 of file templatecommands.h.

Constructor & Destructor Documentation

◆ PasteTemplateCellsCommand() [1/2]

PasteTemplateCellsCommand::PasteTemplateCellsCommand ( TitleBlockTemplate tb_template,
QUndoCommand *  parent = nullptr 
)

Constructor

Parameters
tb_templateChanged title block template
parentParent command

Definition at line 937 of file templatecommands.cpp.

◆ ~PasteTemplateCellsCommand()

PasteTemplateCellsCommand::~PasteTemplateCellsCommand ( )
override

Destructor

Definition at line 945 of file templatecommands.cpp.

◆ PasteTemplateCellsCommand() [2/2]

PasteTemplateCellsCommand::PasteTemplateCellsCommand ( const PasteTemplateCellsCommand )
private

Member Function Documentation

◆ addCell()

void PasteTemplateCellsCommand::addCell ( TitleBlockCell cell,
const TitleBlockCell before,
const TitleBlockCell after 
)
virtual

This is a convenience function equivalent to: addErasedCell(cell, before) addPastedCell(cell, after)

Definition at line 1058 of file templatecommands.cpp.

References addErasedCell(), and addPastedCell().

◆ addErasedCell()

void PasteTemplateCellsCommand::addErasedCell ( TitleBlockCell cell,
const TitleBlockCell former_cell_content 
)
virtual
Parameters
cellPointer to the cell impacted by te paste operation
former_cell_contentContent of the cell before the paste operation

Definition at line 1048 of file templatecommands.cpp.

References erased_cells_, and updateText().

Referenced by addCell().

◆ addPastedCell()

void PasteTemplateCellsCommand::addPastedCell ( TitleBlockCell cell,
const TitleBlockCell new_cell_content 
)
virtual
Parameters
cellPointer to the cell impacted by te paste operation
new_cell_contentContent pasted to the cell

Definition at line 1040 of file templatecommands.cpp.

References pasted_cells_.

Referenced by addCell().

◆ redo()

void PasteTemplateCellsCommand::redo ( )
override

◆ undo()

void PasteTemplateCellsCommand::undo ( )
override

◆ updateText()

void PasteTemplateCellsCommand::updateText ( )
protectedvirtual

Update the label describing this command

Definition at line 951 of file templatecommands.cpp.

References erased_cells_, and QET::Icons::tr.

Referenced by addErasedCell().

Member Data Documentation

◆ erased_cells_

QHash<TitleBlockCell *, TitleBlockCell> PasteTemplateCellsCommand::erased_cells_

Existing cells impacted by the paste operation.

Definition at line 315 of file templatecommands.h.

Referenced by addErasedCell(), redo(), undo(), and updateText().

◆ pasted_cells_

QHash<TitleBlockCell *, TitleBlockCell> PasteTemplateCellsCommand::pasted_cells_

Pasted cells.

Definition at line 313 of file templatecommands.h.

Referenced by addPastedCell(), and redo().

◆ spans_before_

QHash<TitleBlockCell *, QPair<int, int> > PasteTemplateCellsCommand::spans_before_

Spans before operation.

Definition at line 311 of file templatecommands.h.

Referenced by redo(), and undo().


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