From c1420ee5423dfa104d5ff87bc529b4530dc998d6 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 19 Feb 2020 12:56:20 +0100 Subject: ToolTip: fix timeout not activating if opened during exit transition When a tooltip with an exit transition and a timeout is made visible during its exit transition, it would end up not timing out. This is because the change in the tooltip's visibility is what usually kicks off the timeout timer, but if there is no change in visibility (because the exit transition hadn't finished, so the tooltip was still visible), this won't happen. Fix the issue by calling startTimeout() in QQuickToolTip::setVisible(). Change-Id: I5f95a698e48f376c7597558572ac91625a276e53 Fixes: QTBUG-81935 Reviewed-by: Andy Shaw --- src/quicktemplates2/qquicktooltip.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/quicktemplates2/qquicktooltip.cpp') diff --git a/src/quicktemplates2/qquicktooltip.cpp b/src/quicktemplates2/qquicktooltip.cpp index 9d733c94..8b61375e 100644 --- a/src/quicktemplates2/qquicktooltip.cpp +++ b/src/quicktemplates2/qquicktooltip.cpp @@ -252,9 +252,18 @@ void QQuickToolTip::setVisible(bool visible) { Q_D(QQuickToolTip); if (visible) { - if (!d->visible && d->delay > 0) { - d->startDelay(); - return; + if (!d->visible) { + // We are being made visible, and we weren't before. + if (d->delay > 0) { + d->startDelay(); + return; + } + } else { + // We are being made visible, even though we already were. + // We've probably been re-opened before our exit transition could finish. + // In that case, we need to manually start the timeout, as that is usually + // done in itemChange(), which won't be called in this situation. + d->startTimeout(); } } else { d->stopDelay(); -- cgit v1.2.3