validate combos to disallow junk characters

closes #362
This commit is contained in:
garak 2021-09-07 17:35:55 -04:00
parent 735a095ced
commit ef78b7957c

View file

@ -16,6 +16,10 @@ NoScrollComboBox::NoScrollComboBox(QWidget *parent)
setEditable(true);// can set to false manually when using
this->completer()->setCompletionMode(QCompleter::PopupCompletion);
this->completer()->setFilterMode(Qt::MatchContains);
QRegularExpression re("[A-Za-z_0-9]+");
QValidator *validator = new QRegularExpressionValidator(re);
this->setValidator(validator);
}
void NoScrollComboBox::wheelEvent(QWheelEvent *event)