Aqt.Cassowary
|
Represents a variable whose value will be determined by a constraint solver. More...
#include <aqt/cassowary/Variable.hpp>
Public Member Functions | |
Variable (QQuickItem *pParent=nullptr) | |
double | value () const |
void | setValue (double) |
Q_SIGNAL void | valueChanged (double value) |
Q_SIGNAL void | initialChanged (double initial) |
const rhea::variable & | variableImpl () const |
![]() | |
Contextual (QQuickItem *pParent=nullptr) | |
std::shared_ptr< Context > | context () |
std::shared_ptr< const Context > | context () const |
Q_SIGNAL void | contextChanged () |
Q_SIGNAL void | extendChanged (aqt::cassowary::Contextual *extend) |
Q_INVOKABLE void | commit () |
Applies all the changes associated to the context used by this contextual. More... | |
Q_INVOKABLE void | defer (QJSValue cb) |
Executes the callback cb at the end of the next phase of updates in the solver, but before the changes are propagated to the bindings. | |
void | defer (Context::Callback cb) |
void | defer_ (Context::Callback cb) |
template<typename... Args> | |
void | log (Args &&...args) |
Used to log a debug trace, that may be visible when the current context's debug property is set. More... | |
Protected Member Functions | |
void | addIn (Context &) override |
void | removeIn (Context &) override |
![]() | |
void | add () |
void | remove () |
template<typename Fn > | |
void | update (Fn &&cb) |
template<typename Fn > | |
Context::Callback | guarded (Fn fn) |
void | updateContext () |
Contextual * | provider () |
virtual std::shared_ptr< Context > | provided () |
Properties | |
double | value |
Contains the current value as determined by the constrained solver. More... | |
double | initial |
Sets the initial value of this variable. More... | |
![]() | |
aqt::cassowary::Contextual | extend |
If non-null, this contextual will use the same context as used by this contextual. | |
Represents a variable whose value will be determined by a constraint solver.
import Aqt.Cassowary 1.0
double aqt::cassowary::Variable::initial |
Sets the initial value of this variable.
If NaN
is set, the variable will have an implicit initial value of 0. However, explicitly set initial values will are considered strong, but not the implicit ones even if the later variable has supporting stay constraints.
value
property setter, it would be nice to be able to specify the strength and weight of this suggestion to the solver.
|
readwrite |
Contains the current value as determined by the constrained solver.
The value will be updated automatically after the next solver update, in the presence of changes in the constraints of the system.