[ fromfile: validation-questions.xml id: validation-questions ]
What is an input mask? What can an input mask do for you?
An inputMask is a QString property of a QLineEdit which can contain mask chars to constrain the incoming text. An inputMask can specify what kinds of characters are allowed in certain positions of a string that is being typed into a QLineEdit.
What is a regular expression? What can you use it for?
What is a validator? What is it used for?
Describe three different kinds of validators.
What is a regular expression meta-character? There are four kinds of metacharacters: quantifier, character set, group, and anchor. Give examples of each type and explain what they mean.
A meta-character is a character that "describes" other characters. Quantifiers are ?*+{m,n} - they modify the preceeding thing with a quantity. Character Sets are things that can be replaced by other characters: .\d\D\s\S\w\W[a-z]
. Grouping characters are parantheses ()
, which let you back-reference parts of the matched result. Anchoring characters describe what goes at the beginning or end of the pattern: ^\b\B$
.
Why would you want to extend QValidator?
When the thing you are checking is not a simple regular expression, but something that requires advance calculation.
Generated: 2012-03-02 | © 2012 Alan Ezust and Paul Ezust. |