Aqt.Cassowary
|
A linear constraint. More...
#include <aqt/cassowary/Constraint.hpp>
Public Member Functions | |
Constraint (QQuickItem *pParent=nullptr) | |
Q_SIGNAL void | exprChanged (QVariant expr) |
Q_INVOKABLE QVariant | plus (QVariant, QVariant) |
Returns an arithmetic expression representing the sum of its arguments, or undefined if any of its arguments is undefined . More... | |
Q_INVOKABLE QVariant | plus (QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | plus (QVariant, QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | plus (QVariant, QVariant, QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | plus (QVariant, QVariant, QVariant, QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | minus (QVariant, QVariant) |
Returns an arithmetic expression representing the substraction of its arguments, or undefined if any of its arguments is undefined . More... | |
Q_INVOKABLE QVariant | minus (QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | minus (QVariant, QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | minus (QVariant, QVariant, QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | minus (QVariant, QVariant, QVariant, QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | times (QVariant, QVariant) |
Returns an arithmetic expression representing the product of its arguments, or undefined if any of its arguments is undefined . More... | |
Q_INVOKABLE QVariant | times (QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | times (QVariant, QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | times (QVariant, QVariant, QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | times (QVariant, QVariant, QVariant, QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | divide (QVariant, QVariant) |
Returns an arithmetic expression representing the division of its arguments, or undefined if any of its arguments is undefined . More... | |
Q_INVOKABLE QVariant | divide (QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | divide (QVariant, QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | divide (QVariant, QVariant, QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | divide (QVariant, QVariant, QVariant, QVariant, QVariant, QVariant) |
Q_INVOKABLE QVariant | eq (QVariant a, QVariant b) |
Returns a comparison expression stating the equality of its arguments, or undefined if any of its arguments is undefined . More... | |
Q_INVOKABLE QVariant | geq (QVariant a, QVariant b) |
Returns a comparison expression stating that its first argument should be less than the later, or undefined if any of its arguments is undefined . More... | |
Q_INVOKABLE QVariant | leq (QVariant a, QVariant b) |
Returns a comparison expression stating that its first argument should be greater than the later, or undefined if any of its arguments is undefined . More... | |
![]() | |
ConstraintBase (QQuickItem *pParent=nullptr, Strength::Types strength=Strength::Required, double weight=1.0) | |
Q_SIGNAL void | strengthChanged (aqt::cassowary::Strength::Types strength) |
Q_SIGNAL void | weightChanged (double weight) |
Q_SIGNAL void | whenChanged (bool when) |
![]() | |
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... | |
Properties | |
QVariant | expr |
Expression that determines the linear constraint. More... | |
![]() | |
aqt::cassowary::Strength::Types | strength |
Sets the strength of a constraint. More... | |
double | weight |
Sets the weight of a constraint. More... | |
bool | when |
The constraint is enabled when this property holds a true value, otherwise it has no effect. | |
![]() | |
aqt::cassowary::Contextual | extend |
If non-null, this contextual will use the same context as used by this contextual. | |
Additional Inherited Members | |
![]() | |
bool | when () const |
const rhea::constraint & | get () const |
void | set (std::shared_ptr< rhea::abstract_constraint > constraint) |
void | addIn (Context &ctx) override |
void | removeIn (Context &ctx) 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 () |
A linear constraint.
A linear constraint allows us to set equations or inequalities that relate variables in the system. The solver will log errors in the presence of non-linear constraints or conflicting constraints with Required
strength.
import Aqt.Cassowary 1.0
Q_INVOKABLE QVariant aqt::cassowary::Constraint::divide | ( | QVariant | , |
QVariant | |||
) |
Returns an arithmetic expression representing the division of its arguments, or undefined
if any of its arguments is undefined
.
Its arguments may be arithmetic expressions, Variable
objects or numbers.
Q_INVOKABLE QVariant aqt::cassowary::Constraint::eq | ( | QVariant | a, |
QVariant | b | ||
) |
Returns a comparison expression stating the equality of its arguments, or undefined
if any of its arguments is undefined
.
Its arguments may be arithmetic expressions, Variable
objects or numbers.
Q_INVOKABLE QVariant aqt::cassowary::Constraint::geq | ( | QVariant | a, |
QVariant | b | ||
) |
Returns a comparison expression stating that its first argument should be less than the later, or undefined
if any of its arguments is undefined
.
Its arguments may be arithmetic expressions, Variable
objects or numbers.
Q_INVOKABLE QVariant aqt::cassowary::Constraint::leq | ( | QVariant | a, |
QVariant | b | ||
) |
Returns a comparison expression stating that its first argument should be greater than the later, or undefined
if any of its arguments is undefined
.
Its arguments may be arithmetic expressions, Variable
objects or numbers.
Q_INVOKABLE QVariant aqt::cassowary::Constraint::minus | ( | QVariant | , |
QVariant | |||
) |
Returns an arithmetic expression representing the substraction of its arguments, or undefined
if any of its arguments is undefined
.
Its arguments may be arithmetic expressions, Variable
objects or numbers.
Q_INVOKABLE QVariant aqt::cassowary::Constraint::plus | ( | QVariant | , |
QVariant | |||
) |
Returns an arithmetic expression representing the sum of its arguments, or undefined
if any of its arguments is undefined
.
Its arguments may be arithmetic expressions, Variable
objects or numbers.
Q_INVOKABLE QVariant aqt::cassowary::Constraint::times | ( | QVariant | , |
QVariant | |||
) |
Returns an arithmetic expression representing the product of its arguments, or undefined
if any of its arguments is undefined
.
Its arguments may be arithmetic expressions, Variable
objects or numbers.
QVariant aqt::cassowary::Constraint::expr |
Expression that determines the linear constraint.
It can hold a comparison expression or undefined
. If undefined
, the constraint will have no effect.