[Development] QProperty and when evaluation occurs
Thiago Macieira
thiago.macieira at intel.com
Fri Jul 24 16:45:28 CEST 2020
On Friday, 24 July 2020 04:16:31 PDT Stottlemyer, Brett (B.S.) wrote:
> This is new. Are you positing that this evaluation mode should exist? Or
> is it already how the implementation works?
It should exist, if it doesn't yet.
> What determines whether a slot supports lazy evaluation or not?
Sorry, rephrasing: "if a property that doesn't support lazy evaluation is
connected to a slot"
Filippo wrote:
> That said if something like that exists it means that given a chain of
> QProperties it need just one "immediate" observers to break all the
> "benefits" of lazy evaluation(given that it causes all the chain to
> recompute).
Indeed. But there are still benefits, since the evaluation can conclude that
the property actually did not change and not need to propagate the change
further.
If p1 depends on p2 and p3, and p5 depends on p1 and p4:
p1 = f1(p2, p3, own state)
p5 = f2(p1, p4, own state)
Any of p1, p2, p3 or p4 changing implies that p5 must be reevaluated and its
notification routines be called. But if the change happend in p2 and as a
result p1 did not change, there's no need to propagate anything. Similarly, a
change in p1 can mean p5 still did not change, so no notification is needed.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel DPG Cloud Engineering
More information about the Development
mailing list