Bindings bug or feature

I found a situation, where bindings works not as I expected. If I bind variable someVar to some other variable(s) and also add handler onSomeVarChanged, the handler executes before bindings. Thus, using any non-trivial code in handler onSomeVarChanged is potentially dangerious. You can use some component, that has variable binded to someVar and this variable is not updated yet. See example below:

One important feature of a declarative language is that you don't know in which order the declarations will be applied in, or the order the side-effects (signal handlers, binding expressions) will be evaluated in. In practice, there is an order defined by the engine implementation, but it is best not to rely on that, as it is an implementation detail rather than a well-specified behaviour (ie, API contract).

To ensure that an imperative expression is evaluated after a binding evaluation occurs, you can trigger the imperative function via a Timer started as a side-effect of the binding expression.

In the preceding case, the updateViews() function is guaranteed to be called after ALL binding expressions involving someProperty have been re-evaluated, since the Timer's onTriggered handler will be invoked at some point in the future via the Qt Event Loop.