Build fix for -no-feature-validator

Change-Id: I884381964d692eb5d3eb9088c87779c03057981d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
Paul Olav Tvete 2017-02-17 14:11:01 +01:00 committed by Stephan Binner
parent a58dafd2e8
commit 410d9cabb7
1 changed files with 2 additions and 0 deletions

View File

@ -537,11 +537,13 @@ bool QAbstractItemDelegatePrivate::tryFixup(QWidget *editor)
#ifndef QT_NO_LINEEDIT
if (QLineEdit *e = qobject_cast<QLineEdit*>(editor)) {
if (!e->hasAcceptableInput()) {
#if QT_CONFIG(validator)
if (const QValidator *validator = e->validator()) {
QString text = e->text();
validator->fixup(text);
e->setText(text);
}
#endif
return e->hasAcceptableInput();
}
}