Graphics/UMLGraphicsView.py

changeset 3778
0c5bc18da740
parent 3656
441956d8fce5
child 4021
195a471c327b
equal deleted inserted replaced
3777:0c47cbb5b199 3778:0c5bc18da740
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 13 QRectF, qVersion
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. 599 Protected method to handle wheel events.
600 600
601 @param evt reference to the wheel event (QWheelEvent) 601 @param evt reference to the wheel event (QWheelEvent)
602 """ 602 """
603 if evt.modifiers() & Qt.ControlModifier: 603 if evt.modifiers() & Qt.ControlModifier:
604 if evt.angleDelta().y() < 0: 604 if qVersion() >= "5.0.0":
605 delta = evt.angleDelta().y()
606 else:
607 delta = evt.delta()
608 if delta < 0:
605 self.zoomOut() 609 self.zoomOut()
606 else: 610 else:
607 self.zoomIn() 611 self.zoomIn()
608 evt.accept() 612 evt.accept()
609 return 613 return

eric ide

mercurial