right click signal in PyQt/PySide
by eks on Jun.10, 2014, under Maya, MotionBuilder, pyqt, pyside, python
It’s extremely easy, if you know it’s called customContextMenuRequested:
http://qt-project.org/doc/qt-4.8/qwidget.html#customContextMenuRequested
As for example:
btnLeft.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) btnLeft.customContextMenuRequested.connect( lambda: self.RMB(btnLeft, oModel) )
It also has QPoint as default value returning the pixel where right click/contextMenu was requested:
btnLeft.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) btnLeft.customContextMenuRequested.connect( self.asd ) def asd(self, pos) print pos
Warning: count(): Parameter must be an array or an object that implements Countable in /home/public/wp-includes/class-wp-comment-query.php on line 388