Asked the same question in another qt forum, trying this one as well...
Working on a project http://code.google.com/p/subdms/ where I'm using pyqt4 for creating the user interface. I think my question is a general Qt-question the fact that I'm using pyqt4 does not matter.
I have a question regarding positioning of a right-click menu. I can't for my life get the menu to popup on the lower right side of the mouse pointer, instead it is positioned dead center under the mouse pointer. How do I get the the correct positioning of the menu?
Here is the code snipet. Guess that mapToGlobal should be something else, or something more added to this statement.
self.connect(self.ui.documentlist, \
QtCore.SIGNAL('customContextMenuRequested(const QPoint &)'), \
self.showrightclickmenu)
def showrightclickmenu(self, coord):
coord = self.mapToGlobal(coord)
self.ui.menuTools.popup(coord)
self.connect(self.ui.documentlist, \
QtCore.SIGNAL('customContextMenuRequested(const QPoint &)'), \
self.showrightclickmenu)
def showrightclickmenu(self, coord):
coord = self.mapToGlobal(coord)
self.ui.menuTools.popup(coord)
To copy to clipboard, switch view to plain text mode
Thanks for your help, I'm really stuck on this one.
Bookmarks