Validation of input data is an important issue that can be handled in an object-oriented way by a combination of Qt classes. This chapter discusses some efficient ways of validating input, including the use of regular expressions.
Validators are nonvisual objects that are attached to input widgets (such as
QComboBox) to provide a general framework for checking user input. Qt has an abstract class named
QValidator that establishes the interface for all built-in and custom validators.
There are two concrete subclasses that can be used for numeric range checking: