diff options
author | Fabian Bumberger <fbumberger@rim.com> | 2014-03-17 12:04:40 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-19 04:17:01 +0100 |
commit | ea057c83720abd0c3c57d9dab91a5ad704b158d3 (patch) | |
tree | ea3d38e07df2d1926479a1f26201b8eb05a4799a /src/widgets | |
parent | 634b9b1e5cf06be4fe77007dc7d3510a3ad46425 (diff) |
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 <rafael.roquetto@kdab.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/kernel/qtooltip.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
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<QWindow*>(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; |