diff options
| author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2025-08-22 09:33:17 +0300 |
|---|---|---|
| committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2025-08-22 09:33:17 +0300 |
| commit | c6fdadd916a7568c1d71b750e054ca9aa2fd5dfc (patch) | |
| tree | bbd5690b38a5e0df66dd070a9e9f42b0d1b2b673 /tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp | |
| parent | a7c766a9863605eb81e8f0cdb4d2b93e087b5bde (diff) | |
| parent | e436dad999060b92965291b45c0e95a3b93f5866 (diff) | |
Merge tag 'v6.2.13-lts' into tqtc/lts-6.2-opensourcev6.2.13-lts-lgpl6.2
Qt 6.2.13-lts release
Conflicts solved:
dependencies.yaml
Change-Id: I3cbe1ce4293179888e236dd1a3a299cd2c66c950
Diffstat (limited to 'tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp')
| -rw-r--r-- | tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp b/tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp index a587c085a4..2895ac4a83 100644 --- a/tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp +++ b/tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp @@ -121,6 +121,7 @@ private slots: void shrinkPopupThatWasLargerThanWindow(); void mirroredCombobox(); void rotatedCombobox(); + void resetHoveredStateForItemsWithinPopup(); private: static bool hasWindowActivation(); @@ -2038,6 +2039,40 @@ void tst_QQuickPopup::rotatedCombobox() } } +void tst_QQuickPopup::resetHoveredStateForItemsWithinPopup() +{ + QQuickControlsApplicationHelper helper(this, "resetHoveredForItemsWithinOverlay.qml"); + QVERIFY2(helper.ready, helper.failureMessage()); + + QQuickWindow *window = helper.window; + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window)); + + QQuickPopup *controlsPopup = window->property("controlsPopup").value<QQuickPopup*>(); + QVERIFY(controlsPopup); + + QQuickPopup *blockInputPopup = window->property("blockInputPopup").value<QQuickPopup*>(); + QVERIFY(controlsPopup); + + controlsPopup->open(); + QTRY_VERIFY(controlsPopup->isOpened()); + + QTest::mouseMove(window, QPoint(window->width() / 2 + 2, window->height() / 2 + 2)); + QTest::mouseMove(window, QPoint(window->width() / 2, window->height() / 2)); + + auto *controlItem = qobject_cast<QQuickControl *>(controlsPopup->contentItem()->childItems().at(0)); + QVERIFY(controlItem); + // Check hover enabled for the control item within the popup + QTRY_VERIFY(controlItem->isHovered()); + + // Open the modal popup window over the existing control item + blockInputPopup->open(); + QTRY_VERIFY(blockInputPopup->isOpened()); + + // Control item hovered shall be disabled once we open the modal popup + QTRY_VERIFY(!controlItem->isHovered()); +} + QTEST_QUICKCONTROLS_MAIN(tst_QQuickPopup) #include "tst_qquickpopup.moc" |
