ChrisW67,

It was the validator. The last parameter of QRegularExpression had to be changed from {1,4} to {0,4} to allow empty input:
Qt Code:
  1. QValidator *validator;
  2. validator = new QRegularExpressionValidator(QRegularExpression("[A-Z 1-5]{1,4}"), this);
  3. 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!