From 50b994b08fa0b5d90cb30a16fc56e2c1389b01eb Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 10 Jan 2008 08:19:54 +0000 Subject: [PATCH] * GuiWorkArea::event(): - case ToolTip: don't forget to accept the event! - Clean up the method in order to extend to other events. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22473 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiWorkArea.cpp | 33 +++++++++++++++++++------------ 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 6c9d7cf41d..7fc2b66961 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -494,19 +494,26 @@ void GuiWorkArea::adjustViewWithScrollBar(int action) bool GuiWorkArea::event(QEvent * e) { - if (e->type() == QEvent::ToolTip) { - QHelpEvent * helpEvent = static_cast(e); - if (!lyxrc.use_tooltip) - return QAbstractScrollArea::event(e); - QPoint pos = helpEvent->pos(); - if (pos.x() < viewport()->width()) { - QString s = toqstr(buffer_view_->toolTip(pos.x(), pos.y())); - QToolTip::showText(helpEvent->globalPos(), s); - } - else - QToolTip::hideText(); - } - return QAbstractScrollArea::event(e); + switch (e->type()) { + case QEvent::ToolTip: { + QHelpEvent * helpEvent = static_cast(e); + if (lyxrc.use_tooltip) { + QPoint pos = helpEvent->pos(); + if (pos.x() < viewport()->width()) { + QString s = toqstr(buffer_view_->toolTip(pos.x(), pos.y())); + QToolTip::showText(helpEvent->globalPos(), s); + } + else + QToolTip::hideText(); + } + // Don't forget to accept the event! + e->accept(); + return true; + } + default: + return QAbstractScrollArea::event(e); + } + return false; }