QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ModifyTitleBlockCellCommand Class Reference

#include <templatecommands.h>

Inherits QUndoCommand.

Collaboration diagram for ModifyTitleBlockCellCommand:
Collaboration graph

Public Member Functions

 ModifyTitleBlockCellCommand (TitleBlockCell *, QUndoCommand *=nullptr)
 
 ~ModifyTitleBlockCellCommand () override
 
int id () const override
 
bool mergeWith (const QUndoCommand *) override
 
void undo () override
 
void redo () override
 
TitleBlockCellcell () const
 
void setCell (TitleBlockCell *)
 
TitleBlockTemplateViewview () const
 
void setView (TitleBlockTemplateView *)
 
void clear ()
 
void addModification (const QString &, const QVariant &, bool=false)
 

Private Member Functions

 ModifyTitleBlockCellCommand (const ModifyTitleBlockCellCommand &)
 

Private Attributes

TitleBlockTemplateViewview_
 This class may trigger a view update.
 
TitleBlockCellmodified_cell_
 modified cell
 
QHash< QString, QVariant > old_values_
 values before the cell is modified
 
QHash< QString, QVariant > new_values_
 values after the cell has been modified
 

Detailed Description

This class represents a set of modification applied to a title block template cell.

Constructor & Destructor Documentation

◆ ModifyTitleBlockCellCommand() [1/2]

ModifyTitleBlockCellCommand::ModifyTitleBlockCellCommand ( TitleBlockCell cell,
QUndoCommand *  parent = nullptr 
)

Constructor

Parameters
cellModified cell
parentParent QUndoCommand

◆ ~ModifyTitleBlockCellCommand()

ModifyTitleBlockCellCommand::~ModifyTitleBlockCellCommand ( )
override

Destructor

◆ ModifyTitleBlockCellCommand() [2/2]

ModifyTitleBlockCellCommand::ModifyTitleBlockCellCommand ( const ModifyTitleBlockCellCommand )
private

Member Function Documentation

◆ addModification()

void ModifyTitleBlockCellCommand::addModification ( const QString &  attribute,
const QVariant &  value,
bool  is_old_value = false 
)

Register a new modification on a title block template cell; you may indicate either the new value or the old one: this method will systematically fetch the other one.

Parameters
attributeName of the modified attribute
valueOld or new value of the modified attribute, depending on is_old_value
is_old_value(optional, defaults to false) Indicates whether the provided value is the old or the new one.

◆ cell()

TitleBlockCell * ModifyTitleBlockCellCommand::cell ( ) const
Returns
the cell modified by this command

◆ clear()

void ModifyTitleBlockCellCommand::clear ( )

Erase the known old/new values.

◆ id()

int ModifyTitleBlockCellCommand::id ( ) const
override
See also
QUndoCommand::id()
Returns
the ID of this command.

◆ mergeWith()

bool ModifyTitleBlockCellCommand::mergeWith ( const QUndoCommand *  command)
override
See also
QUndoCommand::mergeWith()
Parameters
commandCommand to merge with.
Returns
true on success, false otherwise

◆ redo()

void ModifyTitleBlockCellCommand::redo ( )
override

Redo the change.

◆ setCell()

void ModifyTitleBlockCellCommand::setCell ( TitleBlockCell modified_cell)

Set the cell modified by this command object

Parameters
modified_cellthe cell modified by this command

◆ setView()

void ModifyTitleBlockCellCommand::setView ( TitleBlockTemplateView view)

Set the view to be updated after the cell modification

Parameters
viewthe view to be updated after the cell modification
Here is the call graph for this function:

◆ undo()

void ModifyTitleBlockCellCommand::undo ( )
override

Undo the change.

◆ view()

TitleBlockTemplateView * ModifyTitleBlockCellCommand::view ( ) const
Returns
the view to be updated after the cell modification
Here is the caller graph for this function:

Member Data Documentation

◆ modified_cell_

TitleBlockCell* ModifyTitleBlockCellCommand::modified_cell_
private

modified cell

◆ new_values_

QHash<QString, QVariant> ModifyTitleBlockCellCommand::new_values_
private

values after the cell has been modified

◆ old_values_

QHash<QString, QVariant> ModifyTitleBlockCellCommand::old_values_
private

values before the cell is modified

◆ view_

TitleBlockTemplateView* ModifyTitleBlockCellCommand::view_
private

This class may trigger a view update.


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