aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextinput.cpp
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@qt.io>2019-12-02 14:33:39 +0100
committerJan Arve Sæther <jan-arve.saether@qt.io>2019-12-02 15:43:01 +0100
commitbd7ce75f26ae646176b22310c8cdbf568c7516dd (patch)
tree1666a5b666b61477c9709d0bc05c5614b7c5cf04 /src/quick/items/qquicktextinput.cpp
parent23df1603f514407d245a2740f32f589318ef654e (diff)
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 <richard.gustavsen@qt.io>
Diffstat (limited to 'src/quick/items/qquicktextinput.cpp')
-rw-r--r--src/quick/items/qquicktextinput.cpp5
1 files changed, 4 insertions, 1 deletions
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);