From a1ea8f59e650c6be3e14274b36b1197245e96067 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Thu, 21 Jun 2012 16:44:30 +1000 Subject: Refresh the TextInput.acceptableInput property when validator changes. Task-number: QTBUG-26260 Change-Id: I404640d9a2f000976887dcc2119f971c17a71c7e Reviewed-by: Martin Jones --- tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp index 73cf2d3aaa..d2d8d5ad14 100644 --- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp @@ -2031,6 +2031,16 @@ void tst_qquicktextinput::validators() QCOMPARE(dblInput->hasAcceptableInput(), true); QCOMPARE(dblSpy.count(), 3); + // Changing the validator properties will re-evaluate whether the input is acceptable. + intValidator->setTop(10); + QCOMPARE(dblInput->property("acceptable").toBool(), false); + QCOMPARE(dblInput->hasAcceptableInput(), false); + QCOMPARE(dblSpy.count(), 4); + intValidator->setTop(12); + QCOMPARE(dblInput->property("acceptable").toBool(), true); + QCOMPARE(dblInput->hasAcceptableInput(), true); + QCOMPARE(dblSpy.count(), 5); + QQuickTextInput *strInput = qobject_cast(qvariant_cast(canvas.rootObject()->property("strInput"))); QVERIFY(strInput); QSignalSpy strSpy(strInput, SIGNAL(acceptableInputChanged())); -- cgit v1.2.3