def mouseReleaseEvent(self, event: QMouseEvent):
if self.scene() is None:
return
cursor = self.cursor().shape()
if cursor == Qt.ClosedHandCursor:
self.grab_start = None
self.setCursor(Qt.OpenHandCursor)
elif self.separation_area_moving:
y_sep = self.mapToScene(event.pos()).y()
y = self.sceneRect().y()
h = self.sceneRect().height()
if y_sep < y:
y_sep = y
elif y_sep > y + h:
y_sep = y + h
self.scene().draw_sep_area(y_sep)
self.sep_area_moving.emit(y_sep)
self.separation_area_moving = False
self.y_sep = y_sep
self.sep_area_changed.emit(-y_sep)
self.unsetCursor()
self.selection_area.finished = True
self.selection_area.resizing = False
self.emit_selection_size_changed()
self.emit_selection_start_end_changed()
评论列表
文章目录