DavidY
19th December 2009, 21:13
I have a custom widget which reimplements QMainWindow. It has a statusbar and menubar and the main window area between. I want a context menu to appear in the main area when right clicked but not if the right click is on the status bar or menubar. How do I exclude them? I was thinking of checking the position of the click and seeing if that was within the allowed area but I'm not sure how.
Right now I'm using this:
void Window::contextMenuEvent(QContextMenuEvent *event){
contextMenu->exec(event->globalPos());
}
But it gives me a context menu everywhere
Thanks
Right now I'm using this:
void Window::contextMenuEvent(QContextMenuEvent *event){
contextMenu->exec(event->globalPos());
}
But it gives me a context menu everywhere
Thanks