29
29
property int decimals: 0
30
30
31
31
onValueChanged: {
32
- console .log (" root val" , value)
33
32
if (! spinBox .__modifying )
34
33
{
35
34
spinBox .value = decimalToInt (root .value )
41
40
readonly property int kMaxInt: Math .pow (2 , 31 ) - 1
42
41
43
42
function decimalToInt (decimal ) {
44
- // console.log("dec:", decimal)
45
43
var result = decimal * spinBox .decimalFactor
46
44
if (result >= kMaxInt) {
47
45
return kMaxInt
53
51
}
54
52
55
53
function intToDecimal (intVal ) {
56
- // console.log("int:", intVal)
57
54
return intVal / spinBox .decimalFactor
58
55
}
59
56
92
89
// cannot be modified from outside of this SpinBox element.
93
90
property real __valueAsDecimal: 0.0
94
91
onValueChanged: {
95
- console .log (" spinbox val ch:" , value)
96
92
__valueAsDecimal = intToDecimal (value)
97
93
}
98
94
// Note that this is a different event than ValueChanged. The
@@ -105,13 +101,9 @@ Item {
105
101
// emitting the editingFinished signal so users GzSpinBox can be
106
102
// notified and take the new value of the spinbox, and finally
107
103
// disabling valueUpdater to restore the original bindings.
108
- console .log (" valUp before when=true" , value)
109
104
valueUpdater .when = true
110
- console .log (" valUp after when=true" , value)
111
105
root .editingFinished ()
112
- console .log (" valUp before when=false" , value)
113
106
valueUpdater .when = false
114
- console .log (" valUp after when=false" , value)
115
107
__modifying = false
116
108
}
117
109
@@ -124,9 +116,7 @@ Item {
124
116
125
117
readonly property real decimalFactor: Math .pow (10 , root .decimals )
126
118
onDecimalFactorChanged: {
127
- console .log (" dec chang:" , decimals, root .value , spinBox .value )
128
119
value = decimalToInt (__valueAsDecimal)
129
- console .log (" after dec chang:" , decimals, root .value , spinBox .value )
130
120
}
131
121
132
122
contentItem: TextInput {
0 commit comments