Graphics/UMLGraphicsView.py

branch
maintenance
changeset 5752
1860eca908e4
parent 5680
b93cb6353cc0
parent 5736
000ea446ff4b
child 6050
25a4ddb25ca4
equal deleted inserted replaced
5731:54829a44cea5 5752:1860eca908e4
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
23 23
24 import UI.Config 24 import UI.Config
25 import UI.PixmapCache 25 import UI.PixmapCache
26 26
27 import Preferences 27 import Preferences
28 from Globals import qVersionTuple
28 29
29 30
30 class UMLGraphicsView(E5GraphicsView): 31 class UMLGraphicsView(E5GraphicsView):
31 """ 32 """
32 Class implementing a specialized E5GraphicsView for our diagrams. 33 Class implementing a specialized E5GraphicsView for our diagrams.
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()

eric ide

mercurial