#include <IntValidator.h>
Public Member Functions | |
| IntValidator (QObject *pParent) | |
| IntValidator (T minimum, T maximum, QObject *pParent) | |
| virtual | ~IntValidator () |
| void | setMinimum (T minimum) |
| T | minimum () const |
| void | setMaximum (T maximum) |
| T | maximum () const |
| void | setRange (T minimum, T maximum) |
| virtual QValidator::State | validate (QString &input, int &pos) const |
The IntValidator class extends the QValidator class to provide a validator for integer data types, including large integer types. The following data types are supported:
The behavior of IntValidator is similar to that of QIntValidator, except integer types larger than int are supported. The class defines a validation range bounded by a minimum and maximum value that is checked during the validation sequence.
Definition at line 41 of file IntValidator.h.
| IntValidator< T >::IntValidator | ( | QObject * | pParent | ) |
Creates an IntValidator object with a default range.
This constructor creates a default validator with the default minimum and maximum values set to std::numeric_limits<T>::min() and std::numeric_limits<T>::max().
| pParent | The parent object. |
| IntValidator< T >::IntValidator | ( | T | minimum, | |
| T | maximum, | |||
| QObject * | pParent | |||
| ) |
Creates an IntValidator object with a given range.
This constructor creates a validator with the validation range set to the given minimum and maximum values.
| minimum | The minimum value for the validation range. | |
| maximum | The maximum value for the validation range. | |
| pParent | The parent object. |
| virtual IntValidator< T >::~IntValidator | ( | ) | [virtual] |
Destroys the validator object.
| void IntValidator< T >::setMinimum | ( | T | minimum | ) |
Sets the minimum value of the validation range.
| minimum | The minimum value. |
| T IntValidator< T >::minimum | ( | ) | const |
| void IntValidator< T >::setMaximum | ( | T | maximum | ) |
Sets the maximum value of the validation range.
| maximum | The maximum value. |
| T IntValidator< T >::maximum | ( | ) | const |
| void IntValidator< T >::setRange | ( | T | minimum, | |
| T | maximum | |||
| ) |
Sets the minimum and maximum values of the validation range.
| minimum | The minimum value. | |
| maximum | The maximum value. |
| virtual QValidator::State IntValidator< T >::validate | ( | QString & | input, | |
| int & | pos | |||
| ) | const [virtual] |
Validates the given text against the minimum and maximum integer values.
This method is typically called automatically by the widget containing the validator. The implementation converts the given string to an integer using the QString text conversion methods (e.g. QString::toInt()) and returns whether the string is or is not a valid integer within the validation range or if the string could be a valid integer with additional input.
| input | The text to validate. | |
| pos | The cursor position. This parameter is ignored. |