diff options
author | Robert Loehning <robert.loehning@nokia.com> | 2012-06-15 14:35:00 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-20 11:13:18 (GMT) |
commit | 4093ae7ae38f6006f7f8c1438e89777144a0c10b (patch) | |
tree | 94568f0bbd4ae9766636b908f9121fd020cf50e3 /tests/auto | |
parent | d146da2d76531fe3ad22e592e4f111449788536b (diff) | |
download | Qt-4093ae7ae38f6006f7f8c1438e89777144a0c10b.zip Qt-4093ae7ae38f6006f7f8c1438e89777144a0c10b.tar.gz Qt-4093ae7ae38f6006f7f8c1438e89777144a0c10b.tar.bz2 |
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')
-rw-r--r-- | tests/auto/qplaintextedit/tst_qplaintextedit.cpp | 10 | ||||
-rw-r--r-- | tests/auto/qtextedit/tst_qtextedit.cpp | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp index 3eeae7e..4681ef0 100644 --- a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp +++ b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp @@ -1478,12 +1478,18 @@ void tst_QPlainTextEdit::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); } diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp index d308332..83913d3 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); } |