def mouseMoveEvent(self, event: Qt.QMouseEvent): if self.dragging: scale_factor = self.scale / self.fig.get_dpi() self.center[0] -= (event.x() - self.drag_start[0]) * scale_factor self.center[1] += (event.y() - self.drag_start[1]) * scale_factor self.drag_start = (event.x(), event.y()) self.do_update = True # self.update_plot() self.center_changed.emit(self.center)
def mouseMoveEvent(self, event: Qt.QMouseEvent) -> None: super().mouseMoveEvent(event) for toolbar, notches in self.toolbars_notches.items(): if not toolbar.is_notches_visible(): continue for notch in notches: line = notch.line if line.x1() - 0.5 <= event.x() <= line.x1() + 0.5: Qt.QToolTip.showText(event.globalPos(), notch.label) return
def mousePressEvent(self, event: Qt.QMouseEvent): if event.buttons() & QtCore.Qt.MiddleButton: self.dragging = True self.drag_start = (event.x(), event.y())