eliminate binding loop which could lead to not updating spinbox UI

This commit is contained in:
Alexander Ivash 2018-07-07 02:26:51 +03:00
parent 168584169c
commit 4716be01f6

View file

@ -58,10 +58,14 @@ SpinBox {
onValueModified: realValue = value/factor
onValueChanged: realValue = value/factor
onRealValueChanged: {
var newValue = Math.round(realValue*factor);
if(value != newValue) {
value = newValue;
}
}
stepSize: realStepSize*factor
value: Math.round(realValue*factor)
to : realTo*factor
from : realFrom*factor