PDA

View Full Version : Modify a ContextMenu



smarinr
10th May 2008, 01:25
Guys,
this one i'm not sure if it is easy...

See please the attachmment.

Somebody say to me that the menu I show is the contextMenu. By some reason if I set setWindowFlags(Qt::FramelessWindowHint) like this, the contextMenu is being disable on my application.

if somebody can let me see code or explain a little bit better HOW I DO THAT OVERRIDE of the contextMenu or if I'm wrong and that menu is not the contextMenu

thanks so much and hoping somebody show me a little bit of light :crying:

wysota
10th May 2008, 08:40
Why do you want to set a frameless window hint? The context menu is frameless out of the box. Try executing this snippet:

QMenu menu;
menu.addAction("xyz");
menu.addAction("abc");
menu.exec(QCursor::pos());

smarinr
10th May 2008, 17:31
Why do you want to set a frameless window hint?

is because im trying to bring up a dialog but my application when I bring it on, the dialog show me the frame and because of how the app looks like, is not elegant to see the frame up and disappear.... so... i just more for UI looks a little bit nice

wysota
10th May 2008, 17:33
What does the context menu have to do with it?

smarinr
10th May 2008, 17:36
I forgot to tell you somethiing

when you set the setWindowFlag to be frameless that context menu dont shows up when you right click on the app on the taskbar

its suppose to be very simple: restore, maximized, minimized and close

wysota
10th May 2008, 17:41
That's because your window manager ignores frameless windows - it doesn't manage them. Try finding a solution to your problem that doesn't involve frameless windows. Or live with an unmanaged window.