QElectroTech  0.8-dev
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
MergeCellsCommand Class Reference

#include <templatecommands.h>

Inheritance diagram for MergeCellsCommand:
Inheritance graph
Collaboration diagram for MergeCellsCommand:
Collaboration graph

Public Member Functions

 MergeCellsCommand (const TitleBlockTemplateCellsSet &, TitleBlockTemplate *=nullptr, QUndoCommand *=nullptr)
 
 ~MergeCellsCommand () override
 
bool isValid () const
 
void undo () override
 
void redo () override
 
- 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 ()
 

Static Public Member Functions

static bool canMerge (const TitleBlockTemplateCellsSet &, TitleBlockTemplate *)
 

Static Private Member Functions

static TitleBlockCellgetBottomRightCell (const TitleBlockTemplateCellsSet &)
 

Private Attributes

TitleBlockCellspanning_cell_
 the cell spanning over the other ones More...
 
QHash< TitleBlockCell *, TitleBlockCell * > spanner_cells_before_merge_
 
int row_span_before_
 the row_span attribute of the spanning cell before the merge More...
 
int col_span_before_
 the col_span attribute of the spanning cell before the merge More...
 
int applied_row_span_before_
 the applied_row_span attribute of the spanning cell before the merge More...
 
int applied_col_span_before_
 the applied_col_span attribute of the spanning cell before the merge More...
 
int span_state_before_
 the span_state attribute of the spanning cell before the merge More...
 
int row_span_after_
 the row_span attribute of the spanning cell after the merge More...
 
int col_span_after_
 the col_span attribute of the spanning cell after the merge More...
 

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 merging 2 to n cells into a single one.

Constructor & Destructor Documentation

◆ MergeCellsCommand()

MergeCellsCommand::MergeCellsCommand ( const TitleBlockTemplateCellsSet merged_cells,
TitleBlockTemplate tbtemplate = nullptr,
QUndoCommand *  parent = nullptr 
)

Construct a command object that acts on tbtemplate in order to merge merged_cells. Note: you should check the resulting object is valid using isValid().

Parameters
merged_cellsCells to be merged together into a single one.
tbtemplateModified title block template.
parentParent QUndoCommand.
Here is the call graph for this function:

◆ ~MergeCellsCommand()

MergeCellsCommand::~MergeCellsCommand ( )
override

Destructor

Member Function Documentation

◆ canMerge()

bool MergeCellsCommand::canMerge ( const TitleBlockTemplateCellsSet merged_cells,
TitleBlockTemplate tbtemplate 
)
static
Parameters
merged_cellsCell sto be merged.
tbtemplateModified title block template.
Returns
true if the merge is feasible, false otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBottomRightCell()

TitleBlockCell * MergeCellsCommand::getBottomRightCell ( const TitleBlockTemplateCellsSet cells_set)
staticprivate
Parameters
cells_setSet of title block template visual cells.
Returns
the bottom right logical cell within a set of visual cells.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isValid()

bool MergeCellsCommand::isValid ( ) const
Returns
true if this command object is valid and usable, false otherwise.
Here is the caller graph for this function:

◆ redo()

void MergeCellsCommand::redo ( )
override

Apply the merge operation

Here is the call graph for this function:

◆ undo()

void MergeCellsCommand::undo ( )
override

Undo the merge operation.

Here is the call graph for this function:

Member Data Documentation

◆ applied_col_span_before_

int MergeCellsCommand::applied_col_span_before_
private

the applied_col_span attribute of the spanning cell before the merge

◆ applied_row_span_before_

int MergeCellsCommand::applied_row_span_before_
private

the applied_row_span attribute of the spanning cell before the merge

◆ col_span_after_

int MergeCellsCommand::col_span_after_
private

the col_span attribute of the spanning cell after the merge

◆ col_span_before_

int MergeCellsCommand::col_span_before_
private

the col_span attribute of the spanning cell before the merge

◆ row_span_after_

int MergeCellsCommand::row_span_after_
private

the row_span attribute of the spanning cell after the merge

◆ row_span_before_

int MergeCellsCommand::row_span_before_
private

the row_span attribute of the spanning cell before the merge

◆ span_state_before_

int MergeCellsCommand::span_state_before_
private

the span_state attribute of the spanning cell before the merge

◆ spanner_cells_before_merge_

QHash<TitleBlockCell *, TitleBlockCell *> MergeCellsCommand::spanner_cells_before_merge_
private

hash associating spanned cells with their spanner_cell attribute before the merge operation

◆ spanning_cell_

TitleBlockCell* MergeCellsCommand::spanning_cell_
private

the cell spanning over the other ones


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