diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-09-30 22:47:34 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-09-30 21:02:13 +0000 |
commit | e95dc3b4853c1736aef0ef2cc5248ec0aa46e3ff (patch) | |
tree | eaea0d060b943cfa429737e92cb4c9ba9e238c2a /tests/auto/controls/data/tst_tooltip.qml | |
parent | 38e876032834ab6d02b94a798fe2866a79757719 (diff) |
Cancel exit transition when the same tooltip is shown again
Task-number: QTBUG-54206
Task-number: QTBUG-54532
Change-Id: I7e4d993e3b1e30d7d7956629604f948dd1c85e32
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_tooltip.qml')
-rw-r--r-- | tests/auto/controls/data/tst_tooltip.qml | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_tooltip.qml b/tests/auto/controls/data/tst_tooltip.qml index b80a2cae..82ad01f1 100644 --- a/tests/auto/controls/data/tst_tooltip.qml +++ b/tests/auto/controls/data/tst_tooltip.qml @@ -188,4 +188,52 @@ TestCase { ignoreWarning("<Unknown File>:1:30: QML ToolTip: cannot find any window to open popup in.") object.ToolTip.show("") // don't crash (QTBUG-56243) } + + Component { + id: toolTipWithExitTransition + + ToolTip { + enter: Transition { + NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 100 } + } + exit: Transition { + NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 1000 } + } + } + } + + function test_makeVisibleWhileExitTransitionRunning_data() { + return [ + { tag: "imperative", imperative: true }, + { tag: "declarative", imperative: false } + ] + } + + function test_makeVisibleWhileExitTransitionRunning(data) { + var control = toolTipWithExitTransition.createObject(testCase) + + // Show, hide, and show the tooltip again. Its exit transition should + // start and get cancelled, and then its enter transition should run. + if (data.imperative) + control.open() + else + control.visible = true + tryCompare(control, "opacity", 1) + + if (data.imperative) + control.close() + else + control.visible = false + verify(control.exit.running) + wait(100) // TODO: replace with tryVerify() in 5.8 + verify(control.opacity < 1) + + if (data.imperative) + control.open() + else + control.visible = true + tryCompare(control, "opacity", 1) + + control.destroy() + } } |