From 4b5afc788f8f476a7bb2f57872ad8a017bf0c870 Mon Sep 17 00:00:00 2001 From: Tuomas Heimonen Date: Thu, 28 Jun 2018 10:49:43 +0300 Subject: QIntValidator: Intermediate for number if digits equal or less than max Input value which is over the highest acceptable value, but consisting of a number of digits equal to or less than the max value should be considered intermediate. [ChangeLog][QtGui][QIntValidator] Input value with over the highest acceptable value, but with equal or less amount of digits than the maximum value is now considered intermediate. Task-number: QTBUG-59650 Change-Id: I71a77c9c266f0f3b62c71ac6cb995019385c1cf5 Reviewed-by: Andy Shaw --- tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/auto/widgets') diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index a10f128860..448e2030bc 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -2664,9 +2664,9 @@ void tst_QLineEdit::setValidator_QIntValidator_data() << 0 << 100 << QString("153") - << QString(useKeys ? "15" : "") + << QString("153") << bool(useKeys) - << bool(useKeys ? true : false) + << bool(false) << uint(QLineEdit::Normal); QTest::newRow(QString(inputMode + "range [-100,100] int '-153'").toLatin1()) << -100 @@ -2687,7 +2687,7 @@ void tst_QLineEdit::setValidator_QIntValidator_data() QTest::newRow(QString(inputMode + "range [3,7] int '8'").toLatin1()) << 3 << 7 - << QString("8") + << QString("") << QString("") << bool(useKeys) << bool(false) @@ -3292,7 +3292,7 @@ void tst_QLineEdit::editInvalidText() { QLineEdit *testWidget = ensureTestWidget(); testWidget->clear(); - testWidget->setValidator(new QIntValidator(0, 120, 0)); + testWidget->setValidator(new QIntValidator(0, 12, 0)); testWidget->setText("1234"); QVERIFY(!testWidget->hasAcceptableInput()); -- cgit v1.2.3