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

#include <addelementtextcommand.h>

Public Member Functions

 AlignmentTextsGroupCommand (ElementTextItemGroup *group, Qt::Alignment new_alignment, QUndoCommand *parent=nullptr)
 AlignmentTextsGroupCommand::AlignmentTextsGroupCommand. More...
 
 ~AlignmentTextsGroupCommand () override
 AlignmentTextsGroupCommand::~AlignmentTextsGroupCommand Destructor. More...
 
int id () const override
 
bool mergeWith (const QUndoCommand *other) override
 AlignmentTextsGroupCommand::mergeWith Try to merge this command with other command. More...
 
void undo () override
 AlignmentTextsGroupCommand::undo. More...
 
void redo () override
 AlignmentTextsGroupCommand::redo. More...
 

Private Attributes

QPointer< ElementTextItemGroupm_group
 
Qt::Alignment m_previous_alignment
 
Qt::Alignment m_new_alignment
 
QHash< DynamicElementTextItem *, QPointF > m_texts_pos
 

Detailed Description

Definition at line 120 of file addelementtextcommand.h.

Constructor & Destructor Documentation

◆ AlignmentTextsGroupCommand()

AlignmentTextsGroupCommand::AlignmentTextsGroupCommand ( ElementTextItemGroup group,
Qt::Alignment  new_alignment,
QUndoCommand *  parent = nullptr 
)

AlignmentTextsGroupCommand::AlignmentTextsGroupCommand.

Parameters
group: Group to change the alignment
new_alignment: the new alignment of the group
parent: the parent QUndoCommand of this undo

Definition at line 316 of file addelementtextcommand.cpp.

References m_previous_alignment, m_texts_pos, ElementTextItemGroup::texts(), and QET::Icons::tr.

◆ ~AlignmentTextsGroupCommand()

AlignmentTextsGroupCommand::~AlignmentTextsGroupCommand ( )
override

Member Function Documentation

◆ id()

int AlignmentTextsGroupCommand::id ( ) const
inlineoverride

Definition at line 126 of file addelementtextcommand.h.

◆ mergeWith()

bool AlignmentTextsGroupCommand::mergeWith ( const QUndoCommand *  other)
override

AlignmentTextsGroupCommand::mergeWith Try to merge this command with other command.

Parameters
other
Returns
true if was merged, else false

Definition at line 347 of file addelementtextcommand.cpp.

References m_group, m_new_alignment, and undo().

◆ redo()

void AlignmentTextsGroupCommand::redo ( )
override

◆ undo()

void AlignmentTextsGroupCommand::undo ( )
override

Member Data Documentation

◆ m_group

QPointer<ElementTextItemGroup> AlignmentTextsGroupCommand::m_group
private

Definition at line 132 of file addelementtextcommand.h.

Referenced by mergeWith(), redo(), and undo().

◆ m_new_alignment

Qt::Alignment AlignmentTextsGroupCommand::m_new_alignment
private

Definition at line 133 of file addelementtextcommand.h.

Referenced by mergeWith(), and redo().

◆ m_previous_alignment

Qt::Alignment AlignmentTextsGroupCommand::m_previous_alignment
private

Definition at line 133 of file addelementtextcommand.h.

Referenced by AlignmentTextsGroupCommand(), and undo().

◆ m_texts_pos

QHash<DynamicElementTextItem *, QPointF> AlignmentTextsGroupCommand::m_texts_pos
private

Definition at line 135 of file addelementtextcommand.h.

Referenced by AlignmentTextsGroupCommand(), and undo().


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