views:

182

answers:

2

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.

+1  A: 

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.

vnm
Better would be to have setters for minimum and maximum values. So after changing Z it is enough to change minimum value of it :D
przemo_li
A: 

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

przemo_li