diff options
author | Liang Qi <liang.qi@qt.io> | 2016-10-27 09:54:43 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-10-27 09:56:20 +0200 |
commit | 6b58ce5251045fb751eb511b2cb3571bcd113f28 (patch) | |
tree | 7d3b63836c7ec0cce618ce4180c9f5ed63900a6a /tests/auto/quick/qquicktextedit | |
parent | 93d7c26653757755ae65f14d06d6df6f9ec2fc07 (diff) | |
parent | c849f3a7eff55d60c4010831ec67336c5c0f2a27 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
src/quick/items/qquickwindow.cpp
tests/auto/quick/qquicktext/BLACKLIST
tests/auto/quick/qquicktextedit/BLACKLIST
Change-Id: I8bd68b0b5e853b7908791d2cbddd18dd527c76ae
Diffstat (limited to 'tests/auto/quick/qquicktextedit')
-rw-r--r-- | tests/auto/quick/qquicktextedit/BLACKLIST | 2 | ||||
-rw-r--r-- | tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp | 16 |
2 files changed, 8 insertions, 10 deletions
diff --git a/tests/auto/quick/qquicktextedit/BLACKLIST b/tests/auto/quick/qquicktextedit/BLACKLIST index 297146195b..5f3208f848 100644 --- a/tests/auto/quick/qquicktextedit/BLACKLIST +++ b/tests/auto/quick/qquicktextedit/BLACKLIST @@ -1,5 +1,3 @@ -[mouseSelection] -* [undo] * [undo_keypressevents] diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp index b7bfc357f3..cb2a7bfd83 100644 --- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp +++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp @@ -2003,12 +2003,18 @@ void tst_qquicktextedit::mouseSelection() else if (clicks == 3) QTest::mouseDClick(&window, Qt::LeftButton, Qt::NoModifier, p1); QTest::mousePress(&window, Qt::LeftButton, Qt::NoModifier, p1); + if (clicks == 2) { + // QTBUG-50022: Since qtbase commit beef975, QTestLib avoids generating + // double click events by adding 500ms delta to release event timestamps. + // Send a double click event by hand to ensure the correct sequence: + // press, release, press, _dbl click_, move, release. + QMouseEvent dblClickEvent(QEvent::MouseButtonDblClick, p1, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); + QGuiApplication::sendEvent(textEditObject, &dblClickEvent); + } QTest::mouseMove(&window, p2); QTest::mouseRelease(&window, Qt::LeftButton, Qt::NoModifier, p2); QTRY_COMPARE(textEditObject->selectedText(), selectedText); - QTest::qWait(QGuiApplication::styleHints()->mouseDoubleClickInterval() + 10); - // Clicking and shift to clicking between the same points should select the same text. textEditObject->setCursorPosition(0); if (clicks > 1) @@ -2017,9 +2023,6 @@ void tst_qquicktextedit::mouseSelection() QTest::mouseClick(&window, Qt::LeftButton, Qt::NoModifier, p1); QTest::mouseClick(&window, Qt::LeftButton, Qt::ShiftModifier, p2); QTRY_COMPARE(textEditObject->selectedText(), selectedText); - - // ### This is to prevent double click detection from carrying over to the next test. - QTest::qWait(QGuiApplication::styleHints()->mouseDoubleClickInterval() + 10); } void tst_qquicktextedit::dragMouseSelection() @@ -2960,9 +2963,6 @@ void tst_qquicktextedit::middleClickPaste() // Middle click pastes the selected text, assuming the platform supports it. QTest::mouseClick(&window, Qt::MiddleButton, Qt::NoModifier, p3); - // ### This is to prevent double click detection from carrying over to the next test. - QTest::qWait(QGuiApplication::styleHints()->mouseDoubleClickInterval() + 10); - if (QGuiApplication::clipboard()->supportsSelection()) QCOMPARE(textEditObject->text().mid(1, selectedText.length()), selectedText); else |