Aqt.Cassowary
Public Member Functions | List of all members
aqt::cassowary::Stay Class Reference

An stay constraint indicates that the solver should try to preserve a variable's value. More...

#include <aqt/cassowary/Stay.hpp>

Inheritance diagram for aqt::cassowary::Stay:
aqt::cassowary::Targeted aqt::cassowary::ConstraintBase aqt::cassowary::Contextual

Public Member Functions

 Stay (QQuickItem *pParent=0)
 
- Public Member Functions inherited from aqt::cassowary::Targeted
 Targeted (QQuickItem *pParent=nullptr, Strength::Types strength=Strength::Required, double weight=1.0)
 
Q_SIGNAL void targetChanged (aqt::cassowary::Variable *target)
 
VariableactualTarget ()
 
Q_SIGNAL void actualTargetChanged (aqt::cassowary::Variable *target)
 
- Public Member Functions inherited from aqt::cassowary::ConstraintBase
 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)
 
- Public Member Functions inherited from aqt::cassowary::Contextual
 Contextual (QQuickItem *pParent=nullptr)
 
std::shared_ptr< Contextcontext ()
 
std::shared_ptr< const Contextcontext () 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...
 

Additional Inherited Members

- Protected Member Functions inherited from aqt::cassowary::ConstraintBase
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
 
- Protected Member Functions inherited from aqt::cassowary::Contextual
void add ()
 
void remove ()
 
template<typename Fn >
void update (Fn &&cb)
 
template<typename Fn >
Context::Callback guarded (Fn fn)
 
void updateContext ()
 
Contextualprovider ()
 
virtual std::shared_ptr< Contextprovided ()
 
- Properties inherited from aqt::cassowary::Targeted
aqt::cassowary::Variable target
 Explicitly set target variable. More...
 
aqt::cassowary::Variable actualTarget
 Returns the effective target. More...
 
- Properties inherited from aqt::cassowary::ConstraintBase
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.
 
- Properties inherited from aqt::cassowary::Contextual
aqt::cassowary::Contextual extend
 If non-null, this contextual will use the same context as used by this contextual.
 

Detailed Description

An stay constraint indicates that the solver should try to preserve a variable's value.

It is useful in an under-constrained system to prevent a variable from jumping between different valid solutions between resolutions. It is most often used in combination with Edit constraints, to prevent the variable from jumping when an edit gesture is finished.

See also
Edit for an example
Import in QML
import Aqt.Cassowary 1.0
Since
1.0

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