Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::commands::ChangeQObjectPropertyCommand Class Reference

Changes a QObject property with undo support. More...

#include <src/commands/change_qobject_property_command.h>

Inheritance diagram for zrythm::commands::ChangeQObjectPropertyCommand:
Collaboration diagram for zrythm::commands::ChangeQObjectPropertyCommand:

Public Member Functions

 ChangeQObjectPropertyCommand (QObject &object, QString property_name, QVariant value)
int id () const override
bool mergeWith (const QUndoCommand *other) override
void undo () override
void redo () override

Detailed Description

Changes a QObject property with undo support.

Warning
This command stores a raw reference (object_) to the QObject. The caller MUST ensure the QObject outlives this command on the undo stack. If the object may be destroyed by other commands (e.g., it is owned by a model that can remove/replace it), use a state-based command that captures the data by value instead — otherwise undo will dereference a dangling reference (use-after-free).

Definition at line 25 of file change_qobject_property_command.h.

Constructor & Destructor Documentation

◆ ChangeQObjectPropertyCommand()

zrythm::commands::ChangeQObjectPropertyCommand::ChangeQObjectPropertyCommand ( QObject & object,
QString property_name,
QVariant value )
inline

Definition at line 28 of file change_qobject_property_command.h.

Member Function Documentation

◆ id()

int zrythm::commands::ChangeQObjectPropertyCommand::id ( ) const
inlineoverride

Definition at line 39 of file change_qobject_property_command.h.

◆ mergeWith()

bool zrythm::commands::ChangeQObjectPropertyCommand::mergeWith ( const QUndoCommand * other)
inlineoverride

Definition at line 40 of file change_qobject_property_command.h.

◆ redo()

void zrythm::commands::ChangeQObjectPropertyCommand::redo ( )
inlineoverride

Definition at line 74 of file change_qobject_property_command.h.

◆ undo()

void zrythm::commands::ChangeQObjectPropertyCommand::undo ( )
inlineoverride

Definition at line 69 of file change_qobject_property_command.h.


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