Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/widgets/qscrollbar.cpp

    r651 r769  
    522522        d_func()->updateHoverControl(he->pos());
    523523        break;
     524#ifndef QT_NO_WHEELEVENT
     525    case QEvent::Wheel: {
     526        // override wheel event without adding virtual function override
     527        QWheelEvent *ev = static_cast<QWheelEvent *>(event);
     528        int delta = ev->delta();
     529        // scrollbar is a special case - in vertical mode it reaches minimum
     530        // value in the upper position, however QSlider's minimum value is on
     531        // the bottom. So we need to invert a value, but since the scrollbar is
     532        // inverted by default, we need to inverse the delta value for the
     533        // horizontal orientation.
     534        if (ev->orientation() == Qt::Horizontal)
     535            delta = -delta;
     536        Q_D(QScrollBar);
     537        if (d->scrollByDelta(ev->orientation(), ev->modifiers(), delta))
     538            event->accept();
     539        return true;
     540    }
     541#endif
    524542    default:
    525543        break;
Note: See TracChangeset for help on using the changeset viewer.