Numeric INI values are sometimes not displayed correctly
Currently on my computer there is a bug where in some circumstances numbers coming from an INI file are not displayed correctly. This is very bad, because e. g. a MIN filter with minimum = 0 does not work.
The reason is a culmination of annoyances we unfortunately have little control over:
- The whole thing with a QSpinBox not supporting empty values, but we have to support them. Now we hide the value by setting the font color to the background color, but this is a hack and needs to be handled with care.
- Since the font color is a matter of stylesheets, this is inherently problematic. Within submodules we need to apply them from "outside" with a tiny delay, see e. g. Number.cc@514. Otherwise the change is just not registered. For me here increasing this to 3 ms solves the bug but obviously this can not be the right way. Will try to commit a minimal effort hotfix though when the new repo is open. (
qApp.processEvents()instead of the timer does not help.)
- If a QSpinBox is set to the same value it already displays, no "changed" signal is emitted, so in this case (an INI delivers the same value as currently displayed) we need to trigger the signal manually. This in itself is not really a problem, but it convolutes the whole thing with more special cases. Since a QSpinBox must have a number set, this can also apply to hidden values.
The question now is if there is a better way for all of this...