8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 from PyQt5.QtCore import pyqtSignal, Qt, QSignalMapper, QFileInfo, QEvent, \ |
12 from PyQt5.QtCore import pyqtSignal, Qt, QSignalMapper, QFileInfo, QEvent, \ |
13 QRectF, qVersion |
13 QRectF |
14 from PyQt5.QtWidgets import QGraphicsView, QAction, QToolBar, QDialog |
14 from PyQt5.QtWidgets import QGraphicsView, QAction, QToolBar, QDialog |
15 from PyQt5.QtPrintSupport import QPrinter, QPrintDialog |
15 from PyQt5.QtPrintSupport import QPrinter, QPrintDialog |
16 |
16 |
17 from E5Graphics.E5GraphicsView import E5GraphicsView |
17 from E5Graphics.E5GraphicsView import E5GraphicsView |
18 |
18 |
599 Protected method to handle wheel events. |
600 Protected method to handle wheel events. |
600 |
601 |
601 @param evt reference to the wheel event (QWheelEvent) |
602 @param evt reference to the wheel event (QWheelEvent) |
602 """ |
603 """ |
603 if evt.modifiers() & Qt.ControlModifier: |
604 if evt.modifiers() & Qt.ControlModifier: |
604 if qVersion() >= "5.0.0": |
605 if qVersionTuple() >= (5, 0, 0): |
605 delta = evt.angleDelta().y() |
606 delta = evt.angleDelta().y() |
606 else: |
607 else: |
607 delta = evt.delta() |
608 delta = evt.delta() |
608 if delta < 0: |
609 if delta < 0: |
609 self.zoomOut() |
610 self.zoomOut() |