mirror of
https://github.com/vale981/rmview
synced 2025-03-05 09:11:39 -05:00
Fixing zoom actions
This commit is contained in:
parent
9258e2726d
commit
4670c29f7c
1 changed files with 12 additions and 4 deletions
|
@ -31,11 +31,11 @@ class QtImageViewer(QGraphicsView):
|
||||||
self.menu.addAction(act)
|
self.menu.addAction(act)
|
||||||
###
|
###
|
||||||
act = QAction('Zoom In', self)
|
act = QAction('Zoom In', self)
|
||||||
act.triggered.connect(lambda: self.scale(self.zoomInFactor, self.zoomInFactor))
|
act.triggered.connect(self.zoomIn)
|
||||||
self.menu.addAction(act)
|
self.menu.addAction(act)
|
||||||
###
|
###
|
||||||
act = QAction('Zoom Out', self)
|
act = QAction('Zoom Out', self)
|
||||||
act.triggered.connect(lambda: self.scale(self.zoomOutFactor, self.zoomOutFactor))
|
act.triggered.connect(self.zoomOut)
|
||||||
self.menu.addAction(act)
|
self.menu.addAction(act)
|
||||||
###
|
###
|
||||||
self.menu.addSeparator() # --------------------------
|
self.menu.addSeparator() # --------------------------
|
||||||
|
@ -160,6 +160,14 @@ class QtImageViewer(QGraphicsView):
|
||||||
self._rotation -= 90
|
self._rotation -= 90
|
||||||
self.updateViewer()
|
self.updateViewer()
|
||||||
|
|
||||||
|
def zoomIn(self):
|
||||||
|
self._fit = False
|
||||||
|
self.scale(self.zoomInFactor, self.zoomInFactor)
|
||||||
|
|
||||||
|
def zoomOut(self):
|
||||||
|
self._fit = False
|
||||||
|
self.scale(self.zoomOutFactor, self.zoomOutFactor)
|
||||||
|
|
||||||
def setFit(self, f):
|
def setFit(self, f):
|
||||||
self._fit = f
|
self._fit = f
|
||||||
self.updateViewer()
|
self.updateViewer()
|
||||||
|
@ -182,7 +190,7 @@ class QtImageViewer(QGraphicsView):
|
||||||
elif event.key() == Qt.Key_S:
|
elif event.key() == Qt.Key_S:
|
||||||
self.screenshot()
|
self.screenshot()
|
||||||
elif event.key() == Qt.Key_Plus:
|
elif event.key() == Qt.Key_Plus:
|
||||||
self.scale(self.zoomInFactor, self.zoomInFactor)
|
self.zoomIn()
|
||||||
elif event.key() == Qt.Key_Minus:
|
elif event.key() == Qt.Key_Minus:
|
||||||
self.scale(self.zoomOutFactor, self.zoomOutFactor)
|
self.zoomOut()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue