diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-07-21 17:02:14 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-07-22 12:14:40 +0000 |
commit | 333c226f7cfc53a7e55a8e4d5502788d39847342 (patch) | |
tree | 6bb271ae891235c7f62175763202c1547c74b141 /tests/auto/popup | |
parent | ff3a9a6762eb4e54048afee168783aa9cf5391c2 (diff) |
Don't leak hover events through modal overlays
Task-number: QTBUG-53419
Change-Id: I5c1ce684cff7954f9c011e991e3924741ad44367
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/popup')
-rw-r--r-- | tests/auto/popup/tst_popup.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/auto/popup/tst_popup.cpp b/tests/auto/popup/tst_popup.cpp index 6f4a2e2e..39956301 100644 --- a/tests/auto/popup/tst_popup.cpp +++ b/tests/auto/popup/tst_popup.cpp @@ -58,6 +58,7 @@ private slots: void closePolicy(); void activeFocusOnClose1(); void activeFocusOnClose2(); + void hover_data(); void hover(); }; @@ -331,8 +332,18 @@ void tst_popup::activeFocusOnClose2() QVERIFY(popup1->hasActiveFocus()); } +void tst_popup::hover_data() +{ + QTest::addColumn<bool>("modal"); + + QTest::newRow("modal") << true; + QTest::newRow("modeless") << false; +} + void tst_popup::hover() { + QFETCH(bool, modal); + QQuickApplicationHelper helper(this, QStringLiteral("hover.qml")); QQuickApplicationWindow *window = helper.window; window->show(); @@ -341,6 +352,7 @@ void tst_popup::hover() QQuickPopup *popup = helper.window->property("popup").value<QQuickPopup*>(); QVERIFY(popup); + popup->setModal(modal); QQuickButton *parentButton = helper.window->property("parentButton").value<QQuickButton*>(); QVERIFY(parentButton); @@ -357,7 +369,7 @@ void tst_popup::hover() // hover the parent button outside the popup QTest::mouseMove(window, QPoint(window->width() - 1, window->height() - 1)); - QVERIFY(parentButton->isHovered()); + QCOMPARE(parentButton->isHovered(), !modal); QVERIFY(!childButton->isHovered()); // hover the popup background |