Open Enyium opened 3 weeks ago
Hey, thanks again for the request. I think that make totally sense. On SpinBox
that can support int and float, by configuration.
On[e]
SpinBox
that can support int and float, by configuration.
But Slint doesn't have generics. Why try to be two things at the same time? Qt also differentiates between QDoubleSpinBox
and QSpinBox
. I think when different data types are output, there should be different widgets. Of course, it makes sense to use common code to implement them.
Also relevant: #1870.
I had a
SpinBox
that represented a percentage. But I needed increased precision. The only possibility with the currentint
-centricSpinBox
was to present its values as per mille values. This is less intuitive for the end users, though.It would be better, if
SpinBox
allowed forfloat
values. Since this also changes the possible range of values, you may want to create a second widget, abstracting the common functionality into an internal widget.EDIT: Obviously, the
float
SpinBox
would need to have a way to specify the number of decimal places it should work with.EDIT: See also: https://github.com/slint-ui/slint/issues/6240#issuecomment-2364032458.