[Solved] QAction - how to distinguish middle click
-
-
Thanks for tip. Will test it and post results.
EDIT: Thanks very much, it worked like charm :-)
If someone want to see the code, there it is (I also subclassed QAction to support middleClicked() signal)
@
void Menu::mouseReleaseEvent(QMouseEvent e)
{
Action act = qobject_cast<Action*> (actionAt(e->pos()));if (!act) { QMenu::mouseReleaseEvent(e); return; } if (e->button() == Qt::LeftButton) { act->trigger(); close(); e->accept(); } else if (e->button() == Qt::MiddleButton) { act->triggerMiddleClick(); close(); e->accept(); }
}
@