(self, event)
| 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() |