diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/editor.cc | 10 | ||||
-rw-r--r-- | src/editor.h | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/editor.cc b/src/editor.cc index f237c2e..5282677 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -97,4 +97,14 @@ void Editor::zoomOut() this->setFont( tmp_font ); } +void Editor::wheelEvent ( QWheelEvent * event ) +{ + if (event->modifiers() == Qt::ControlModifier) { + if (event->delta() > 0 ) + zoomIn(); + else if (event->delta() < 0 ) + zoomOut(); + } +} + #endif diff --git a/src/editor.h b/src/editor.h index 509cf24..bb338b0 100644 --- a/src/editor.h +++ b/src/editor.h @@ -1,6 +1,7 @@ #include <QObject> #include <QString> #include <QWidget> +#include <QWheelEvent> #ifdef _QCODE_EDIT_ #include <qeditor.h> @@ -33,5 +34,7 @@ public slots: void unindentSelection(); void commentSelection(); void uncommentSelection(); +private: + void wheelEvent ( QWheelEvent * event ); #endif }; |