PDA

View Full Version : context menu problem



dreamer
22nd May 2008, 23:29
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?

jpn
25th May 2008, 13:18
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.