root/branch/twedit/QsciScintillaCustom.py
| Revision 1564, 0.7 kB (checked in by mswat, 17 months ago) |
|---|
| Line | |
|---|---|
| 1 | from PyQt4.QtCore import * |
| 2 | from PyQt4.QtGui import * |
| 3 | |
| 4 | from PyQt4.Qsci import * |
| 5 | |
| 6 | from PyQt4 import QtCore, QtGui |
| 7 | |
| 8 | # have to implement custom class for QSciScintilla to handle properly wheel even with and witohut ctrl pressed |
| 9 | class QsciScintillaCustom(QsciScintilla): |
| 10 | def __init__(self,parent=None): |
| 11 | super(QsciScintillaCustom,self).__init__(parent) |
| 12 | |
| 13 | def wheelEvent(self,event): |
| 14 | if qApp.keyboardModifiers()==Qt.ControlModifier: |
| 15 | # Forwarding wheel event to editor windowwheelEvent |
| 16 | event.ignore() |
| 17 | |
| 18 | else: |
| 19 | # # calling wheelEvent from base class - regular scrolling |
| 20 | super(QsciScintillaCustom,self).wheelEvent(event) |
Note: See TracBrowser
for help on using the browser.
