Ubuntu Pastebin

Paste from tsd at Fri, 18 Dec 2015 13:13:31 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
    function setFieldValue(field, hasValue, value) {
        if (hasValue) {
            // Need this othewise if we are on 4.5 and backspace instead of
            // having 4. in the text field we end up with 4 which is confusing
            if (field.text != value) {
                field.text = value;
            }
        } else {
            field.text = "";
        }
    }



        onStartValueChanged: root.setFieldValue(field1, widgetData.hasStartValue, widgetData.startValue);
        onHasStartValueChanged: root.setFieldValue(field1, widgetData.hasStartValue, widgetData.startValue);
        onEndValueChanged: root.setFieldValue(field2, widgetData.hasEndValue, widgetData.endValue);
        onHasEndValueChanged: root.setFieldValue(field2, widgetData.hasEndValue, widgetData.endValue);
Download as text