diff options
author | Robert Loehning <robert.loehning@nokia.com> | 2012-06-15 16:35:00 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-20 13:13:18 +0200 |
commit | 4093ae7ae38f6006f7f8c1438e89777144a0c10b (patch) | |
tree | 94568f0bbd4ae9766636b908f9121fd020cf50e3 /tests/auto/qtextedit | |
parent | d146da2d76531fe3ad22e592e4f111449788536b (diff) |
Restored native behavior when moving cursor from selection
Reverting changes from 1b031759ddfdab9703dfecac13f1ed318da3dafe except
for Mac
Task-number: QTCREATORBUG-7215
Change-Id: I8570c4bd35daf8b5820507a9399d33d00f96d41b
Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
Diffstat (limited to 'tests/auto/qtextedit')
-rw-r--r-- | tests/auto/qtextedit/tst_qtextedit.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp index d3083326f9..83913d3617 100644 --- a/tests/auto/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/qtextedit/tst_qtextedit.cpp @@ -1901,12 +1901,18 @@ void tst_QTextEdit::selectionChanged() QCOMPARE(ed->textCursor().position(), 4); QCOMPARE(selectionChangedSpy.count(), 3); +#ifdef Q_WS_MAC + const int posAfterRight = 4; // cursor at end of former selection +#else + const int posAfterRight = 5; // cursor was at end of former selection, moved right +#endif + QTest::keyClick(ed, Qt::Key_Right); - QCOMPARE(ed->textCursor().position(), 4); + QCOMPARE(ed->textCursor().position(), posAfterRight); QCOMPARE(selectionChangedSpy.count(), 4); QTest::keyClick(ed, Qt::Key_Right); - QCOMPARE(ed->textCursor().position(), 5); + QCOMPARE(ed->textCursor().position(), posAfterRight + 1); QCOMPARE(selectionChangedSpy.count(), 4); } |