diff options
Diffstat (limited to 'client/widgets/lineedit.cc')
-rw-r--r-- | client/widgets/lineedit.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/client/widgets/lineedit.cc b/client/widgets/lineedit.cc index 992c0b2..0a16947 100644 --- a/client/widgets/lineedit.cc +++ b/client/widgets/lineedit.cc @@ -31,8 +31,8 @@ LineEdit::LineEdit(QWidget *parent, QString reg_exp) : QLineEdit(parent) { widget_name = "widget_name"; - QRegExp rx(reg_exp); - validator = new QRegExpValidator(rx, this); + rx = QRegExp(reg_exp); + //validator = new QRegExpValidator(rx, this); //setValidator(validator); changed(""); @@ -42,9 +42,8 @@ LineEdit::LineEdit(QWidget *parent, QString reg_exp) : QLineEdit(parent) void LineEdit::changed(QString text) { QPalette palette; - int res = 0; - if(validator->validate(text, res) == QValidator::Acceptable) { + if(rx.exactMatch(text)) { // valid string palette.setBrush(backgroundRole(), QBrush(QColor(255, 255, 255))); valid = true; |