7 Module implementing a dialog showing a SVG graphic. |
7 Module implementing a dialog showing a SVG graphic. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 from PyQt5.QtCore import Qt, QSize, QEvent, qVersion |
12 from PyQt5.QtCore import Qt, QSize, QEvent |
13 from PyQt5.QtGui import QPalette, QPainter, QFont, QColor |
13 from PyQt5.QtGui import QPalette, QPainter, QFont, QColor |
14 from PyQt5.QtWidgets import QSizePolicy, QScrollArea, QAction, QMenu, QToolBar |
14 from PyQt5.QtWidgets import QSizePolicy, QScrollArea, QAction, QMenu, QToolBar |
15 from PyQt5.QtPrintSupport import QPrinter, QPrintDialog |
15 from PyQt5.QtPrintSupport import QPrinter, QPrintDialog |
16 from PyQt5.QtSvg import QSvgWidget |
16 from PyQt5.QtSvg import QSvgWidget |
17 |
17 |
155 Protected method to handle wheel events. |
156 Protected method to handle wheel events. |
156 |
157 |
157 @param evt reference to the wheel event (QWheelEvent) |
158 @param evt reference to the wheel event (QWheelEvent) |
158 """ |
159 """ |
159 if evt.modifiers() & Qt.ControlModifier: |
160 if evt.modifiers() & Qt.ControlModifier: |
160 if qVersion() >= "5.0.0": |
161 if qVersionTuple() >= (5, 0, 0): |
161 delta = evt.angleDelta().y() |
162 delta = evt.angleDelta().y() |
162 else: |
163 else: |
163 delta = evt.delta() |
164 delta = evt.delta() |
164 if delta < 0: |
165 if delta < 0: |
165 self.__zoomOut() |
166 self.__zoomOut() |