QMenu is receiving the mouseReleaseEvent, but is doing nothing with it.
d->mouseDown != this resolves to true so
d->mouseDown = 0;
return;
d->mouseDown = 0;
return;
To copy to clipboard, switch view to plain text mode
is being run.
Here is QMenu::mouseReleaseEvent (see qmenu.cpp):
{
if (d->aboutToHide || d->mouseEventTaken(e))
return;
if(d->mouseDown != this) {
d->mouseDown = 0;
return;
}
d->mouseDown = 0;
d->setSyncAction();
QAction *action
= d
->actionAt
(e
->pos
());
if (action && action == d->currentAction) {
if (action->menu())
action->menu()->d_func()->setFirstActionActive();
else {
#if defined(Q_WS_WIN)
//On Windows only context menus can be activated with the right button
if (e->button() == Qt::LeftButton || d->topCausedWidget() == 0)
#endif
d
->activateAction
(action,
QAction::Trigger);
}
} else if (d->hasMouseMoved(e->globalPos())) {
d->hideUpToMenuBar();
}
}
void QMenu::mouseReleaseEvent(QMouseEvent *e)
{
Q_D(QMenu);
if (d->aboutToHide || d->mouseEventTaken(e))
return;
if(d->mouseDown != this) {
d->mouseDown = 0;
return;
}
d->mouseDown = 0;
d->setSyncAction();
QAction *action = d->actionAt(e->pos());
if (action && action == d->currentAction) {
if (action->menu())
action->menu()->d_func()->setFirstActionActive();
else {
#if defined(Q_WS_WIN)
//On Windows only context menus can be activated with the right button
if (e->button() == Qt::LeftButton || d->topCausedWidget() == 0)
#endif
d->activateAction(action, QAction::Trigger);
}
} else if (d->hasMouseMoved(e->globalPos())) {
d->hideUpToMenuBar();
}
}
To copy to clipboard, switch view to plain text mode
Does this mean that the menu thinks that it wasn't actually clicked? What does d->mouseDown actually represent?
Bookmarks