Results 1 to 2 of 2

Thread: Use ActionsContextMenu or contextMenuEvent

  1. #1
    Join Date
    Jun 2008
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Use ActionsContextMenu or contextMenuEvent

    Which do you use and why? What are the pros and cons?

    John.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Use ActionsContextMenu or contextMenuEvent

    I use Qt::ActionsContextMenu policy whenever possible because it's the simplest way to construct a static context menu. All you need to do is to add actions with QWidget::addAction() and the rest is done automatically. However, if the context menu needs to be dynamic for example depending on the position of the event, then I'm using Qt::DefaultContextMenu policy.
    J-P Nurmi

Similar Threads

  1. contextMenuEvent in QGraphicsItem
    By popai in forum Qt Programming
    Replies: 2
    Last Post: 17th August 2007, 09:13
  2. QTableView contextMenuEvent
    By derrickbj in forum Qt Programming
    Replies: 1
    Last Post: 1st March 2007, 16:37
  3. How to call contextMenuEvent on Qt::Key_F5?
    By rajesh in forum Qt Programming
    Replies: 5
    Last Post: 12th January 2007, 13:44
  4. QGraphicsView and contextMenuEvent
    By laurabee in forum Qt Programming
    Replies: 1
    Last Post: 12th October 2006, 22:22
  5. contextMenuEvent has issues since 4.1.3
    By momesana in forum Qt Programming
    Replies: 9
    Last Post: 31st May 2006, 17:27

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.