QElectroTech
0.70
|
#include <templatecommands.h>
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.
Definition at line 33 of file templatecommands.h.
ModifyTitleBlockCellCommand::ModifyTitleBlockCellCommand | ( | TitleBlockCell * | cell, |
QUndoCommand * | parent = nullptr |
||
) |
Constructor
cell | Modified cell |
parent | Parent QUndoCommand |
Definition at line 31 of file templatecommands.cpp.
|
override |
Destructor
Definition at line 41 of file templatecommands.cpp.
|
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. |
Definition at line 138 of file templatecommands.cpp.
References modified_cell_, new_values_, and old_values_.
TitleBlockCell * ModifyTitleBlockCellCommand::cell | ( | ) | const |
Definition at line 95 of file templatecommands.cpp.
References modified_cell_.
void ModifyTitleBlockCellCommand::clear | ( | ) |
Erase the known old/new values.
Definition at line 125 of file templatecommands.cpp.
References new_values_, and old_values_.
|
override |
Definition at line 48 of file templatecommands.cpp.
References MODIFY_TITLE_BLOCK_CELL_COMMAND_ID.
|
override |
command | Command to merge with. |
Definition at line 57 of file templatecommands.cpp.
References modified_cell_, and new_values_.
|
override |
Redo the change.
Definition at line 84 of file templatecommands.cpp.
References modified_cell_, new_values_, and view_.
void ModifyTitleBlockCellCommand::setCell | ( | TitleBlockCell * | modified_cell | ) |
Set the cell modified by this command object
modified_cell | the cell modified by this command |
Definition at line 103 of file templatecommands.cpp.
References modified_cell_.
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 |
Definition at line 118 of file templatecommands.cpp.
|
override |
Undo the change.
Definition at line 73 of file templatecommands.cpp.
References modified_cell_, old_values_, and view_.
TitleBlockTemplateView * ModifyTitleBlockCellCommand::view | ( | ) | const |
Definition at line 110 of file templatecommands.cpp.
References view_.
Referenced by setView().
|
private |
modified cell
Definition at line 57 of file templatecommands.h.
Referenced by addModification(), cell(), mergeWith(), redo(), setCell(), and undo().
|
private |
values after the cell has been modified
Definition at line 59 of file templatecommands.h.
Referenced by addModification(), clear(), mergeWith(), and redo().
|
private |
values before the cell is modified
Definition at line 58 of file templatecommands.h.
Referenced by addModification(), clear(), and undo().
|
private |