From ea057c83720abd0c3c57d9dab91a5ad704b158d3 Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Mon, 17 Mar 2014 12:04:40 +0100 Subject: QNX: Fix QToolTip The problem is that on QNX the window activation and focus events are delayed. QToolTip can not handle this and would hide the tool tip right after it is created. Change-Id: I6045d1d277b73508c24174d72a05e0baa4ae6e7f Reviewed-by: Rafael Roquetto --- src/widgets/kernel/qtooltip.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/widgets/kernel/qtooltip.cpp') diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index c898f56015..5aea55e196 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -322,13 +322,32 @@ bool QTipLabel::eventFilter(QObject *o, QEvent *e) case QEvent::Leave: hideTip(); break; + + +#if defined (Q_OS_QNX) // On QNX the window activate and focus events are delayed and will appear + // after the window is shown. + case QEvent::WindowActivate: + case QEvent::FocusIn: + return false; + case QEvent::WindowDeactivate: + if (o != this) + return false; + hideTipImmediately(); + break; + case QEvent::FocusOut: + if (reinterpret_cast(o) != windowHandle()) + return false; + hideTipImmediately(); + break; +#else case QEvent::WindowActivate: case QEvent::WindowDeactivate: + case QEvent::FocusIn: + case QEvent::FocusOut: +#endif case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: case QEvent::MouseButtonDblClick: - case QEvent::FocusIn: - case QEvent::FocusOut: case QEvent::Wheel: hideTipImmediately(); break; -- cgit v1.2.3