KDStateMachineEditor API Documentation 2.1
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Attributes | List of all members
KDSME::ModifyElementCommand Class Reference

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

#include <modifyelementcommand_p.h>

Inheritance diagram for KDSME::ModifyElementCommand:
Inheritance graph
[legend]
Collaboration diagram for KDSME::ModifyElementCommand:
Collaboration graph
[legend]

Public Member Functions

 ModifyElementCommand (Element *item, QUndoCommand *parent=nullptr)
 
int id () const override
 
Elementitem () 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)
 
StateModelmodel () 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 item().

Member Function Documentation

◆ id()

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

Definition at line 44 of file modifyelementcommand_p.h.

◆ 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 m_operation.

◆ moveBy()

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

Definition at line 48 of file modifyelementcommand.cpp.

◆ redo()

void KDSME::ModifyElementCommand::redo ( )
override

Definition at line 62 of file modifyelementcommand.cpp.

◆ 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.

Member Data Documentation

◆ m_operation

int KDSME::ModifyElementCommand::m_operation
protected

Definition at line 66 of file modifyelementcommand_p.h.

Referenced by mergeWith(), and setGeometry().


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 Tue Jul 15 2025 15:21:47 for KDStateMachineEditor API Documentation by doxygen 1.9.8