[Interest] QML property binding chains?

Jeremy jswigart at gmail.com
Fri May 4 18:47:42 CEST 2012

Is there a way to configure a sort of cascading property evaluation/binding

For example, think about an RPG character, where one of his stats might be
made up of an accumulation of an arbitrary number of values from other
properties, even in other objects. For example, the characters 'defense'
stat, might be made up of a base defense stat, calculated by the abilities
of the character, and then modified by any number of items he has equipped.
Is there a way to utilize the property binding of QML to help maintain
accurate calculations of these stats between dependencies, as items are
equipped, spells temporarily buff stats, etc

>From the data here http://doc.qt.nokia.com/4.7-snapshot/propertybinding.html,
it looks like one option could be to bind these stats to functions that may
calculate them arbitrarily, but it doesn't seem to go into much detail
about how the binding works in a situation where you bind a property to a
function. Under what conditions will the property bound function be
automatically re-evaluated ? What if the function loops over other
components or child components to accumulate information? Seems unlikely
that a property binding would occur then, and even if it did, what happens
when the values change?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120504/6e097bb5/attachment.html>

More information about the Interest mailing list