QElectroTech  0.70
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
SplitCellsCommand Class Reference

#include <templatecommands.h>

Public Member Functions

 SplitCellsCommand (const TitleBlockTemplateCellsSet &, TitleBlockTemplate *=nullptr, QUndoCommand *=nullptr)
 
 ~SplitCellsCommand () 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 canSplit (const TitleBlockTemplateCellsSet &splitted_cells, TitleBlockTemplate *tbtemplate)
 

Private Attributes

TitleBlockCellspanning_cell_
 the cell spanning over the other ones More...
 
QSet< TitleBlockCell * > spanned_cells_
 the spanned cells More...
 
int row_span_before_
 the row_span attribute of the spanning cell before splitting More...
 
int col_span_before_
 the col_span attribute of the spanning cell before splitting More...
 
int applied_row_span_before_
 the applied_row_span attribute of the spanning cell before splitting More...
 
int applied_col_span_before_
 the applied_col_span attribute of the spanning cell before splitting More...
 
int span_state_before_
 the span_state attribute of the spanning cell before splitting 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 splitting a visual cell into at least two logical cells

Definition at line 211 of file templatecommands.h.

Constructor & Destructor Documentation

◆ SplitCellsCommand()

SplitCellsCommand::SplitCellsCommand ( const TitleBlockTemplateCellsSet splitted_cells,
TitleBlockTemplate tbtemplate = nullptr,
QUndoCommand *  parent = nullptr 
)

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

Parameters
splitted_cellsCell to be splitted.
tbtemplateModified title block template.
parentParent QUndoCommand.

Definition at line 744 of file templatecommands.cpp.

References applied_col_span_before_, applied_row_span_before_, canSplit(), col_span_before_, row_span_before_, span_state_before_, spanned_cells_, spanning_cell_, TitleBlockTemplateCommand::tbtemplate_, and QET::Icons::tr.

◆ ~SplitCellsCommand()

SplitCellsCommand::~SplitCellsCommand ( )
override

Destructor

Definition at line 774 of file templatecommands.cpp.

Member Function Documentation

◆ canSplit()

bool SplitCellsCommand::canSplit ( const TitleBlockTemplateCellsSet splitted_cells,
TitleBlockTemplate tbtemplate 
)
static
Parameters
splitted_cellsCell to be splitted.
tbtemplateModified title block template.
Returns
true if the split is feasible, false otherwise

Definition at line 782 of file templatecommands.cpp.

Referenced by TitleBlockTemplateView::analyzeSelectedCells(), and SplitCellsCommand().

◆ isValid()

bool SplitCellsCommand::isValid ( ) const
Returns
true if this command object is valid and usable, false otherwise.

Definition at line 801 of file templatecommands.cpp.

References spanned_cells_, and spanning_cell_.

Referenced by redo(), and undo().

◆ redo()

void SplitCellsCommand::redo ( )
override

◆ undo()

void SplitCellsCommand::undo ( )
override

Member Data Documentation

◆ applied_col_span_before_

int SplitCellsCommand::applied_col_span_before_
private

the applied_col_span attribute of the spanning cell before splitting

Definition at line 231 of file templatecommands.h.

Referenced by SplitCellsCommand(), and undo().

◆ applied_row_span_before_

int SplitCellsCommand::applied_row_span_before_
private

the applied_row_span attribute of the spanning cell before splitting

Definition at line 230 of file templatecommands.h.

Referenced by SplitCellsCommand(), and undo().

◆ col_span_before_

int SplitCellsCommand::col_span_before_
private

the col_span attribute of the spanning cell before splitting

Definition at line 229 of file templatecommands.h.

Referenced by SplitCellsCommand(), and undo().

◆ row_span_before_

int SplitCellsCommand::row_span_before_
private

the row_span attribute of the spanning cell before splitting

Definition at line 228 of file templatecommands.h.

Referenced by SplitCellsCommand(), and undo().

◆ span_state_before_

int SplitCellsCommand::span_state_before_
private

the span_state attribute of the spanning cell before splitting

Definition at line 232 of file templatecommands.h.

Referenced by SplitCellsCommand(), and undo().

◆ spanned_cells_

QSet<TitleBlockCell *> SplitCellsCommand::spanned_cells_
private

the spanned cells

Definition at line 227 of file templatecommands.h.

Referenced by isValid(), redo(), SplitCellsCommand(), and undo().

◆ spanning_cell_

TitleBlockCell* SplitCellsCommand::spanning_cell_
private

the cell spanning over the other ones

Definition at line 226 of file templatecommands.h.

Referenced by isValid(), redo(), SplitCellsCommand(), and undo().


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