def mouseDoubleClickEvent(self, event): sc_pos = self.mapToScene(event.pos()) if self.zoomSelect or self.panSelect: self.zoom_data = [] self.fitInView(self.sceneRect(), Qt.KeepAspectRatio) self.afterDoubleClick.emit(sc_pos.x(), sc_pos.y()) QGraphicsView.mouseDoubleClickEvent(self, event)
def mouseDoubleClickEvent(self, event): QGraphicsView.mouseDoubleClickEvent(self, event) scenePos = self.mapToScene(event.pos()) if event.button() == Qt.LeftButton: self.centerOn(scenePos.x(), scenePos.y()) if event.button() == Qt.RightButton: self.fitWindow()
def mouseDoubleClickEvent(self, event): """ Show entire image. """ if self.npImage is not None: scenePos = self.mapToScene(event.pos()) if event.button() == Qt.LeftButton: # Reset zoom: self.performZoom(1.0 / self.zoomFactor, event) self.zoomStack = [] # Clear zoom stack. self.zoomFactor = 1.0 #self.leftMouseButtonDoubleClicked.emit(scenePos.x(), #scenePos.y()) elif event.button() == Qt.RightButton: #if self.canZoom: # self.zoomStack = [] # Clear zoom stack. # self.updateViewer() #self.rightMouseButtonDoubleClicked.emit(scenePos.x(), #scenePos.y()) # Reset window/level: if self.npImage is not None: #self.winMin = np.amin(self.npImage.astype(np.float32)) #self.winMax = np.amax(self.npImage.astype(np.float32)) self.winMin = np.percentile( self.npImage.astype(np.float32), 0.02) self.winMax = np.percentile( self.npImage.astype(np.float32), 100 - 0.03) self._updateImageLUT() QGraphicsView.mouseDoubleClickEvent(self, event)
def mouseDoubleClickEvent(self, event): # scenePos = self.mapToScene(event.pos()) if event.button() == Qt.LeftButton: self._fit = True self.updateViewer() # self.leftMouseButtonDoubleClicked.emit(scenePos.x(), scenePos.y()) # elif event.button() == Qt.RightButton: # self.rightMouseButtonDoubleClicked.emit(scenePos.x(), scenePos.y()) QGraphicsView.mouseDoubleClickEvent(self, event)
def mouseDoubleClickEvent(self, event): """ Show entire image. """ scenePos = self.mapToScene(event.pos()) if event.button() == Qt.LeftButton: self.leftMouseButtonDoubleClicked.emit(scenePos.x(), scenePos.y()) elif event.button() == Qt.RightButton: self.zoom_all_out() self.rightMouseButtonDoubleClicked.emit(scenePos.x(), scenePos.y()) QGraphicsView.mouseDoubleClickEvent(self, event)
def mouseDoubleClickEvent(self, event): """ Show entire image. """ scenePos = self.mapToScene(event.pos()) if event.button() == Qt.LeftButton: self.leftMouseButtonDoubleClicked.emit(scenePos.x(), scenePos.y()) elif event.button() == Qt.RightButton: if self.canZoom: self.zoomStack = [] # Clear zoom stack. self.updateViewer() self.rightMouseButtonDoubleClicked.emit(scenePos.x(), scenePos.y()) QGraphicsView.mouseDoubleClickEvent(self, event)
def mouseDoubleClickEvent(self, event): """Reset zoom - left: default image size - right: fit image """ # memorize current mouse position on image self.__mousePos = self.mapToScene(event.pos()) if event.button() == Qt.LeftButton: if self.zoom() == 1: # scale 1:1 => zoom to fit self.setZoom(0.0) else: # scale is not 1:1 => scale to 1 self.setZoom(1.0) self.leftButtonDoubleClicked.emit(self.__mousePos.x(), self.__mousePos.y()) QGraphicsView.mouseDoubleClickEvent(self, event)
def mouseDoubleClickEvent(self, event): QGraphicsView.mouseDoubleClickEvent(self, event)