aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_popup.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-08-31 17:32:28 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-09-02 07:26:41 +0000
commitf59e5d7bbd17c79ca2f06d79897212a5fc9b6ee7 (patch)
tree9a59d22c80b1adf2e014a6b9ca3709a2ad142459 /tests/auto/controls/data/tst_popup.qml
parent0e01d1d979fd747671512b2c4e987d1f8cb3c019 (diff)
Popup: respect dynamic dim & modal changes
What comes to the visual background dimming, popups did not respect dynamic 'dim' or 'modal' property changes. This was half-intentional, because it was thought an unrealistic use-case to toggle these while the popup is visible. As a result, the background dimming was missing if a popup was made visible in a declarative way, and either 'dim' or 'modal' was evaluated after the popup was already visible. Task-number: QTBUG-54797 Change-Id: Icfb171e619540fef2d91908867b702790cde6c32 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_popup.qml')
-rw-r--r--tests/auto/controls/data/tst_popup.qml10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml
index 72cd6999..2c6d60da 100644
--- a/tests/auto/controls/data/tst_popup.qml
+++ b/tests/auto/controls/data/tst_popup.qml
@@ -1124,17 +1124,23 @@ TestCase {
tryCompare(window.plainPopup, "visible", true)
compare(window.overlay.children.length, countBefore + 1) // only popup added, no overlays involved
+ window.plainPopup.modal = true
+ compare(window.overlay.children.length, countBefore + 2) // overlay added
+
window.plainPopup.close()
tryCompare(window.plainPopup, "visible", false)
- compare(window.overlay.children.length, countBefore) // only popup removed, no overlays involved
+ compare(window.overlay.children.length, countBefore) // popup + overlay removed
window.modalPopupWithoutDim.open()
tryCompare(window.modalPopupWithoutDim, "visible", true)
compare(window.overlay.children.length, countBefore + 1) // only popup added, no overlays involved
+ window.modalPopupWithoutDim.dim = true
+ compare(window.overlay.children.length, countBefore + 2) // overlay added
+
window.modalPopupWithoutDim.close()
tryCompare(window.modalPopupWithoutDim, "visible", false)
- compare(window.overlay.children.length, countBefore) // only popup added, no overlays involved
+ compare(window.overlay.children.length, countBefore) // popup + overlay removed
window.destroy()
}