Aqt.Cassowary
|
Base class for items that need to be registered in a solver. More...
#include <aqt/cassowary/Contextual.hpp>
Public Member Functions | |
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 | 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 () |
virtual void | addIn (Context &impl)=0 |
virtual void | removeIn (Context &impl)=0 |
Properties | |
aqt::cassowary::Contextual | extend |
If non-null, this contextual will use the same context as used by this contextual. | |
Base class for items that need to be registered in a solver.
Most Aqt.Cassowary entities need to be registered in a solver to be effective. This solver is sometimes referred to as the context. The context in which an item will be determined:
extend
property is set, it will use the context of the entity it refers to.The second rule allows to conveniently define constraints directly in a context, and the previous allows for composition.
import Aqt.Cassowary 1.0
Q_INVOKABLE void aqt::cassowary::Contextual::commit | ( | ) |
Applies all the changes associated to the context used by this contextual.
|
inline |
Used to log a debug trace, that may be visible when the current context's debug property is set.
Spaces will be printed between the arguments. Arguments should be compatible with std::ostream
.