Don't hide QToolTip automatically when another window is closed
QTipLabel has a global application event filter, looking for reasons to close the tooltip. To fix QTBUG-55523 an additional condition was added inbb107c18cb4f83to also close the tooltip when intercepting QEvent::Close, but this was unnecessary, as the fix in29205c53e4was sufficient. Furthermore, hiding the tooltip on close events turned out to cause issues when the closing widget/window was the tooltip itself, causing recursion. This was fixed by24239aef35. (which unintentionally also changed behavior for WindowActivate, WindowDeactivate, FocusIn, and FocusOut due to the case fallthrough). As it turns out, there is another case that will close the tooltip prematurely, and that's when the Qt::UI_AnimateTooltip effect is enabled, which is the case on e.g. Windows. In that situation a QRollEffect widget is created for the duration of the effect, which is then closed after the effect finishes. When closing the effect via QWidget close, we'll end up with a close event, triggering QTipLabel to hide itself. Since the logic of hiding the tooltip when other windows close was never needed to fix the original issue in QTBUG-55523, we opt to remove it completely, instead of adding even more heuristics to the code. Task-number: QTBUG-55523 Change-Id: I8d341262c85fd2e8cf9c496974e46ae0e9245e5c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
parent
e346b9524c
commit
1093562d08
|
|
@ -342,13 +342,6 @@ bool QTipLabel::eventFilter(QObject *o, QEvent *e)
|
|||
case QEvent::FocusIn:
|
||||
case QEvent::FocusOut:
|
||||
#endif
|
||||
case QEvent::Close:
|
||||
// For QTBUG-55523 (QQC) specifically: Hide tooltip when windows are closed,
|
||||
// unless the close event is for the this tooltip, in which case we don't
|
||||
// recursively hide/close again.
|
||||
if (o != windowHandle() && o != this)
|
||||
hideTipImmediately();
|
||||
break;
|
||||
case QEvent::MouseButtonPress:
|
||||
case QEvent::MouseButtonRelease:
|
||||
case QEvent::MouseButtonDblClick:
|
||||
|
|
|
|||
Loading…
Reference in New Issue