From bd7ce75f26ae646176b22310c8cdbf568c7516dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Arve=20S=C3=A6ther?= Date: Mon, 2 Dec 2019 14:33:39 +0100 Subject: Do not emit inputMaskChanged when setting the same input mask If you did not specify a blank character (e.g. "; " as suffix) it would internally add that suffix to the property, resulting in that the property itself actually got a "; " suffix even when not specified. So when setting the same input mask again, it wouldn't match the existing inputMask property, and it would emit inputMaskChanged again. Change-Id: Ia47d63d56c640b4be9d6d0a704ddfaff01befbdb Fixes: QTBUG-80190 Reviewed-by: Richard Moe Gustavsen --- src/quick/items/qquicktextinput.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/quick/items/qquicktextinput.cpp') diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index a83b9beaa5..cd4f2eebc6 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -1140,7 +1140,10 @@ QString QQuickTextInput::inputMask() const void QQuickTextInput::setInputMask(const QString &im) { Q_D(QQuickTextInput); - if (d->inputMask() == im) + QString canonicalInputMask = im; + if (im.lastIndexOf(QLatin1Char(';')) == -1) + canonicalInputMask.append(QLatin1String("; ")); + if (d->inputMask() == canonicalInputMask) return; d->setInputMask(im); -- cgit v1.2.3