aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quickcontrols2
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2025-08-22 09:33:17 +0300
committerTarja Sundqvist <tarja.sundqvist@qt.io>2025-08-22 09:33:17 +0300
commitc6fdadd916a7568c1d71b750e054ca9aa2fd5dfc (patch)
treebbd5690b38a5e0df66dd070a9e9f42b0d1b2b673 /tests/auto/quickcontrols2
parenta7c766a9863605eb81e8f0cdb4d2b93e087b5bde (diff)
parente436dad999060b92965291b45c0e95a3b93f5866 (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')
-rw-r--r--tests/auto/quickcontrols2/controls/data/tst_control.qml30
-rw-r--r--tests/auto/quickcontrols2/qquickpopup/data/resetHoveredForItemsWithinOverlay.qml28
-rw-r--r--tests/auto/quickcontrols2/qquickpopup/tst_qquickpopup.cpp35
3 files changed, 93 insertions, 0 deletions
diff --git a/tests/auto/quickcontrols2/controls/data/tst_control.qml b/tests/auto/quickcontrols2/controls/data/tst_control.qml
index e12cbbf4ef..5103d9afd4 100644
--- a/tests/auto/quickcontrols2/controls/data/tst_control.qml
+++ b/tests/auto/quickcontrols2/controls/data/tst_control.qml
@@ -503,6 +503,36 @@ TestCase {
}
Component {
+ id: backgroundTest2
+ Button {
+ id: btn
+ width: 100
+ height: 100
+ topInset: 0
+ objectName: ""
+
+ background: Rectangle {
+ id: bg
+ implicitHeight: 80
+ border.color: "red"
+ y: btn.objectName === "aaa" ? 20 : 0
+ }
+ }
+ }
+
+ // QTBUG-120033: Make sure that the binding for y on the tab button's background doesn't get removed
+ function test_background2() {
+ let button = createTemporaryObject(backgroundTest2, testCase)
+ verify(button)
+
+ verify(button.background.y === 0)
+ button.objectName = "aaa"
+ verify(button.background.y === 20)
+ button.objectName = ""
+ verify(button.background.y === 0)
+ }
+
+ Component {
id: component2
T.Control {
id: item2
diff --git a/tests/auto/quickcontrols2/qquickpopup/data/resetHoveredForItemsWithinOverlay.qml b/tests/auto/quickcontrols2/qquickpopup/data/resetHoveredForItemsWithinOverlay.qml
new file mode 100644
index 0000000000..a7e66718ee
--- /dev/null
+++ b/tests/auto/quickcontrols2/qquickpopup/data/resetHoveredForItemsWithinOverlay.qml
@@ -0,0 +1,28 @@
+import QtQuick
+import QtQuick.Controls
+
+ApplicationWindow {
+ id: root
+ width: 100
+ height: 100
+ property alias controlsPopup: _controlsPopup
+ property alias blockInputPopup: _blockInputPopup
+ Popup {
+ id: _controlsPopup
+ width: parent.width
+ height: parent.height
+ modal: true
+ Control {
+ id: controls
+ anchors.fill: parent
+ hoverEnabled: true
+ contentItem: Text { text: "Test Control" }
+ }
+ }
+ Popup {
+ id: _blockInputPopup
+ width: parent.width
+ height: parent.height
+ modal: true
+ }
+}
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"