<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
Hi Damian,
<div><br>
</div>
<div>
<div>On Dec 6, 2013, at 11:58 AM, Damian Ivanov <<a href="mailto:damianatorrpm@gmail.com">damianatorrpm@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">I have a question regarding the Slider element form Controls:<br>
                   Slider {<br>
                       minimumValue: 30<br>
                       maximumValue: 100<br>
                       stepSize: 1<br>
                       value: mySettings.myValue<br>
                   }<br>
should myValue by updated when I slide the slider? Because my value<br>
does not. I need to add<br>
                       onValueChanged: mySettings.myValue = (value)<br>
which results in a binding loop. What is the proper way to do it?<br>
</blockquote>
<div><br>
</div>
<div>Yes, this is normal. Bindings only work in one direction.</div>
<div><br>
</div>
<div>What you want to do is,</div>
<div><br>
</div>
</div>
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div>
<div>mySlider.value = mySettings.myValue</div>
</div>
</blockquote>
<div>
<div><br>
</div>
<div>where ‘mySlider’ is the slider above. You should do this when both the slider and your settings object are complete.</div>
<div><br>
</div>
<div>To update the settings, you can do it continuously with, e.g., a binding object,</div>
<div><br>
</div>
</div>
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div>
<div>Binding {</div>
</div>
<div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>target: mySettings</div>
</div>
<div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>property: “myValue”</div>
</div>
<div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>value: mySlider.value</div>
</div>
<div>
<div>}</div>
</div>
</blockquote>
<div>
<div><br>
</div>
<div>or only once, when you want to save your settings. For instance,</div>
<div><br>
</div>
</div>
<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">
<div>
<div>onSaveSettingsNow: mySettings.myValue = mySlider.value</div>
</div>
</blockquote>
<div><br>
</div>
<div>where ‘saveSettingsNow’ is some signal you emit at the right moment.</div>
<div><br>
<div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
Best regards,<br>
<br>
Dr. Gabriel de Dietrich<br>
Senior Software Developer<br>
<a href="http://qt.digia.com">qt.digia.com</a><br>
<br>
</div>
</div>
</div>
</body>
</html>