in the mousePressEvent
chk for the mouse button,
if(event->button()==Qt::Rightbutton)
and add the event
in the mousePressEvent
chk for the mouse button,
if(event->button()==Qt::Rightbutton)
and add the event
Actually, there's a specialized handler for context menu, namely QWidget::contextMenuEvent(). The actions required to open context menus vary between platforms; for example, on Windows, pressing the menu button or clicking the right mouse button will cause this event to be sent. QWidget::mousePressEvent() would only cover the latter case.
J-P Nurmi
Bookmarks