Results 1 to 2 of 2

Thread: Context Menu

  1. #1
    Join Date
    Sep 2008
    Qt products
    MacOS X Windows

    Question Context Menu

    If you want to have several different objects that you can click on for a context menu unique to that item, is the context menu suppose to be part of that object (in the class definition)?

    Are the actions also part of the object? Or can you only have actions created in main()?

  2. #2
    Join Date
    Jan 2006
    Warsaw, Poland
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits

    Default Re: Context Menu

    You can create actions (and other objects) whenever you want. You can even create them when a menu handler is called and destroy them after the menu is closed. I wouldn't do that though, as I assume those actions can be useful also outside a context menu (for instance as icons in a toolbar).

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

    RY (2nd October 2008)

Similar Threads

  1. Custom QTreeWidgetItem context menu?
    By AaronMK in forum Qt Programming
    Replies: 4
    Last Post: 1st February 2010, 04:42
  2. Context Menu on QTableWidget
    By ankurjain in forum Qt Programming
    Replies: 9
    Last Post: 17th December 2009, 09:52
  3. QTable context menu
    By grabnerj in forum Qt Programming
    Replies: 1
    Last Post: 24th June 2008, 05:20
  4. context menu problem
    By dreamer in forum Qt Programming
    Replies: 1
    Last Post: 25th May 2008, 13:18
  5. Replies: 4
    Last Post: 25th June 2007, 20:40


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.