Results 1 to 2 of 2

Thread: Context Menu

  1. #1
    Join Date
    Sep 2008
    Posts
    18
    Thanks
    12
    Qt products
    Qt4
    Platforms
    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
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    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

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.