KDStateMachineEditor API Documentation 2.3
Loading...
Searching...
No Matches
KDSME::ModifyElementCommand Class Reference

Command for modifying properties of KDSME::Element. More...

#include <modifyelementcommand_p.h>

Inheritance diagram for KDSME::ModifyElementCommand:
Collaboration diagram for KDSME::ModifyElementCommand:

Public Member Functions

 ModifyElementCommand (Element *item, QUndoCommand *parent=nullptr)
int id () const override
Element * item () const
bool mergeWith (const QUndoCommand *other) override
Q_INVOKABLE void moveBy (qreal dx, qreal dy)
void redo () override
Q_INVOKABLE void setGeometry (const QRectF &geometry)
void undo () override
Public Member Functions inherited from KDSME::Command
 Command (const QString &text=QString(), QUndoCommand *parent=nullptr)
 Command (StateModel *model, QUndoCommand *parent=nullptr)
StateModel * model () const

Protected Types

enum  Operation { NoOperation , MoveOperation , SetGeometryOperation , UserOperation = 100 }

Protected Attributes

int m_operation

Additional Inherited Members

Public Types inherited from KDSME::Command
enum  Id {
  CreateElement = 0 , DeleteElement , ReparentElement , LayoutSnapshot ,
  ModifyProperty , ModifyInitialState , ModifyDefaultState , ModifyElement ,
  ModifyTransition , ChangeStateMachine
}

Detailed Description

Command for modifying properties of KDSME::Element.

A command can only set one property at the time. On undo, the previous value of the property is restored.

Definition at line 35 of file modifyelementcommand_p.h.

Member Enumeration Documentation

◆ Operation

Enumerator
NoOperation 
MoveOperation 
SetGeometryOperation 
UserOperation 

Subclass takes care of executing this operation.

Definition at line 57 of file modifyelementcommand_p.h.

Constructor & Destructor Documentation

◆ ModifyElementCommand()

KDSME::ModifyElementCommand::ModifyElementCommand ( Element * item,
QUndoCommand * parent = nullptr )
explicit

Definition at line 35 of file modifyelementcommand.cpp.

References KDSME::Command::Command(), item(), m_operation, and NoOperation.

Referenced by mergeWith().

Member Function Documentation

◆ id()

int KDSME::ModifyElementCommand::id ( ) const
inlineoverride

Definition at line 44 of file modifyelementcommand_p.h.

References KDSME::Command::ModifyElement.

◆ item()

Element * KDSME::ModifyElementCommand::item ( ) const

Definition at line 43 of file modifyelementcommand.cpp.

Referenced by ModifyElementCommand().

◆ mergeWith()

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

Definition at line 97 of file modifyelementcommand.cpp.

References ModifyElementCommand(), and m_operation.

◆ moveBy()

void KDSME::ModifyElementCommand::moveBy ( qreal dx,
qreal dy )

Definition at line 48 of file modifyelementcommand.cpp.

References m_operation, and MoveOperation.

◆ redo()

void KDSME::ModifyElementCommand::redo ( )
override

Definition at line 62 of file modifyelementcommand.cpp.

References m_operation, MoveOperation, NoOperation, and SetGeometryOperation.

◆ setGeometry()

void ModifyElementCommand::setGeometry ( const QRectF & geometry)

Definition at line 55 of file modifyelementcommand.cpp.

References m_operation, and SetGeometryOperation.

◆ undo()

void KDSME::ModifyElementCommand::undo ( )
override

Definition at line 80 of file modifyelementcommand.cpp.

References m_operation, MoveOperation, NoOperation, and SetGeometryOperation.

Member Data Documentation

◆ m_operation

int KDSME::ModifyElementCommand::m_operation
protected

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

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDStateMachineEditor
Create Qt State Machine metacode using a graphical user interface
https://github.com/KDAB/KDStateMachineEditor
Generated on for KDStateMachineEditor API Documentation by doxygen 1.15.0