From 47a60e40ddeeb0c3dd05582de479cd0cb0739c1d Mon Sep 17 00:00:00 2001 From: John Levon Date: Mon, 21 Oct 2002 04:46:26 +0000 Subject: [PATCH] Patch from Philippe Elie for making mouse wheel do something in Qt. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5452 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 5 +++++ src/frontends/qt2/QContentPane.C | 6 ++++++ src/frontends/qt2/QContentPane.h | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 56a75b7be3..f67aeba143 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2002-10-21 Philippe Elie + + * QContentPane.h: + * QContentPane.C: implement wheelEvent + 2002-10-20 Dekel Tsur * several files: Use QT_VERSION >= 300 instead of >= 0x030000 diff --git a/src/frontends/qt2/QContentPane.C b/src/frontends/qt2/QContentPane.C index ccf92d74c2..e5201be836 100644 --- a/src/frontends/qt2/QContentPane.C +++ b/src/frontends/qt2/QContentPane.C @@ -133,6 +133,12 @@ void QContentPane::mouseMoveEvent(QMouseEvent * e) } +void QContentPane::wheelEvent(QWheelEvent * e) +{ + wa_->scrollbar_->setValue(wa_->scrollbar_->value() - e->delta()); +} + + void QContentPane::keyPressEvent(QKeyEvent * e) { lyxerr[Debug::KEY] << "Press key " << e->key() diff --git a/src/frontends/qt2/QContentPane.h b/src/frontends/qt2/QContentPane.h index c0f9278b54..88f995e154 100644 --- a/src/frontends/qt2/QContentPane.h +++ b/src/frontends/qt2/QContentPane.h @@ -69,7 +69,8 @@ protected: void mouseDoubleClickEvent(QMouseEvent * e); /// mouse motion void mouseMoveEvent(QMouseEvent * e); - + /// wheel event + void wheelEvent(QWheelEvent * e); /// key press void keyPressEvent(QKeyEvent * e); public slots: