Graphics/UMLGraphicsView.py

changeset 3778
0c5bc18da740
parent 3656
441956d8fce5
child 4021
195a471c327b
--- a/Graphics/UMLGraphicsView.py	Mon Sep 08 20:13:54 2014 +0200
+++ b/Graphics/UMLGraphicsView.py	Sat Sep 13 16:13:52 2014 +0200
@@ -10,7 +10,7 @@
 from __future__ import unicode_literals
 
 from PyQt5.QtCore import pyqtSignal, Qt, QSignalMapper, QFileInfo, QEvent, \
-    QRectF
+    QRectF, qVersion
 from PyQt5.QtWidgets import QGraphicsView, QAction, QToolBar, QDialog
 from PyQt5.QtPrintSupport import QPrinter, QPrintDialog
 
@@ -601,7 +601,11 @@
         @param evt reference to the wheel event (QWheelEvent)
         """
         if evt.modifiers() & Qt.ControlModifier:
-            if evt.angleDelta().y() < 0:
+            if qVersion() >= "5.0.0":
+                delta = evt.angleDelta().y()
+            else:
+                delta = evt.delta()
+            if delta < 0:
                 self.zoomOut()
             else:
                 self.zoomIn()

eric ide

mercurial