[Interest] Slider value question
Gabriel.deDietrich at digia.com
Fri Dec 6 12:56:52 CET 2013
On Dec 6, 2013, at 11:58 AM, Damian Ivanov <damianatorrpm at gmail.com<mailto:damianatorrpm at gmail.com>> wrote:
I have a question regarding the Slider element form Controls:
should myValue by updated when I slide the slider? Because my value
does not. I need to add
onValueChanged: mySettings.myValue = (value)
which results in a binding loop. What is the proper way to do it?
Yes, this is normal. Bindings only work in one direction.
What you want to do is,
mySlider.value = mySettings.myValue
where ‘mySlider’ is the slider above. You should do this when both the slider and your settings object are complete.
To update the settings, you can do it continuously with, e.g., a binding object,
or only once, when you want to save your settings. For instance,
onSaveSettingsNow: mySettings.myValue = mySlider.value
where ‘saveSettingsNow’ is some signal you emit at the right moment.
Dr. Gabriel de Dietrich
Senior Software Developer
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest