QRegExp with QLineEdit
-
How can I insert in a QLineEdit digits and letters but first 2 character I want to letters and then 3 digits and again 2 letters
For eg: AA122BD ? -
This post is deleted! -
Hi,
You can use the QRegExpValidator class. If you're on Qt 5 then please consider using QRegularExpression
-
@Endar
I hope this will help you
QRegExpValidator* validator = new QRegExpValidator(QRegExp("[A-a-Z-z][A-a-Z-z]\\d{0,2}\\d[A-a-Z-z][A-a-Z-z]"));
ui->lineEdit->setValidator(validator);