Am Donnerstag, 16. März 2006 16:46 schrieb Abdelrazak Younes: > Georg Baum a écrit : > > As discussed with Jean-Marc in bugzilla. This is already in. > > Abdel, am I right that it is not needed for qt4? > > I guess not because QWorkArea handle the scrollbar wheelevent directly. > But you should maybe verify that it's working on par with other Qt4 apps > if any...
I tested it, and the very same logic as in qt2 is needed, only in a different place. I am going to commit the attached patch. Log: * src/frontends/qt4/QWorkArea.C (QWorkArea::mouseMoveEvent): Use qt wide scroll wheel setting Georg PS: We should really have eolstyle native on all source files. I don't want mixed line endings, but it would be equally awkward for Abdel to use unix line endings on windows.
Index: src/frontends/qt4/QWorkArea.C =================================================================== --- src/frontends/qt4/QWorkArea.C (Revision 13407) +++ src/frontends/qt4/QWorkArea.C (Arbeitskopie) @@ -389,10 +497,15 @@ void QWorkArea::mouseMoveEvent(QMouseEve void QWorkArea::wheelEvent(QWheelEvent * e) { - verticalScrollBar()->setValue(verticalScrollBar()->value() - e->delta()); - adjustViewWithScrollBar(); + // Wheel rotation by one notch results in a delta() of 120 (see + // documentation of QWheelEvent) + int const lines = QApplication::wheelScrollLines() * e->delta() / 120; + verticalScrollBar()->setValue(verticalScrollBar()->value() - + lines * verticalScrollBar()->lineStep()); + adjustViewWithScrollBar(); } + void QWorkArea::generateSyntheticMouseEvent() { // Set things off to generate the _next_ 'pseudo' event.