QScintilla/Terminal.py

changeset 1507
9225700cbff5
parent 1131
7781e396c903
child 1509
c0b5e693b0eb
--- a/QScintilla/Terminal.py	Sat Dec 24 15:15:36 2011 +0100
+++ b/QScintilla/Terminal.py	Mon Dec 26 14:58:44 2011 +0100
@@ -11,7 +11,7 @@
 import os
 import re
 
-from PyQt4.QtCore import QSignalMapper, QTimer, QByteArray, QProcess
+from PyQt4.QtCore import QSignalMapper, QTimer, QByteArray, QProcess, Qt
 from PyQt4.QtGui import QDialog, QInputDialog, QApplication, QMenu, QPalette, QFont
 from PyQt4.Qsci import QsciScintilla
 
@@ -483,6 +483,22 @@
         self.setFocus()
         super().mousePressEvent(event)
         
+    def wheelEvent(self, evt):
+        """
+        Protected method to handle wheel events.
+        
+        @param evt reference to the wheel event (QWheelEvent)
+        """
+        if evt.modifiers() & Qt.ControlModifier:
+            if evt.delta()< 0:
+                self.zoomOut()
+            else:
+                self.zoomIn()
+            evt.accept()
+            return
+        
+        super().wheelEvent(evt)
+    
     def editorCommand(self, cmd):
         """
         Public method to perform an editor command.

eric ide

mercurial