Graphics/SvgDiagram.py

changeset 5736
000ea446ff4b
parent 5631
d0beabfaad42
child 6048
82ad8ec9548c
equal deleted inserted replaced
5735:f606dbe20be6 5736:000ea446ff4b
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
19 from E5Gui.E5ZoomWidget import E5ZoomWidget 19 from E5Gui.E5ZoomWidget import E5ZoomWidget
20 20
21 import UI.Config 21 import UI.Config
22 22
23 import Preferences 23 import Preferences
24 from Globals import qVersionTuple
24 25
25 26
26 class SvgDiagram(E5MainWindow): 27 class SvgDiagram(E5MainWindow):
27 """ 28 """
28 Class implementing a dialog showing a SVG graphic. 29 Class implementing a dialog showing a SVG graphic.
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()

eric ide

mercurial