O'Reilly logo

An Introduction to Design Patterns in C++ with Qt™, Second Edition by Paul Ezust, Alan Ezust

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 14: Validation and Regular Expressions

Input data generally needs to be screened, or validated, to make sure that it is appropriate. Numeric data generally needs to be within certain ranges. String data often must have a certain format. 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 and input masks give the developer fine-grained control over behavior of a QLineEdit, for the purpose of restricting certain kinds of inputs. Before working with them, keep in mind that Qt also offers predefined input widgets and input dialogs for many common value ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required