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

#include <templatecommands.h>

Public Member Functions

 ModifyTemplateDimension (TitleBlockTemplate *=nullptr, QUndoCommand *=nullptr)
 
 ~ModifyTemplateDimension () override
 
int index () const
 
void setIndex (int)
 
int type () const
 
void setType (bool)
 
TitleBlockDimension dimensionBefore () const
 
void setDimensionBefore (const TitleBlockDimension &)
 
TitleBlockDimension dimensionAfter () const
 
void setDimensionAfter (const TitleBlockDimension &)
 
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 ()
 

Private Member Functions

 ModifyTemplateDimension (const ModifyTemplateDimension &)
 
void updateText ()
 
void apply (const TitleBlockDimension &)
 

Private Attributes

int index_
 Index of the resized row/column. More...
 
bool type_
 true for a row, false for a column More...
 
TitleBlockDimension before_
 Size of the row/column before it is changed. More...
 
TitleBlockDimension after_
 Size of the row/column after it is changed. 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 changing the width/height of a specific row/column within a title block template.

Definition at line 140 of file templatecommands.h.

Constructor & Destructor Documentation

◆ ModifyTemplateDimension() [1/2]

ModifyTemplateDimension::ModifyTemplateDimension ( TitleBlockTemplate tbtemplate = nullptr,
QUndoCommand *  parent = nullptr 
)

Construct a default ModifyTemplateDimension.

Parameters
tbtemplateModified title block template
parentParent QUndoCommand

Definition at line 463 of file templatecommands.cpp.

◆ ~ModifyTemplateDimension()

ModifyTemplateDimension::~ModifyTemplateDimension ( )
override

Destructor

Definition at line 475 of file templatecommands.cpp.

◆ ModifyTemplateDimension() [2/2]

ModifyTemplateDimension::ModifyTemplateDimension ( const ModifyTemplateDimension )
private

Member Function Documentation

◆ apply()

void ModifyTemplateDimension::apply ( const TitleBlockDimension dimension)
private

Applies a given size to the row/column

Parameters
dimensionSize to apply

Definition at line 566 of file templatecommands.cpp.

References index_, TitleBlockTemplateCommand::tbtemplate_, type_, and TitleBlockTemplateCommand::view_.

Referenced by redo(), and undo().

◆ dimensionAfter()

TitleBlockDimension ModifyTemplateDimension::dimensionAfter ( ) const
Returns
the dimension of the row/column after it is resized

Definition at line 526 of file templatecommands.cpp.

References after_.

◆ dimensionBefore()

TitleBlockDimension ModifyTemplateDimension::dimensionBefore ( ) const
Returns
the dimension of the row/column before it is resized

Definition at line 512 of file templatecommands.cpp.

References before_.

◆ index()

int ModifyTemplateDimension::index ( ) const
Returns
the index of the resized row/column

Definition at line 481 of file templatecommands.cpp.

References index_.

Referenced by setIndex().

◆ redo()

void ModifyTemplateDimension::redo ( )
override

Resize the row/column.

Definition at line 547 of file templatecommands.cpp.

References after_, and apply().

◆ setDimensionAfter()

void ModifyTemplateDimension::setDimensionAfter ( const TitleBlockDimension dimension)
Parameters
dimensionthe dimension of the row/column after it is resized

Definition at line 533 of file templatecommands.cpp.

References after_.

◆ setDimensionBefore()

void ModifyTemplateDimension::setDimensionBefore ( const TitleBlockDimension dimension)
Parameters
dimensionthe dimension of the row/column before it is resized

Definition at line 519 of file templatecommands.cpp.

References before_.

◆ setIndex()

void ModifyTemplateDimension::setIndex ( int  index)

Set the index of the resized row/column.

Parameters
indexIndex of the resized row/column.

Definition at line 489 of file templatecommands.cpp.

References index(), and index_.

◆ setType()

void ModifyTemplateDimension::setType ( bool  type)

Indicates whether this object resizes a row or a column.

Parameters
typetrue if this object is about resizing a row, false for a column.

Definition at line 504 of file templatecommands.cpp.

References type(), type_, and updateText().

◆ type()

int ModifyTemplateDimension::type ( ) const
Returns
true if this object is about resizing a row, false for a column.

Definition at line 496 of file templatecommands.cpp.

References type_.

Referenced by setType().

◆ undo()

void ModifyTemplateDimension::undo ( )
override

Restore the previous size of the row/column.

Definition at line 540 of file templatecommands.cpp.

References apply(), and before_.

◆ updateText()

void ModifyTemplateDimension::updateText ( )
private

Update the text describing what the command does.

Definition at line 554 of file templatecommands.cpp.

References QET::Icons::tr, and type_.

Referenced by setType().

Member Data Documentation

◆ after_

TitleBlockDimension ModifyTemplateDimension::after_
private

Size of the row/column after it is changed.

Definition at line 170 of file templatecommands.h.

Referenced by dimensionAfter(), redo(), and setDimensionAfter().

◆ before_

TitleBlockDimension ModifyTemplateDimension::before_
private

Size of the row/column before it is changed.

Definition at line 169 of file templatecommands.h.

Referenced by dimensionBefore(), setDimensionBefore(), and undo().

◆ index_

int ModifyTemplateDimension::index_
private

Index of the resized row/column.

Definition at line 167 of file templatecommands.h.

Referenced by apply(), index(), and setIndex().

◆ type_

bool ModifyTemplateDimension::type_
private

true for a row, false for a column

Definition at line 168 of file templatecommands.h.

Referenced by apply(), setType(), type(), and updateText().


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