[Development] QProperty and when evaluation occurs
edward.welbourne at qt.io
Fri Jul 24 14:03:29 CEST 2020
On 7/23/20, 3:13 PM, "Volker Hilsheimer" <volker.hilsheimer at qt.io> wrote:
>> But why would we calculate the volume if nobody cares about the volume? :)
Stottlemyer, Brett (24 July 2020 13:45) replied:
> Qt Remote Objects. I've got a headless service on one device, and a
> remote UI for interacting with it. When signals are emitted (property
> change or otherwise) by the service, the results are forwarded to the
> remote UI.
> Lazy evaluation probably works fine if the bindings are on the UI
> side, but things break down if they are on the service side. That was
> why I was trying to distinguish between derived properties _on a
> QObject_ vs bindings in a QML UI.
When the property's changes do need to be notified, at the expense of
laziness, QNotifiedProperty is available as an alternative to QProperty.
See qtbase/dev's src/corelib/kernel/qproperty.h and friends for details
(but still desperately short on much-needed documentation),
More information about the Development