ChrisW67,
It was the validator. The last parameter of QRegularExpression had to be changed from {1,4} to {0,4} to allow empty input:
validator = new QRegularExpressionValidator(QRegularExpression("[A-Z 1-5]{1,4}"), this);
validator = new QRegularExpressionValidator(QRegularExpression("[A-Z 1-5]{0,4}"), this); // works
QValidator *validator;
validator = new QRegularExpressionValidator(QRegularExpression("[A-Z 1-5]{1,4}"), this);
validator = new QRegularExpressionValidator(QRegularExpression("[A-Z 1-5]{0,4}"), this); // works
To copy to clipboard, switch view to plain text mode
Thank you very much for your help!
Bookmarks