PDA

View Full Version : mouse menu



mickey
28th April 2006, 11:16
hi, I'd like to visualize in my app a menu when I click mouseRightButton (like as window).
Must I construct it myself or there is any class?thanks

jacek
28th April 2006, 11:26
You must construct it yourself using QPopupMenu.

vratojr
28th April 2006, 11:35
Hi,you have to reimplement QWidget::mousePressEvent(QMouseEvent*) in order to pop up your menu when the right button il clicked.

wysota
28th April 2006, 11:52
Hi,you have to reimplement QWidget::mousePressEvent(QMouseEvent*) in order to pop up your menu when the right button il clicked.

No he doesn't. He has to reimplement QWidget::contextMenuEvent(QContextMenuEvent*). Remember that it doesn't have to be the RMB which triggers the event (for example if someone is left handed and has mouse buttons inverted).