[PyQt] contextMenuEvent clashing

Prashant Saxena animator333 at yahoo.com
Fri Oct 9 07:08:10 BST 2009


I am sub classing QGraphicsView & QGraphicsItem.

I do have a contextMenuEvent in both of them. How ever while right clicking on item creates the menu of view. It's not creating the menu defined in item.

If I disable the menu of view, item's menu is working fine.

How do I ignore this clashing?

Here is code of Item's contextMenuEvent

def contextMenuEvent(self, event):
        menu = QtGui.QMenu()
        menu.addAction("Copy")
        menu.addAction("Paste")
        menu.exec_(event.screenPos())

Code of view's contextMenuEvent
    
def contextMenuEvent(self, event):
    menu = .....
    .....
    menu.exec_(event.globalPos())


Prashant


qt-sdk-win-opensource-2009.03.1.exe
Python 2.6.3
PyQt-Py2.6-gpl-4.6-1
Win XP, 32 Bit 



      Yahoo! India has a new look. Take a sneak peek http://in.yahoo.com/trynew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20091009/44fd53cd/attachment.html


More information about the PyQt mailing list