QML value-type wrapper around PhosphorAnimation::Spring.
More...
#include <PhosphorAnimation/PhosphorSpring.h>
QML value-type wrapper around PhosphorAnimation::Spring.
Q_GADGET per Phase 4 decision O — value semantics. Usable as a property shape inside PhosphorProfile { curve: PhosphorSpring { omega: 14; zeta: 0.6 } }.
Parameter bounds (omega ∈ [0.1, 200], zeta ∈ [0.0, 10.0]) are enforced inside the C++ Spring constructor; writes through these setters clamp identically. Preset factories (snappy / smooth / bouncy) are re-exposed as Q_INVOKABLE static helpers so QML authors can reference the same named tunings C++ consumers use.
◆ PhosphorSpring() [1/3]
| PhosphorAnimation::PhosphorSpring::PhosphorSpring |
( |
| ) |
|
|
default |
◆ PhosphorSpring() [2/3]
| PhosphorAnimation::PhosphorSpring::PhosphorSpring |
( |
const Spring & | value | ) |
|
|
inlineexplicit |
Implicit-conversion ctor for core-library code.
◆ PhosphorSpring() [3/3]
| PhosphorAnimation::PhosphorSpring::PhosphorSpring |
( |
qreal | omega, |
|
|
qreal | zeta ) |
|
inline |
◆ bouncy()
Visible bounce. Good for attention-grabbing feedback.
◆ fromString()
| PhosphorSpring PhosphorAnimation::PhosphorSpring::fromString |
( |
const QString & | str | ) |
|
|
inlinestatic |
◆ omega()
| qreal PhosphorAnimation::PhosphorSpring::omega |
( |
| ) |
const |
|
inline |
◆ operator!=()
| bool PhosphorAnimation::PhosphorSpring::operator!= |
( |
const PhosphorSpring & | other | ) |
const |
|
inline |
◆ operator==()
| bool PhosphorAnimation::PhosphorSpring::operator== |
( |
const PhosphorSpring & | other | ) |
const |
|
inline |
◆ setOmega()
| void PhosphorAnimation::PhosphorSpring::setOmega |
( |
qreal | v | ) |
|
|
inline |
◆ setZeta()
| void PhosphorAnimation::PhosphorSpring::setZeta |
( |
qreal | v | ) |
|
|
inline |
◆ smooth()
Critically damped. No overshoot, firm approach.
◆ snappy()
Responsive, slight overshoot. Good default for window snap.
◆ toString()
| QString PhosphorAnimation::PhosphorSpring::toString |
( |
| ) |
const |
|
inline |
◆ value()
| const Spring & PhosphorAnimation::PhosphorSpring::value |
( |
| ) |
const |
|
inline |
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 in setOmega / setZeta by writing directly into the underlying Spring fields. Core-library mutators construct a fresh Spring and assign.
◆ zeta()
| qreal PhosphorAnimation::PhosphorSpring::zeta |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: