QElectroTech
0.8-dev
|
#include <templatecommands.h>
Inherits QUndoCommand.
Public Member Functions | |
ModifyTitleBlockCellCommand (TitleBlockCell *, QUndoCommand *=nullptr) | |
~ModifyTitleBlockCellCommand () override | |
int | id () const override |
bool | mergeWith (const QUndoCommand *) override |
void | undo () override |
void | redo () override |
TitleBlockCell * | cell () const |
void | setCell (TitleBlockCell *) |
TitleBlockTemplateView * | view () const |
void | setView (TitleBlockTemplateView *) |
void | clear () |
void | addModification (const QString &, const QVariant &, bool=false) |
Private Member Functions | |
ModifyTitleBlockCellCommand (const ModifyTitleBlockCellCommand &) | |
Private Attributes | |
TitleBlockTemplateView * | view_ |
This class may trigger a view update. More... | |
TitleBlockCell * | modified_cell_ |
modified cell More... | |
QHash< QString, QVariant > | old_values_ |
values before the cell is modified More... | |
QHash< QString, QVariant > | new_values_ |
values after the cell has been modified More... | |
This class represents a set of modification applied to a title block template cell.
ModifyTitleBlockCellCommand::ModifyTitleBlockCellCommand | ( | TitleBlockCell * | cell, |
QUndoCommand * | parent = nullptr |
||
) |
Constructor
cell | Modified cell |
parent | Parent QUndoCommand |
|
override |
Destructor
|
private |
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.
attribute | Name of the modified attribute |
value | Old 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. |
TitleBlockCell * ModifyTitleBlockCellCommand::cell | ( | ) | const |
void ModifyTitleBlockCellCommand::clear | ( | ) |
Erase the known old/new values.
|
override |
|
override |
command | Command to merge with. |
|
override |
Redo the change.
void ModifyTitleBlockCellCommand::setCell | ( | TitleBlockCell * | modified_cell | ) |
Set the cell modified by this command object
modified_cell | the cell modified by this command |
void ModifyTitleBlockCellCommand::setView | ( | TitleBlockTemplateView * | view | ) |
Set the view to be updated after the cell modification
view | the view to be updated after the cell modification |
|
override |
Undo the change.
TitleBlockTemplateView * ModifyTitleBlockCellCommand::view | ( | ) | const |
|
private |
modified cell
|
private |
values after the cell has been modified
|
private |
values before the cell is modified
|
private |
This class may trigger a view update.