QScintilla/Editor.py

changeset 3778
0c5bc18da740
parent 3670
f0cb7579c0b4
child 3859
a128a5940722
diff -r 0c47cbb5b199 -r 0c5bc18da740 QScintilla/Editor.py
--- a/QScintilla/Editor.py	Mon Sep 08 20:13:54 2014 +0200
+++ b/QScintilla/Editor.py	Sat Sep 13 16:13:52 2014 +0200
@@ -18,7 +18,7 @@
 import difflib
 
 from PyQt5.QtCore import QDir, QTimer, QModelIndex, QFileInfo, pyqtSignal, \
-    pyqtSlot, QCryptographicHash, QEvent, QDateTime, QRegExp, Qt
+    pyqtSlot, QCryptographicHash, QEvent, QDateTime, QRegExp, Qt, qVersion
 from PyQt5.QtGui import QCursor, QPalette, QFont, QPixmap, QPainter
 from PyQt5.QtWidgets import QLineEdit, QActionGroup, QDialog, QInputDialog, \
     QApplication, QMenu
@@ -6179,8 +6179,12 @@
         
         @param evt reference to the wheel event (QWheelEvent)
         """
+        if qVersion() >= "5.0.0":
+            delta = evt.angleDelta().y()
+        else:
+            delta = evt.delta()
         if evt.modifiers() & Qt.ControlModifier:
-            if evt.angleDelta().y() < 0:
+            if delta < 0:
                 self.zoomOut()
             else:
                 self.zoomIn()
@@ -6188,7 +6192,7 @@
             return
         
         if evt.modifiers() & Qt.ShiftModifier:
-            if evt.angleDelta().y() < 0:
+            if delta < 0:
                 self.gotoMethodClass(False)
             else:
                 self.gotoMethodClass(True)

eric ide

mercurial