[ fromfile: validation.xml id: inputmask ]
Table 14.1. Mask Characters
Character | Required Character in That Position |
---|---|
A | ASCII alphabetic character - uppercase or lowercase |
N | ASCII alphanumeric character - uppercase or lowercase |
X | ASCII any character |
D | ASCII nonzero digit |
9 | ASCII digit |
H | Hexadecimal digit |
B | Binary digit |
Lowercase versions of the mask letters listed in Table 14.1 specify that the corresponding input characters are permitted in that position but not required.
Using zero (0) instead of nine (9) indicates that an ASCII digit is permitted in that position but not required.
# indicates that an ASCII digit or a plus (+) or a minus (–) is permitted in that position but not required.
Table 14.2. Mask Meta Characters
Character | Effect |
---|---|
> | The following alphabetic characters are uppercased |
< | The following alphabetic characters are lowercased |
! | No further case conversion |
\ | Escape character |
Example 14.1. src/validate/inputmask/masktestform.h
Example 14.2. src/validate/inputmask/masktestform.cpp
[ . . . . ] MaskTestForm::MaskTestForm(): m_InputMask(new QLineEdit), m_StringEntry(new QLineEdit), m_Result(new QLabel) { setupForm(); move(500, 500); } void MaskTestForm::setupForm() { setWindowTitle("Mask Test Demo"); QPushButton* againButton = new QPushButton("Another Input Mask", this); QPushButton* quitButton = new QPushButton("Quit", this); QFormLayout *form = new QFormLayout(this); form->addRow("Mask String:", m_InputMask); form->addRow("Test Input: ", m_StringEntry); form->addRow("Result:", m_Result); connect(m_InputMask, SIGNAL(returnPressed()), this, SLOT(installMask())); connect(m_StringEntry, SIGNAL(returnPressed()), this, SLOT(showResult())); [ . . . . ] } void MaskTestForm::installMask() { m_StringEntry->setInputMask(m_InputMask->text()); } [ . . . . ]
Generated: 2012-03-02 | © 2012 Alan Ezust and Paul Ezust. |