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

Method mouseMoveEvent

Demo/WeltHideWindow.py:90–94  ·  view source on GitHub ↗

鼠标移动事件,动态调整窗口位置

(self, event)

Source from the content-addressed store, hash-verified

88 self._canMove = not self.isMaximized() or not self.isFullScreen()
89
90 def mouseMoveEvent(self, event):
91 """鼠标移动事件,动态调整窗口位置"""
92 super(WeltHideWindow, self).mouseMoveEvent(event)
93 if event.buttons() == Qt.LeftButton and self._canMove:
94 self.move(event.globalPos() - self._pos)
95
96 def mouseReleaseEvent(self, event):
97 """鼠标弹起事件,这个时候需要判断窗口的左边是否符合贴到左边,顶部,右边一半"""

Callers

nothing calls this directly

Calls 1

moveMethod · 0.80

Tested by

no test coverage detected