diff options
| author | Mitch Curtis <mitch.curtis@qt.io> | 2025-07-11 10:59:52 +0800 |
|---|---|---|
| committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2025-07-29 08:21:53 +0000 |
| commit | 0f31c9d3a4e62f53df44a4dd69a004c6ad1d9b8e (patch) | |
| tree | 7c8ed59bd105f43aaa6355a0f00e5dab0979a4a8 | |
| parent | c1fb1abc33e52c3d1d6bb8a47301dbe6971a2708 (diff) | |
tst_qquickmaterialstyle: add test for popup propagation to child item
As a sanity check to confirm that this works for a related follow-up
patch.
Change-Id: Ic62c19ba33bd24f0855a224d8120a9b4a324bc9b
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 38f5e4ad4732c2f01df91ba4550e1ebb3320ad14)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1dc8edde4370da415f4fe6e57893c6bbf78f2abe)
(cherry picked from commit f8422cbccd4576a08db0ac4ad068ec16831f9ce4)
(cherry picked from commit b155032acf0ec13fcd6ea24e098af5b82d21cc33)
| -rw-r--r-- | tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml b/tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml index 69a2d95ab3..862aa15488 100644 --- a/tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml +++ b/tests/auto/quickcontrols/qquickmaterialstyle/data/tst_material.qml @@ -1325,4 +1325,33 @@ TestCase { tryCompare(busyIndicator.contentItem, "visible", true) } + + Component { + id: labelInPopupComponent + + Popup { + id: popupInstance + + property alias label: label + + Material.theme: Material.Dark + + Label { + id: label + text: "Should have a dark theme" + } + } + } + + function test_popupPropagatesToChildItem() { + let popup = createTemporaryObject(labelInPopupComponent, testCase) + verify(popup) + + compare(popup.Material.theme, Material.Dark) + compare(popup.label.Material.theme, Material.Dark) + + popup.Material.theme = Material.Light + compare(popup.Material.theme, Material.Light) + compare(popup.label.Material.theme, Material.Light) + } } |
