10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 import sys |
12 import sys |
13 import re |
13 import re |
14 |
14 |
15 from PyQt5.QtCore import pyqtSignal, QFileInfo, Qt, QEvent, qVersion |
15 from PyQt5.QtCore import pyqtSignal, QFileInfo, Qt, QEvent |
16 from PyQt5.QtGui import QClipboard, QPalette, QFont |
16 from PyQt5.QtGui import QClipboard, QPalette, QFont |
17 from PyQt5.QtWidgets import QDialog, QInputDialog, QApplication, QMenu, \ |
17 from PyQt5.QtWidgets import QDialog, QInputDialog, QApplication, QMenu, \ |
18 QWidget, QHBoxLayout, QVBoxLayout, QShortcut |
18 QWidget, QHBoxLayout, QVBoxLayout, QShortcut |
19 from PyQt5.Qsci import QsciScintilla |
19 from PyQt5.Qsci import QsciScintilla |
20 |
20 |
998 Protected method to handle wheel events. |
998 Protected method to handle wheel events. |
999 |
999 |
1000 @param evt reference to the wheel event (QWheelEvent) |
1000 @param evt reference to the wheel event (QWheelEvent) |
1001 """ |
1001 """ |
1002 if evt.modifiers() & Qt.ControlModifier: |
1002 if evt.modifiers() & Qt.ControlModifier: |
1003 if qVersion() >= "5.0.0": |
1003 if qVersionTuple() >= (5, 0, 0): |
1004 delta = evt.angleDelta().y() |
1004 delta = evt.angleDelta().y() |
1005 else: |
1005 else: |
1006 delta = evt.delta() |
1006 delta = evt.delta() |
1007 if delta < 0: |
1007 if delta < 0: |
1008 self.zoomOut() |
1008 self.zoomOut() |