aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktextinput
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2019-12-02 11:50:13 +0100
committerEirik Aavitsland <eirik.aavitsland@qt.io>2019-12-10 14:43:38 +0100
commitf372438840da1c490bf000e8186947f3d45066e4 (patch)
tree8d3ec8e2c0700912d3f24d05ea017450d3132e85 /tests/auto/quick/qquicktextinput
parentae44beb0cee29d915fd6807e6c57176e3416b4bc (diff)
Make inputmask 'X' mask character require non-blank input
The implementation for the X mask would accept any printable character. Since that includes the blank character, there was no difference in behavior between the requiring X and optional x: both would allow the input to be unset, i.e. blank. This change should be seen in conjunction with the doc improvement qtbase:da0af1e and the corresponding change to the QLineEdit widget, where the same input mask handling code is duplicated. This patch series also concludes the old task questioning whether text() should strip blanks even when they are valid input (answer: yes, continue to do that), and so a couple of XFAILS was removed from the autotest. [ChangeLog][QtQuick][TextInput] Inputmask X character now requires non-blank input. Task-number: QTBUG-76320 Change-Id: I606ae04259f29f748b3ce604048c6eb6f10c2ff9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/auto/quick/qquicktextinput')
-rw-r--r--tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
index e1da7e5795..ed2ce98eae 100644
--- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
+++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
@@ -6408,8 +6408,20 @@ void tst_qquicktextinput::setInputMask_data()
QTest::newRow(QString(insert_mode + "blank=input").toLatin1())
<< QString("9999;0")
<< QString("2004")
+ << QString("24")
<< QString("2004")
- << QString("2004")
+ << bool(insert_text);
+ QTest::newRow(QString(insert_mode + "any_opt").toLatin1())
+ << QString("@xxx@")
+ << QString("@A C@")
+ << QString("@AC@")
+ << QString("@A C@")
+ << bool(insert_text);
+ QTest::newRow(QString(insert_mode + "any_req").toLatin1())
+ << QString("@XXX@")
+ << QString("@A C@")
+ << QString("@AC@@")
+ << QString("@AC@@")
<< bool(insert_text);
}
}
@@ -6452,9 +6464,6 @@ void tst_qquicktextinput::setInputMask()
QTest::keyClick(&window, input.at(i).toLatin1());
}
- QEXPECT_FAIL( "keys blank=input", "To eat blanks or not? Known issue. Task 43172", Abort);
- QEXPECT_FAIL( "insert blank=input", "To eat blanks or not? Known issue. Task 43172", Abort);
-
QCOMPARE(textInput->text(), expectedText);
QCOMPARE(textInput->displayText(), expectedDisplay);
}