Question

I am maintaining an application which tries to help the user get his parameters to work together, as there are many interdependencies.

Now there is a default value of x for a variable Y. When the user changes some other variable Z, there might be a new minimum value for Y which is greater than x. This is set as a minimum for the spinbox. Now the spinbox can not display the current value anymore, but rather displays the minimum. I would like the user to be able to see his old value. Is there some setting I don't see in Qt to achieve something like this?

Same question goes for QComboBox.

Was it helpful?

Solution

As one approach you may create new class, inherited from Qt standart QSpinBox(or in second case from QComboBox) and add your own logic to them: posibility to show value below the minimum, but when someone want explicitly change value in your input widgets, you will check for bounds.

OTHER TIPS

Another approach is to connect each widget to function that will check if others values are correct (and if not will correct them) :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top