QML value-type wrapper around PhosphorAnimation::Profile.
More...
#include <phosphor-animation/include/PhosphorAnimation/PhosphorProfile.h>
Public Types | |
| enum class | SequenceMode : int { AllAtOnce = int(PhosphorAnimation::SequenceMode::AllAtOnce) , Cascade = int(PhosphorAnimation::SequenceMode::Cascade) } |
Public Member Functions | |
| PhosphorProfile ()=default | |
| PhosphorProfile (const Profile &value) | |
| Implicit-conversion ctor from core-library value. | |
| const Profile & | value () const |
| Read-only access to the underlying value. | |
| PhosphorCurve | curve () const |
| void | setCurve (const PhosphorCurve &c) |
| qreal | duration () const |
| void | setDuration (qreal ms) |
| int | minDistance () const |
| void | setMinDistance (int px) |
| SequenceMode | sequenceMode () const |
| void | setSequenceMode (SequenceMode mode) |
| int | staggerInterval () const |
| void | setStaggerInterval (int ms) |
| QString | presetName () const |
| void | setPresetName (const QString &name) |
| QJsonObject | toJson () const |
Serialize to a JSON object via Profile::toJson. | |
| bool | operator== (const PhosphorProfile &other) const |
| bool | operator!= (const PhosphorProfile &other) const |
Static Public Member Functions | |
| static PhosphorProfile | fromJson (const QJsonObject &obj) |
| Parse from a JSON object. | |
QML value-type wrapper around PhosphorAnimation::Profile.
Q_GADGET per Phase 4 decision O — compile-time snapshot shape for PhosphorMotionAnimation.profile: PhosphorProfile { … } (decision R's value-binding branch). The path-string branch goes through PhosphorProfileRegistry and lands in a later sub-commit.
Profile's fields are std::optional<T> so ProfileTree inheritance can distinguish "unset, inherit" from "explicitly set to library
default" (see Profile.h's class doc). QML cannot represent std::optional<T> directly, so the wrapper collapses the distinction at the QML boundary:
Profile:: effective*). Unset fields read back as their library default.Profile::*.reset() from C++ if needed).This matches how plugin authors typically use PhosphorProfile: construct a compile-time literal with every field they care about, hand it to PhosphorMotionAnimation.profile, and treat it as immutable. ProfileTree inheritance is a C++-side concern accessed through the core ProfileTree API, not through this wrapper.
|
default |
Implicit-conversion ctor from core-library value.
|
inline |
|
inline |
|
inlinestatic |
Parse from a JSON object.
Missing keys become unset fields (read back as library defaults via effective*).
Uses the process-wide CurveRegistry installed via PhosphorCurve::setDefaultRegistry when available so user-authored curves registered by CurveLoader are visible to this parse path. Falls back to a function-local static registry (built-ins only) when no default registry has been installed — this covers startup-before-composition-root and test harness paths where the daemon hasn't published a user-curve-aware registry yet. Consulting the published registry first matches the convention used by PhosphorCurve::fromString.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Serialize to a JSON object via Profile::toJson.
Only engaged fields are written, matching the inheritance-preserving JSON shape the C++ side produces.
Read-only access to the underlying value.
The non-const overload was deliberately removed: a mutable handle from QML let scripts bypass the setter clamps below by writing directly into the engaged-optional fields. Core-library mutators construct a fresh Profile and assign through the implicit-conversion ctor instead.