def mousePressEvent(self, e: QMouseEvent): BlockManager.deselect_all() if e.button() == Qt.LeftButton: self.__moving = True self.__origin = e.pos() self.setCursor(Qt.DragMoveCursor) elif e.button() == Qt.RightButton: self.show_popup(e.pos())
def mousePressEvent(self, e: QMouseEvent): self.__block.select() n = self._check_nodes(e.pos()) if n is not None: print('Node found') return if e.button() == Qt.LeftButton: if self._resizable: if self._check_corner(e.pos()) and self._check_action(Action.RESIZE): self.__origin = e.pos() self.__action = Action.RESIZE self.setCursor(Qt.SizeFDiagCursor) return if self._check_action(Action.DRAG): self.__origin = e.pos() self.__action = Action.DRAG self.setCursor(Qt.DragMoveCursor)
def mousePressEvent(self, e: QMouseEvent): self.__block.select() n = self._check_nodes(e.pos()) if n is not None: print('Node found') return if e.button() == Qt.LeftButton: if self._resizable: if self._check_corner(e.pos()) and self._check_action( Action.RESIZE): self.__origin = e.pos() self.__action = Action.RESIZE self.setCursor(Qt.SizeFDiagCursor) return if self._check_action(Action.DRAG): self.__origin = e.pos() self.__action = Action.DRAG self.setCursor(Qt.DragMoveCursor)
def mouseDoubleClickEvent(self, e: QMouseEvent): BlockManager.deselect_all() if e.button() == Qt.LeftButton: self.__moving = False self.__translation = QPoint() self.translate(0, 0)
def mousePressEvent(self, e: QMouseEvent): if e.x() <= 12 and 9 <= e.y() <= 31 and e.button() == Qt.LeftButton: self.__drag = True self.repaint() else: self.__drag = False