Refer to the QComboBox::setValidator(const QValidator*)
member function:
http://qt-project.org/doc/qt-4.8/qcombobox.html#setValidator
This allows you to set a validator to constrain any input that users type into the line edit of the combo box.
Qt provides three validators: QIntValidator
to constrain inputs to integers within a certain range; QDoubleValidator
to constrain inputs to floating point values within a certain range and with a specified precision; and QRegExpValidator
to constrain inputs to a particular regular expression. If your validation needs are more complex, you may also subclass QValidator
and write your own and then install it into the combo box. See also: http://qt-project.org/doc/qt-4.8/qvalidator.html