How to set the range ie,(115.0 to 200.0) in textedit?
How to set the range ie,(115.0 to 200.0) in textedit?
hi,
u can use spin box for setting the range.
why u r using text edit?Qt Code:
sp->setRange(115.0,200.0);To copy to clipboard, switch view to plain text mode
for reading the value from spinBox
for setting the value in spinbox
sp->setValue();
Hope it helps
Bala
Or if you really need text edit use QLineEdit and setValidator, also see QDoubleValidator
LE: a small issue with BalaQT's answer is that you need QDoubleSpinBox class QSpinBox uses only int's
thanks zlatomir for correcting meLE: a small issue with BalaQT's answer is that you need QDoubleSpinBox class QSpinBox uses only int's
Bala
Bookmarks