mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
* 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
This commit is contained in:
parent
098dc1f93b
commit
50b994b08f
@ -494,10 +494,10 @@ void GuiWorkArea::adjustViewWithScrollBar(int action)
|
||||
|
||||
bool GuiWorkArea::event(QEvent * e)
|
||||
{
|
||||
if (e->type() == QEvent::ToolTip) {
|
||||
switch (e->type()) {
|
||||
case QEvent::ToolTip: {
|
||||
QHelpEvent * helpEvent = static_cast<QHelpEvent *>(e);
|
||||
if (!lyxrc.use_tooltip)
|
||||
return QAbstractScrollArea::event(e);
|
||||
if (lyxrc.use_tooltip) {
|
||||
QPoint pos = helpEvent->pos();
|
||||
if (pos.x() < viewport()->width()) {
|
||||
QString s = toqstr(buffer_view_->toolTip(pos.x(), pos.y()));
|
||||
@ -506,8 +506,15 @@ bool GuiWorkArea::event(QEvent * e)
|
||||
else
|
||||
QToolTip::hideText();
|
||||
}
|
||||
// Don't forget to accept the event!
|
||||
e->accept();
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
return QAbstractScrollArea::event(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void GuiWorkArea::contextMenuEvent(QContextMenuEvent * e)
|
||||
|
Loading…
Reference in New Issue
Block a user