diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-03-28 01:33:58 (GMT) |
---|---|---|
committer | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-03-28 02:23:55 (GMT) |
commit | e5a911351ae11376e6d86d70ddacd4016450ed6b (patch) | |
tree | 074a1454d88cce11757b7ea48123d90f12c8018c /tests | |
parent | 903fdabf3eb808a96e2a869049c2095cde09d2be (diff) | |
download | Qt-e5a911351ae11376e6d86d70ddacd4016450ed6b.zip Qt-e5a911351ae11376e6d86d70ddacd4016450ed6b.tar.gz Qt-e5a911351ae11376e6d86d70ddacd4016450ed6b.tar.bz2 |
Fix text selection with shift-click.
Move the cursor when word selection is NOT enabled. If word selection
is enabled then then cursor would have been moved in a previous branch,
the (incorrectly inverted) check was to prevent that being overridden.
Change-Id: I788c3b41c6fdb250d6086893ea98a1aa8c302514
Task-number: QTBUG-18017
Reviewed-by: Alan Alpert
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index f62c2c5..04ecf91 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -1340,6 +1340,12 @@ void tst_qdeclarativetextedit::mouseSelection() else QVERIFY(str.isEmpty()); + // Clicking and shift to clicking between the same points should select the same text. + textEditObject->setCursorPosition(0); + QTest::mouseClick(canvas->viewport(), Qt::LeftButton, Qt::NoModifier, canvas->mapFromScene(QPoint(x1,y))); + QTest::mouseClick(canvas->viewport(), Qt::LeftButton, Qt::ShiftModifier, canvas->mapFromScene(QPoint(x2,y))); + QCOMPARE(textEditObject->selectedText(), str); + delete canvas; } @@ -1436,6 +1442,12 @@ void tst_qdeclarativetextedit::mouseSelectionMode() QVERIFY(str != text); } + // Clicking and shift to clicking between the same points should select the same text. + textEditObject->setCursorPosition(0); + QTest::mouseClick(canvas->viewport(), Qt::LeftButton, Qt::NoModifier, canvas->mapFromScene(QPoint(x1,y))); + QTest::mouseClick(canvas->viewport(), Qt::LeftButton, Qt::ShiftModifier, canvas->mapFromScene(QPoint(x2,y))); + QCOMPARE(textEditObject->selectedText(), str); + delete canvas; } |