Solved numerical inputs?
-
I'm trying to find a good numerical input control. I'm using Qt 5.12. SpinBox is pretty close to what I want, but you can't click on the middle of it and type in a number. I tried TextInput with IntValidator, which seems like it could be a good solution except that the text property is inherently text and it would take some extra jiggering to get it to convert values to integers as I need.
Does anyone have suggestions for me?
-
@kgregory " but you can't click on the middle of it and type in a number."
set the
editable
property to true -
@kgregory " but you can't click on the middle of it and type in a number."
set the
editable
property to true -
omg! I love you!
bonus points: how can I change the appearance of the spinbox? for example, combobox and slider both have good documentation on how to change the color and shape of various subcomponents, but spinbox doesn't. It looks a little out of place in my app.
-
@kgregory
https://doc.qt.io/qt-5/qspinbox-members.html shows all the inherited methods & properties, it can do all the standard widget stuff.Search https://doc.qt.io/qt-5/stylesheet-reference.html for
QSpinBox
and you will see the special QSS styles supported. https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qspinbox shows you a variety of attributes you can alter on its appearance.