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

QML-accessible operator for undoable property changes on UUID-identifiable objects. More...

#include <src/actions/uuid_property_operator.h>

Inheritance diagram for zrythm::actions::UuidPropertyOperator:
Collaboration diagram for zrythm::actions::UuidPropertyOperator:

Public Member Functions

 UuidPropertyOperator (undo::UndoStack &undo_stack, utils::IObjectRegistry &registry, QObject *parent=nullptr)
Q_INVOKABLE void setValue (QObject *uuidObject, QString propertyName, QVariant value)
 Commits a property change on a UUID-identifiable QObject.
Q_INVOKABLE void setValueOnSubObject (QObject *uuidLifecycleObject, QObject *target, QString propertyName, QVariant value)
 Commits a property change on a sub-object of a UUID-identifiable object.

Detailed Description

QML-accessible operator for undoable property changes on UUID-identifiable objects.

Unlike QObjectPropertyOperator, this operator creates commands::ChangeUuidIdentifiableObjectPropertyCommand instances that hold a UUID reference keeping the target alive on the undo stack. This makes it safe for objects that can be deleted by other commands (e.g. automation points removed via undo of point creation).

The registry is injected at construction time (C++ side) and never exposed to QML.

Definition at line 27 of file uuid_property_operator.h.

Constructor & Destructor Documentation

◆ UuidPropertyOperator()

zrythm::actions::UuidPropertyOperator::UuidPropertyOperator ( undo::UndoStack & undo_stack,
utils::IObjectRegistry & registry,
QObject * parent = nullptr )
inlineexplicit

Definition at line 34 of file uuid_property_operator.h.

Member Function Documentation

◆ setValue()

Q_INVOKABLE void zrythm::actions::UuidPropertyOperator::setValue ( QObject * uuidObject,
QString propertyName,
QVariant value )

Commits a property change on a UUID-identifiable QObject.

The object is kept alive on the undo stack via UUID reference.

Parameters
uuidObjectThe UUID-identifiable QObject whose property to change.
propertyNameThe Q_PROPERTY name.
valueThe new value.

◆ setValueOnSubObject()

Q_INVOKABLE void zrythm::actions::UuidPropertyOperator::setValueOnSubObject ( QObject * uuidLifecycleObject,
QObject * target,
QString propertyName,
QVariant value )

Commits a property change on a sub-object of a UUID-identifiable object.

The UUID-identifiable parent is kept alive, which transitively keeps the target alive. Use this when the property lives on a child QObject (e.g. a CurveOptionsQmlAdapter inside an AutomationPoint).

Parameters
uuidLifecycleObjectThe UUID-identifiable parent whose lifetime guarantees target's lifetime.
targetThe QObject whose property is changed.
propertyNameThe Q_PROPERTY name.
valueThe new value.

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