PDA

View Full Version : contextmenu with MDI



Thoosle
1st December 2006, 07:15
I'm writing an app with a QWorkspace in the mainWindow. I've constructed a contextmenu in the mainWindow and this pops up whenever I right click in the workspace area. However, the workspace is intended to be populated by child widgets but the problem is, whenever I right click on them I can't get the contextmenu to come up. I've tried setting the contexMenuPolicy in the child widgets to Qt::NoContextMenu but this doesn't seem to defer context menu handling to the parent....as I thought it would. I imagine that I could create this context menu/actions etc in the child widget code and get it to work that way but, I"ve got this feeling that there is something easier and more direct/correct. Anyone have thoughts on this?

Thanks

e8johan
1st December 2006, 07:29
Get the child widgets to emit a signal when the context menu is to be shown. Connect that signal to your main window's context menu showing slot.