E5Gui/E5MapWidget.py

changeset 3778
0c5bc18da740
parent 3698
3febb7d8b2dc
child 3882
447640057bef
--- a/E5Gui/E5MapWidget.py	Mon Sep 08 20:13:54 2014 +0200
+++ b/E5Gui/E5MapWidget.py	Sat Sep 13 16:13:52 2014 +0200
@@ -9,7 +9,7 @@
 
 from __future__ import unicode_literals
 
-from PyQt5.QtCore import Qt, QSize, QRect, QCoreApplication
+from PyQt5.QtCore import Qt, QSize, QRect, QCoreApplication, qVersion
 from PyQt5.QtGui import QColor, QBrush, QPainter
 from PyQt5.QtWidgets import QWidget, QAbstractScrollArea
 
@@ -219,10 +219,14 @@
         
         @param event reference to the wheel event (QWheelEvent)
         """
+        if qVersion() >= "5.0.0":
+            isVertical = event.angleDelta().x() == 0
+        else:
+            isVertical = event.orientation() == Qt.Vertical
         if self._master and \
             event.modifiers() == Qt.NoModifier and \
-                event.angleDelta().x() == 0:
-            # TODO: test angleDelte() with Mac Trackpad
+                isVertical:
+            # TODO: test angleDelta() with Mac Trackpad
             QCoreApplication.sendEvent(self._master.verticalScrollBar(), event)
     
     def calculateGeometry(self):

eric ide

mercurial