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

Modifies any specific property of a QObject. More...

#include <modifypropertycommand_p.h>

Inheritance diagram for KDSME::ModifyPropertyCommand:
Collaboration diagram for KDSME::ModifyPropertyCommand:

Public Member Functions

 ModifyPropertyCommand (QObject *object, const char *property, const QVariant &value, const QString &text=QString(), QUndoCommand *parent=nullptr)
 ModifyPropertyCommand (QObject *object, const QJsonObject &propertyMap, const QString &text=QString(), QUndoCommand *parent=nullptr)
int id () const override
void redo () override
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

Additional Inherited Members

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

Detailed Description

Modifies any specific property of a QObject.

Properties can also be referenced by their name (read: a simple string), so we can have a generic command that is capable of setting individual properties of an object. This is sometimes useful in order to not have to create commands for each and every property modification.

Definition at line 40 of file modifypropertycommand_p.h.

Constructor & Destructor Documentation

◆ ModifyPropertyCommand() [1/2]

ModifyPropertyCommand::ModifyPropertyCommand ( QObject * object,
const char * property,
const QVariant & value,
const QString & text = QString(),
QUndoCommand * parent = nullptr )

Definition at line 24 of file modifypropertycommand.cpp.

References KDSME::Command::Command().

◆ ModifyPropertyCommand() [2/2]

ModifyPropertyCommand::ModifyPropertyCommand ( QObject * object,
const QJsonObject & propertyMap,
const QString & text = QString(),
QUndoCommand * parent = nullptr )

Definition at line 33 of file modifypropertycommand.cpp.

References KDSME::Command::Command().

Member Function Documentation

◆ id()

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

Definition at line 48 of file modifypropertycommand_p.h.

References KDSME::Command::ModifyProperty.

◆ redo()

void ModifyPropertyCommand::redo ( )
override

Definition at line 59 of file modifypropertycommand.cpp.

◆ undo()

void ModifyPropertyCommand::undo ( )
override

Definition at line 76 of file modifypropertycommand.cpp.


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