QElectroTech
0.70
|
#include <templatecommands.h>
Public Member Functions | |
ModifyTemplateGridCommand (TitleBlockTemplate *=nullptr, QUndoCommand *=nullptr) | |
~ModifyTemplateGridCommand () override | |
int | index () const |
void | setIndex (int) |
QList< TitleBlockCell * > | cells () const |
void | setCells (const QList< TitleBlockCell *> &) |
TitleBlockDimension | dimension () const |
void | setDimension (const TitleBlockDimension &) |
int | type () const |
void | setType (bool) |
bool | isInsertion () const |
void | setInsertion (bool) |
void | undo () override |
void | redo () override |
Public Member Functions inherited from TitleBlockTemplateCommand | |
TitleBlockTemplateCommand (TitleBlockTemplate *=nullptr, QUndoCommand *=nullptr) | |
~TitleBlockTemplateCommand () override | |
TitleBlockTemplate * | titleBlockTemplate () const |
void | setTitleBlockTemplate (TitleBlockTemplate *) |
TitleBlockTemplateView * | view () const |
void | setView (TitleBlockTemplateView *) |
void | refreshView () |
void | refreshLayout () |
Static Public Member Functions | |
static ModifyTemplateGridCommand * | addRow (TitleBlockTemplate *, int=-1) |
static ModifyTemplateGridCommand * | addColumn (TitleBlockTemplate *, int=-1) |
static ModifyTemplateGridCommand * | deleteRow (TitleBlockTemplate *, int=-1) |
static ModifyTemplateGridCommand * | deleteColumn (TitleBlockTemplate *, int=-1) |
Private Member Functions | |
ModifyTemplateGridCommand (const ModifyTemplateGridCommand &) | |
void | updateText () |
void | apply (bool=false) |
Private Attributes | |
int | index_ |
Index of the inserted/deleted row/column. More... | |
QList< TitleBlockCell * > | cells_ |
Cells composing the inserted/deleted row/column. More... | |
bool | type_ |
true for a row, false for a column More... | |
TitleBlockDimension | dimension_ |
width/height of the column/row, which interpretation depends on type_ More... | |
bool | insertion_ |
Additional Inherited Members | |
Protected Attributes inherited from TitleBlockTemplateCommand | |
TitleBlockTemplate * | tbtemplate_ |
Modified TitleBlock Template. More... | |
TitleBlockTemplateView * | view_ |
This class may trigger a view update. More... | |
This class represents the action of adding or deleting a row or column within a title block template.
Definition at line 93 of file templatecommands.h.
ModifyTemplateGridCommand::ModifyTemplateGridCommand | ( | TitleBlockTemplate * | tbtemplate = nullptr , |
QUndoCommand * | parent = nullptr |
||
) |
Construct a default ModifyTemplateGridCommand, i.e. a command adding a 25px row at the bottom of the template.
tbtemplate | Modified title block template |
parent | Parent QUndoCommand |
Definition at line 303 of file templatecommands.cpp.
References updateText().
Referenced by addColumn(), addRow(), deleteColumn(), and deleteRow().
|
override |
Destructor
Definition at line 316 of file templatecommands.cpp.
|
private |
|
static |
This static method is a convenience to create a ModifyTemplateGridCommand that adds a column to tbtemplate at index.
tbtemplate | Modified title block template. |
index | Index where the column should be inserted. |
Definition at line 246 of file templatecommands.cpp.
References index(), ModifyTemplateGridCommand(), setCells(), setDimension(), setIndex(), setInsertion(), setType(), and TITLEBLOCK_DEFAULT_COL_WIDTH.
Referenced by TitleBlockTemplateView::addColumnAfter(), TitleBlockTemplateView::addColumnAtEnd(), and TitleBlockTemplateView::addColumnBefore().
|
static |
This static method is a convenience to create a ModifyTemplateGridCommand that adds a row to tbtemplate at index.
tbtemplate | Modified title block template |
index | Index where the row should be inserted. |
Definition at line 225 of file templatecommands.cpp.
References index(), ModifyTemplateGridCommand(), setCells(), setDimension(), setIndex(), setInsertion(), setType(), and TITLEBLOCK_DEFAULT_ROW_HEIGHT.
Referenced by TitleBlockTemplateView::addRowAfter(), TitleBlockTemplateView::addRowAtEnd(), and TitleBlockTemplateView::addRowBefore().
|
private |
Definition at line 433 of file templatecommands.cpp.
References cells_, dimension_, index_, insertion_, TitleBlockTemplateCommand::tbtemplate_, type_, undo(), TitleBlockDimension::value, and TitleBlockTemplateCommand::view_.
QList< TitleBlockCell * > ModifyTemplateGridCommand::cells | ( | ) | const |
Definition at line 337 of file templatecommands.cpp.
References cells_.
Referenced by setCells().
|
static |
This static method is a convenience to create a ModifyTemplateGridCommand that removes the column at index from tbtemplate.
tbtemplate | Modified title block template. |
index | Index of the removed column. |
Definition at line 286 of file templatecommands.cpp.
References index(), ModifyTemplateGridCommand(), setIndex(), setInsertion(), and setType().
Referenced by TitleBlockTemplateView::deleteColumn().
|
static |
This static method is a convenience to create a ModifyTemplateGridCommand that removes the row at index from tbtemplate.
tbtemplate | Modified title block template. |
index | Index of the removed row. |
Definition at line 267 of file templatecommands.cpp.
References index(), ModifyTemplateGridCommand(), setIndex(), setInsertion(), and setType().
Referenced by TitleBlockTemplateView::deleteRow().
TitleBlockDimension ModifyTemplateGridCommand::dimension | ( | ) | const |
Definition at line 352 of file templatecommands.cpp.
References dimension_.
Referenced by setDimension().
int ModifyTemplateGridCommand::index | ( | ) | const |
Definition at line 322 of file templatecommands.cpp.
References index_.
Referenced by addColumn(), addRow(), deleteColumn(), deleteRow(), and setIndex().
bool ModifyTemplateGridCommand::isInsertion | ( | ) | const |
Definition at line 383 of file templatecommands.cpp.
References insertion_.
|
override |
void ModifyTemplateGridCommand::setCells | ( | const QList< TitleBlockCell *> & | cells | ) |
Set the cells composing the inserted/deleted row/column.
cells | List of pointers to cells composing the inserted/deleted row/column. |
Definition at line 345 of file templatecommands.cpp.
References cells(), and cells_.
Referenced by addColumn(), and addRow().
void ModifyTemplateGridCommand::setDimension | ( | const TitleBlockDimension & | dimension | ) |
Set the dimension of the inserted/deleted row/column
dimension | Dimension of the inserted/deleted row/column |
Definition at line 360 of file templatecommands.cpp.
References dimension(), and dimension_.
Referenced by addColumn(), and addRow().
void ModifyTemplateGridCommand::setIndex | ( | int | index | ) |
Set the index of the inserted/deleted row/column.
index | Index of the inserted/deleted row/column. |
Definition at line 330 of file templatecommands.cpp.
References index(), and index_.
Referenced by addColumn(), addRow(), deleteColumn(), and deleteRow().
void ModifyTemplateGridCommand::setInsertion | ( | bool | insertion | ) |
Definition at line 390 of file templatecommands.cpp.
References insertion_, and updateText().
Referenced by addColumn(), addRow(), deleteColumn(), and deleteRow().
void ModifyTemplateGridCommand::setType | ( | bool | type | ) |
Indicates whether this object inserts/deletes a row or a column.
type | true if this object is about inserting/deleting a row, false for a column. |
Definition at line 375 of file templatecommands.cpp.
References type(), type_, and updateText().
Referenced by addColumn(), addRow(), deleteColumn(), and deleteRow().
int ModifyTemplateGridCommand::type | ( | ) | const |
Definition at line 367 of file templatecommands.cpp.
References type_.
Referenced by setType().
|
override |
Undo the change.
Definition at line 398 of file templatecommands.cpp.
References apply().
Referenced by apply().
|
private |
Update the text describing what the command does.
Definition at line 412 of file templatecommands.cpp.
References insertion_, QET::Icons::tr, and type_.
Referenced by ModifyTemplateGridCommand(), setInsertion(), and setType().
|
private |
Cells composing the inserted/deleted row/column.
Definition at line 130 of file templatecommands.h.
Referenced by apply(), cells(), and setCells().
|
private |
width/height of the column/row, which interpretation depends on type_
Definition at line 132 of file templatecommands.h.
Referenced by apply(), dimension(), and setDimension().
|
private |
Index of the inserted/deleted row/column.
Definition at line 129 of file templatecommands.h.
Referenced by apply(), index(), and setIndex().
|
private |
Definition at line 133 of file templatecommands.h.
Referenced by apply(), isInsertion(), setInsertion(), and updateText().
|
private |
true for a row, false for a column
Definition at line 131 of file templatecommands.h.
Referenced by apply(), setType(), type(), and updateText().