QScintilla/Editor.py

changeset 3778
0c5bc18da740
parent 3670
f0cb7579c0b4
child 3859
a128a5940722
equal deleted inserted replaced
3777:0c47cbb5b199 3778:0c5bc18da740
16 import os 16 import os
17 import re 17 import re
18 import difflib 18 import difflib
19 19
20 from PyQt5.QtCore import QDir, QTimer, QModelIndex, QFileInfo, pyqtSignal, \ 20 from PyQt5.QtCore import QDir, QTimer, QModelIndex, QFileInfo, pyqtSignal, \
21 pyqtSlot, QCryptographicHash, QEvent, QDateTime, QRegExp, Qt 21 pyqtSlot, QCryptographicHash, QEvent, QDateTime, QRegExp, Qt, qVersion
22 from PyQt5.QtGui import QCursor, QPalette, QFont, QPixmap, QPainter 22 from PyQt5.QtGui import QCursor, QPalette, QFont, QPixmap, QPainter
23 from PyQt5.QtWidgets import QLineEdit, QActionGroup, QDialog, QInputDialog, \ 23 from PyQt5.QtWidgets import QLineEdit, QActionGroup, QDialog, QInputDialog, \
24 QApplication, QMenu 24 QApplication, QMenu
25 from PyQt5.QtPrintSupport import QPrinter, QPrintDialog, QAbstractPrintDialog 25 from PyQt5.QtPrintSupport import QPrinter, QPrintDialog, QAbstractPrintDialog
26 from PyQt5.Qsci import QsciScintilla, QsciMacro, QsciStyledText 26 from PyQt5.Qsci import QsciScintilla, QsciMacro, QsciStyledText
6177 """ 6177 """
6178 Protected method to handle wheel events. 6178 Protected method to handle wheel events.
6179 6179
6180 @param evt reference to the wheel event (QWheelEvent) 6180 @param evt reference to the wheel event (QWheelEvent)
6181 """ 6181 """
6182 if qVersion() >= "5.0.0":
6183 delta = evt.angleDelta().y()
6184 else:
6185 delta = evt.delta()
6182 if evt.modifiers() & Qt.ControlModifier: 6186 if evt.modifiers() & Qt.ControlModifier:
6183 if evt.angleDelta().y() < 0: 6187 if delta < 0:
6184 self.zoomOut() 6188 self.zoomOut()
6185 else: 6189 else:
6186 self.zoomIn() 6190 self.zoomIn()
6187 evt.accept() 6191 evt.accept()
6188 return 6192 return
6189 6193
6190 if evt.modifiers() & Qt.ShiftModifier: 6194 if evt.modifiers() & Qt.ShiftModifier:
6191 if evt.angleDelta().y() < 0: 6195 if delta < 0:
6192 self.gotoMethodClass(False) 6196 self.gotoMethodClass(False)
6193 else: 6197 else:
6194 self.gotoMethodClass(True) 6198 self.gotoMethodClass(True)
6195 evt.accept() 6199 evt.accept()
6196 return 6200 return

eric ide

mercurial