qt - Best way to trigger a script for any change in one of several properties -
qt - Best way to trigger a script for any change in one of several properties -
when bind property reevaluated if 1 of proprieties bounded changed. example:
property bool test: prcond1 || prcond2 || ... || prcondn when status changed test reevaluated.
now... want similar triggering javascript function: when 1 of several conditions prcond1 || prcond2 || ... || prcondn changed want function called.
if there 1 status write:
onprcond1changed: { functioncall() } but when take business relationship more 1 status best way it? there standard way?
basically need this:
functioncall() if 1 of these changes: prcond1 || prcond2 || ... || prcondn where prcond's may of different types.
a possible solution grouping variables variant list , changes on list.
property var myobject = {'prop': 'value'} property variant conditions = [prcond1, prcond2, myobj] onconditionschanged: { console.log("one of conditions have changed"); } note changes in properties of myobj not trigger changeevent, unless object changed (e.g. myobj = new object({'prop': 'newvalue'}) )
qt qml
Comments
Post a Comment