248 |
248 |
249 def mousePressEvent(self, evt): |
249 def mousePressEvent(self, evt): |
250 """ |
250 """ |
251 Protected method to handle presses of a mouse button. |
251 Protected method to handle presses of a mouse button. |
252 |
252 |
253 @param evt reference to the mouse event (QMouseEvent) |
253 @param evt reference to the mouse event |
|
254 @type QMouseEvent |
254 """ |
255 """ |
255 if not self.__settingPosition: |
256 if not self.__settingPosition: |
256 clickedLabel = self.childAt(evt.position().toPoint()) |
257 clickedLabel = self.childAt(evt.position().toPoint()) |
257 if clickedLabel: |
258 if clickedLabel: |
258 clickedNotification = clickedLabel.parent() |
259 clickedNotification = clickedLabel.parent() |
268 |
269 |
269 def mouseReleaseEvent(self, evt): |
270 def mouseReleaseEvent(self, evt): |
270 """ |
271 """ |
271 Protected method to handle releases of a mouse button. |
272 Protected method to handle releases of a mouse button. |
272 |
273 |
273 @param evt reference to the mouse event (QMouseEvent) |
274 @param evt reference to the mouse event |
|
275 @type QMouseEvent |
274 """ |
276 """ |
275 if self.__settingPosition and evt.button() == Qt.MouseButton.LeftButton: |
277 if self.__settingPosition and evt.button() == Qt.MouseButton.LeftButton: |
276 self.setCursor(Qt.CursorShape.OpenHandCursor) |
278 self.setCursor(Qt.CursorShape.OpenHandCursor) |
277 |
279 |
278 def mouseMoveEvent(self, evt): |
280 def mouseMoveEvent(self, evt): |
279 """ |
281 """ |
280 Protected method to handle dragging the window. |
282 Protected method to handle dragging the window. |
281 |
283 |
282 @param evt reference to the mouse event (QMouseEvent) |
284 @param evt reference to the mouse event |
|
285 @type QMouseEvent |
283 """ |
286 """ |
284 if evt.buttons() & Qt.MouseButton.LeftButton: |
287 if evt.buttons() & Qt.MouseButton.LeftButton: |
285 self.move(evt.globalPosition().toPoint() - self.__dragPosition) |
288 self.move(evt.globalPosition().toPoint() - self.__dragPosition) |
286 evt.accept() |
289 evt.accept() |