you can use setInputMask to specify a validation input mask, in your case you can use N or n to allow only characters in AZ, az, 0-9 range, Smth, like this:
lineEdit->setInputMask("nnnnnnnn;_");
lineEdit->setCursorPosition(0);
QValidator , setValidator. , .
: setMaxLength
lineEdit->setMaxLength(8);
, ,