Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

14.2. Validators

Validators are objects that can be attached to input widgets (such as QLineEdit, QSpinBox, and 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.

Two of QValidator’s concrete subclasses can be used for numeric range checking: QIntValidator and QDoubleValidator. There is also a concrete subclass that can be used for validating a string with a specified regular expression. We discuss regular expressions in the next section.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial