Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with integral control value types exceeding int #167

Open
Florob opened this issue Feb 28, 2024 · 3 comments
Open

Issues with integral control value types exceeding int #167

Florob opened this issue Feb 28, 2024 · 3 comments

Comments

@Florob
Copy link
Contributor

Florob commented Feb 28, 2024

There are various issues with control value types exceeding the range of an int.
For LINEAR_UINT32 a QSpinBox is used which internally uses an int. Therefore, values larger than INT_MAX are wrapped around, typically causing the spin box's maximum value to be negative and lower than the minimum. As a result current values are not displayed, and new values can't be set.
For values even larger than this the "fallback" is a combo box. Since the range of possible values is larger than for smaller types, this is problematic. E.g. I ran into a case where Hive tried to add 2³² entries to a combo box ultimately triggering the watchdog timer.

@christophe-calmejane
Copy link
Owner

I don't have a solution for that (yet), due to Qt limitation for this kind of widget.
Any (viable) suggestion is very welcome. Any contribution is even more welcome :)

@Florob
Copy link
Contributor Author

Florob commented Feb 29, 2024

I do have local changes that work around the LINEAR_UINT32 case by using QDoubleSpinBox. On IEEE 754 systems (pretty much all of them theses days) double is exact for integers up to $2^{53}$, so that could cover some more ground if we can choose the widget dynamically instead of at compile time.

@christophe-calmejane
Copy link
Owner

I think I already tried to have dynamic change (in a branch where I worked on plugins, specifically for custom control display) and it was a real pain (eg. it didn't work).

Maybe I can reprioritize plugins so I have a working ground for dynamic control widget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants