PDA

View Full Version : overriding the QWidget::contextMenuEvent



smarinr
9th May 2008, 17:44
I need a little bit of help

I need to override the contextMenuEvent but I dont know where to start.
the reason is because I need to set the actions of the context menu in a way that when I setWindowFlags to FramelessWindowHint dont show up.

If somebody knows any way to bring up the context menu with the flags up, please let me know

by the way: im a newbie at QT (thats why I need this dummy help hahaha)

P.D. Im using Qt 4.4

roxton
9th May 2008, 21:16
Make a new class with QWidget as a parent, then write your own "void contextMenuEvent ( QContextMenuEvent * event )" for that new class. The contextMenuEvent is a virtual function. So use the traditional C++ OOP technics.