I need to use a double spinbox
for my QML view
and in this case, I based my spinbox
on this example .
SpinBox {
id: spinbox
from: 0
value: 110
to: 100 * 100
stepSize: 100
anchors.centerIn: parent
property int decimals: 2
property real realValue: value / 100
validator: DoubleValidator {
bottom: Math.min(spinbox.from, spinbox.to)
top: Math.max(spinbox.from, spinbox.to)
}
textFromValue: function(value, locale) {
return Number(value / 100).toLocaleString(locale, 'f', spinbox.decimals)
}
valueFromText: function(text, locale) {
return Number.fromLocaleString(locale, text) * 100
}
}
It seems that when you use a custom spinbox, it is not displayed as a "classic" spinbox. It is displayed like this:
However, buttons are too big for my interface. I would like to know is there is a easy way to display the spinbox as a "classic" spinbox like this: