Aqt.Cassowary
|
Provides a context to register and resolve constraints. More...
#include <aqt/cassowary/Solver.hpp>
Public Member Functions | |
Solver (QQuickItem *pParent=nullptr) | |
Q_SIGNAL void | debugChanged (bool debug) |
![]() | |
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 | updatePolish () override |
void | componentComplete () override |
std::shared_ptr< Context > | provided () override |
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 () |
Properties | |
bool | debug |
Toggles debug traces for the context provided by this solver. More... | |
![]() | |
aqt::cassowary::Contextual | extend |
If non-null, this contextual will use the same context as used by this contextual. | |
Provides a context to register and resolve constraints.
It may as well simply extend another context, following the normal rules of Contextuals
.
Note that the solver does not resolve the equations until the next redraw of the screen. This prevents intermediate values to confuse the solver during binding propagations, as well as improves performance as only the minimal set of updates to visualize new layouts is performed. If needed (e.g. in tests) one may manually update the system with the commit()
method.
import Aqt.Cassowary 1.0
bool aqt::cassowary::Solver::debug |
Toggles debug traces for the context provided by this solver.
This has no effect if the solver is simply extending another context. Also: