Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
Description
Customer request
Suppose I have a component that provides a layout based on 3 properties. (e.g. a size, a color and a font size).
Suppose that these values are provided by a backend (or a config file) that is read or received into a settings component that updates global size, color and font properties which get picked up by this component using bindings.
Now, when you get new values, passing the values (e.g from a WebSocket message) to the global properties, you trigger 3 updates. Moreover, that component might have property values that are invalid because all the received property values might interact. This could result in warning messages for undefined/invalid values, or your GUI might flicker due to unnecessary intermediate updates.
Hence, a method to hold the binding trigger until the last value is updated might eliminate all of the above issues. Something like:
Qt.delayBinding(true) p1 = v1 // sets property value, flags for dirty and queues the propagation p2 = v2 // sets property value, flags for dirty and queues the propagation // ... Qt.delayBinding(false) // triggers the propagation
Alternative suggestion
If delayed propagation of specific bindings is not feasible, then perhaps there could be an equivalent of QObject::blockSignals(), paired with a function to force re-evaluation of all bindings?