summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPasi Matilainen <pasi.matilainen@digia.com>2012-01-16 07:10:18 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-02-03 10:10:44 (GMT)
commit1b031759ddfdab9703dfecac13f1ed318da3dafe (patch)
tree05c3e701922ef5aef268a26521fc805a03978ff3 /tests
parent882a868486949784206d2ef386ad4e2c0da2b07e (diff)
downloadQt-1b031759ddfdab9703dfecac13f1ed318da3dafe.zip
Qt-1b031759ddfdab9703dfecac13f1ed318da3dafe.tar.gz
Qt-1b031759ddfdab9703dfecac13f1ed318da3dafe.tar.bz2
QTextEdit cursor position fix when moving left/right with selection
When text has been selected in a QTextEdit and the left or right arrow key is pressed, the cursor moves one character beyond the start or end of the selection, when it shouldn't move past the selection. Fixed by moving the cursor to the right place when a selection is active. Task-number: QTBUG-22853 Change-Id: I9ea1863436db98627a6fd041ce554cf10be26493 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qplaintextedit/tst_qplaintextedit.cpp4
-rw-r--r--tests/auto/qtextedit/tst_qtextedit.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
index dfb8ca0..3eeae7e 100644
--- a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
+++ b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp
@@ -1479,11 +1479,11 @@ void tst_QPlainTextEdit::selectionChanged()
QCOMPARE(selectionChangedSpy.count(), 3);
QTest::keyClick(ed, Qt::Key_Right);
- QCOMPARE(ed->textCursor().position(), 5);
+ QCOMPARE(ed->textCursor().position(), 4);
QCOMPARE(selectionChangedSpy.count(), 4);
QTest::keyClick(ed, Qt::Key_Right);
- QCOMPARE(ed->textCursor().position(), 6);
+ QCOMPARE(ed->textCursor().position(), 5);
QCOMPARE(selectionChangedSpy.count(), 4);
}
diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp
index cef7255..d308332 100644
--- a/tests/auto/qtextedit/tst_qtextedit.cpp
+++ b/tests/auto/qtextedit/tst_qtextedit.cpp
@@ -1902,11 +1902,11 @@ void tst_QTextEdit::selectionChanged()
QCOMPARE(selectionChangedSpy.count(), 3);
QTest::keyClick(ed, Qt::Key_Right);
- QCOMPARE(ed->textCursor().position(), 5);
+ QCOMPARE(ed->textCursor().position(), 4);
QCOMPARE(selectionChangedSpy.count(), 4);
QTest::keyClick(ed, Qt::Key_Right);
- QCOMPARE(ed->textCursor().position(), 6);
+ QCOMPARE(ed->textCursor().position(), 5);
QCOMPARE(selectionChangedSpy.count(), 4);
}