Results 1 to 2 of 2

Thread: contextmenu with MDI

  1. #1
    Join Date
    Nov 2006
    Posts
    23
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default contextmenu with MDI

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: contextmenu with MDI

    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.

  3. The following user says thank you to e8johan for this useful post:

    Thoosle (1st December 2006)

Similar Threads

  1. ListView Dynamic Popup menu
    By raphaelf in forum Newbie
    Replies: 3
    Last Post: 14th October 2006, 19:26
  2. MousePress Events on ContextMenu items
    By Naveen in forum Qt Programming
    Replies: 1
    Last Post: 22nd February 2006, 07:26
  3. ContextMenu
    By Naveen in forum Qt Programming
    Replies: 9
    Last Post: 21st February 2006, 10:54
  4. default contextMenu
    By Naveen in forum Qt Programming
    Replies: 1
    Last Post: 18th February 2006, 14:44

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.