Commit 1eaadfa7 authored by Tobias Hunger's avatar Tobias Hunger

FancyLineEdit: Take validator into account

Take validator into account (if set) when checking validity
of the input.

Change-Id: Ieec7249aff50cf419833693dcf33fb241e4c044a
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 990cedeb
......@@ -405,8 +405,12 @@ void FancyLineEdit::setTextColor(QWidget *w, const QColor &c)
bool FancyLineEdit::validate(const QString &value, QString *errorMessage) const
{
Q_UNUSED(value);
Q_UNUSED(errorMessage);
if (const QValidator *v = validator()) {
QString tmp = value;
int pos = cursorPosition();
return v->validate(tmp, pos) == QValidator::Acceptable;
}
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment