diff options
author | Andy Shaw <andy.shaw@qt.io> | 2020-09-15 08:49:29 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-09-15 12:47:55 +0000 |
commit | 59aaf903cc54a7cfba00ec3859ca59292f4cbf4a (patch) | |
tree | cca55bc7633f2abc49de7e37ec9e6a5cd2150cdd /tests | |
parent | 50f3c1b5551228d932f302a06580c70a3a77c336 (diff) |
Allow the preparation of the exit transition even if it did have focus
This amends 1a5a0a591c35dcf498a232a802087683f2244ecb so that it only sets
the hadActiveFocusBeforeExitTransition variable if it is false, ensuring
that it is correctly handled later on if it is true from before. This
handles a case of closing, opening and then closing again in one function
call.
Task-number: QTBUG-85884
Change-Id: Ied4ca33045b005f5f666e63d85fb603e9350d982
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit b0b11a6d4ae8a03998a5c84b91d9cb0b75387059)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_dialog.qml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_dialog.qml b/tests/auto/controls/data/tst_dialog.qml index 79053c13..6a4f10c9 100644 --- a/tests/auto/controls/data/tst_dialog.qml +++ b/tests/auto/controls/data/tst_dialog.qml @@ -417,6 +417,11 @@ TestCase { ApplicationWindow { property alias focusItemActiveFocus: item.activeFocus property alias focusDialogVisible: dialog.visible + function closeAndOpen() { + dialog.close() + dialog.open() + dialog.close() + } visible: true Item { id: item @@ -430,6 +435,12 @@ TestCase { if (!activeFocus) visible = false } + enter: Transition { + NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 10 } + } + exit: Transition { + NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 10 } + } } } } @@ -446,5 +457,12 @@ TestCase { window.focusDialogVisible = false tryCompare(window, "focusDialogVisible", false) tryCompare(window, "focusItemActiveFocus", true) + + window.focusDialogVisible = true + tryCompare(window, "focusDialogVisible", true) + tryCompare(window, "focusItemActiveFocus", false) + window.closeAndOpen() + tryCompare(window, "focusDialogVisible", false) + tryCompare(window, "focusItemActiveFocus", true) } } |