[Interest] Slider value question
Damian Ivanov
damianatorrpm at gmail.com
Fri Dec 6 13:03:31 CET 2013
Hi Gabriel,
Thanks! Worked perfectly :)
2013/12/6 deDietrich Gabriel <Gabriel.deDietrich at digia.com>:
> Hi Damian,
>
> On Dec 6, 2013, at 11:58 AM, Damian Ivanov <damianatorrpm at gmail.com> wrote:
>
> I have a question regarding the Slider element form Controls:
> Slider {
> minimumValue: 30
> maximumValue: 100
> stepSize: 1
> value: mySettings.myValue
> }
> 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,
>
> Binding {
> target: mySettings
> property: “myValue”
> value: mySlider.value
> }
>
>
> 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.
>
> Best regards,
>
> Dr. Gabriel de Dietrich
> Senior Software Developer
> qt.digia.com
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
More information about the Interest
mailing list