MCPcopy
hub / github.com/PyQt5/PyQt / contextMenuEvent

Method contextMenuEvent

QPropertyAnimation/MenuAnimation.py:29–37  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

27 self.initAnimation()
28
29 def contextMenuEvent(self, event):
30 pos = event.globalPos()
31 size = self._contextMenu.sizeHint()
32 x, y, w, h = pos.x(), pos.y(), size.width(), size.height()
33 self._animation.stop()
34 self._animation.setStartValue(QRect(x, y, 0, 0))
35 self._animation.setEndValue(QRect(x, y, w, h))
36 self._animation.start()
37 self._contextMenu.exec_(event.globalPos())
38
39 def hello(self):
40 QApplication.instance().aboutQt()

Callers

nothing calls this directly

Calls 7

yMethod · 0.80
sizeHintMethod · 0.45
xMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45
stopMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected