Results 1 to 4 of 4

Thread: [QMenu] Context menu for widget created in Qt Creator

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [QMenu] Context menu for widget created in Qt Creator

    That is one way... create your own custom widget and override the contextmenu event. From designer, you can promote the widget to your custom widget.

    The other way is -
    Set QWidget::setContextMenuPolicy to Qt::CustomContextMenu, and connect QWidget::customContextMenuRequested() signal to your handling class. and show the menu as you want in the global pos.

  2. The following user says thank you to aamer4yu for this useful post:

    Macok (4th March 2009)

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
  •  
Qt is a trademark of The Qt Company.