Results 1 to 2 of 2

Thread: context menu problem

  1. #1
    Join Date
    Feb 2008
    Posts
    102
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question context menu problem

    this is my situation:
    I have some QGraphicsItems that share the same context Menu(i pass them a pointer of context menu).......I'd like to add a specific action for each item; in details, i'd like to add a checkable QAction.
    When I check the action for an item, i will also see the action checked for the other items that weren't checked before.....(this behaviour is normal because i share the same context menu).

    So how can i get a reference to this checkable QAction(my items only have a pointer to the context menu(QMenu*)) , so i could check or uncheck it inside my object?

  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: context menu problem

    Perhaps you shouldn't deliver the same QMenu to all items but for example a list of common actions and construct the menu on the fly like in QGraphicsItem::contextMenuEvent() docs.
    J-P Nurmi

Similar Threads

  1. Context Menu on QTableWidget
    By ankurjain in forum Qt Programming
    Replies: 9
    Last Post: 17th December 2009, 09:52
  2. problem with menu entries for mdi windows
    By y.shan in forum Qt Programming
    Replies: 3
    Last Post: 18th September 2007, 07:48
  3. Replies: 4
    Last Post: 25th June 2007, 20:40
  4. QTreeWidget Context Menu
    By ^NyAw^ in forum Qt Programming
    Replies: 2
    Last Post: 11th May 2007, 11:24
  5. context menu advice
    By larry104 in forum Qt Programming
    Replies: 1
    Last Post: 4th October 2006, 07:55

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.