You have to use
virtual QValidator::State QRegExpValidator::validate(QString & input, int & pos) const
or
bool QRegExp::exactMatch(const QString & str) const
by yourself. This should not be difficult, you just need to determine where to start the test.
source share