diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-04-23 10:04:28 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-23 11:26:14 +0200 |
commit | 5f7ba49e2501286670e19ee8ba7d48b169fa3330 (patch) | |
tree | f15759630065bae0370a8980abb373beb486bb3e /tests | |
parent | e865df80a907ceb3354a3369f9467022f451d692 (diff) |
TextInput: Fix cursor navigation with mask
text().length() was used to check if a cursor movement
to the right was valid. The problem is that with a mask and
not text set yet (inputMask: "#0:00;*") pressing the right
arrow would not move the cursor.
The input and other functions use the actual d->m_text
since that includes the mask length.
Task-number: QTBUG-30740
Change-Id: Ic225778e5a49d80b754b63d0eb4a438eaa9818e2
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp index d1ed6dd05a..4ffbe9ccd5 100644 --- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp @@ -6123,6 +6123,12 @@ void tst_qquicktextinput::keypress_inputMask_data() keys << Qt::Key_Home << "12ab"; QTest::newRow("uppercase") << QString("9999 >AA;_") << keys << QString("12 AB") << QString("12__ AB"); } + { + KeyList keys; + // inserting '12ab' + keys << Qt::Key_Right << Qt::Key_Right << "1"; + QTest::newRow("Move in mask") << QString("#0:00;*") << keys << QString(":1") << QString("**:1*"); + } } void tst_qquicktextinput::keypress_inputMask() |