This is a consequence of
e91572a0, although it is not clear why. The
contextMenuEvent code of the workarea should not delegate context
menu when it cannot honor it.
Also fix a small memory leak.
Fixes bug #10616.
void GuiView::toolBarPopup(const QPoint & /*pos*/)
{
- QMenu * menu = new QMenu;
- menu = guiApp->menus().menu(toqstr("context-toolbars"), * this);
+ QMenu * menu = guiApp->menus().menu(toqstr("context-toolbars"), * this);
menu->exec(QCursor::pos());
}
}
if (name.empty()) {
- QAbstractScrollArea::contextMenuEvent(e);
+ e->accept();
return;
}
// always show mnemonics when the keyboard is used to show the context menu
bool const keyboard = (e->reason() == QContextMenuEvent::Keyboard);
QMenu * menu = guiApp->menus().menu(toqstr(name), *d->lyx_view_, keyboard);
if (!menu) {
- QAbstractScrollArea::contextMenuEvent(e);
+ e->accept();
return;
}
// Position the menu to the right.