How to user input an infinity value to a QSpinBox?
-
@J-Hilk said in How to user input an infinity value to a QSpinBox?:
one less than infinity or one more?
:-)
-
I didn't get the meaning of "one less than infinity or one more?" I want to display 1000 means int32.
Just I don't want to restrict with any number, it will take 1 to any number.
I tried in QtDesigner but it will allow a maximum value of 1000000000 till this. -
@yashi95 I don't use the designer, I'm going of the documentation
https://doc.qt.io/qt-5/qspinbox.html#maximum-propthat says, the min/max is a signed int -> -2147483648 should be the minimum 🤔
Edit
a quick test:int main(int argc, char *argv[]) { QApplication app(argc, argv); QSpinBox sb; sb.setMinimum(std::numeric_limits<int32_t>::min()); sb.setMaximum(std::numeric_limits<int32_t>::max()); sb.show(); sb.resize(200,50); qDebug() << sb.minimum(); qDebug() << sb.maximum(); return app.exec(); }
shows that it is possible, seems like there's an input filter in the designer, that limits the number of digits you can but into it,
Seems like a bug
-
@J-Hilk , @yashi95 too
According to me (Linux, Creator 4.11.0). It is not any limit on the number of characters/digits you can type. Rather, there seems to just be one special case:- max:
2147483647
=> works - max:
2147483648
=> does not allow you to enter this, correct - min:
-2147483647
=>works - min:
-2147483648
=> does not allow you to enter this, wrong
! So it's only 1 out, on the minimum only. Which hardly seems like a show-stopper!
I have not entered this into your Qt bug report, I don't know if you want me to or you want to check/do it yourself?
- max:
-
oh,
I tested other 10 digit numbers, but I failed to make them smaller than -2147483647
-214748366X doset allow anything for x, which makes sense !You can add to the report if you like, it's going nowhere anyway.
You may have noticed that the assigned person removed himself and the ticket is now "unassigned" and I doubt it will ever be touch upon again