tags:

views:

126

answers:

2

I have a QDoubleSpinBox in QT. I would like to conditionally disable the step up and/or down buttons. I am not sure how to do this.

I saw that in the QAbstractSpinBox there is a flag called StepEnabledFlag. But i am not sure how to set that.

Can anybody help me out with this.

Thanks Arjun

+4  A: 

You need to create a QDoubleSpinBox subclass with a custom implementation of the step enabled function. (http://doc.trolltech.com/4.5/qabstractspinbox.html#stepEnabled)

Parker
+1  A: 

Use QAbstractSpinBox::setButtonSymbols(). You can set one or both of the arrow buttons to be disabled.

Documentation reference: http://doc.trolltech.com/4.5/qabstractspinbox.html#buttonSymbols-prop.

swongu
Actually, set button symbols allows you to choose between up and down arrow buttons, plus and minus buttons, or no buttons at all. It doesn't let you individually enable and disable them.
Parker