src/gui/widgets/qabstractscrollarea.cpp
branchRCL_3
changeset 8 3f74d0d4af4c
parent 4 3b1da2848fc7
child 14 c0432d11811c
equal deleted inserted replaced
6:dee5afe5301f 8:3f74d0d4af4c
  1132 */
  1132 */
  1133 #ifndef QT_NO_WHEELEVENT
  1133 #ifndef QT_NO_WHEELEVENT
  1134 void QAbstractScrollArea::wheelEvent(QWheelEvent *e)
  1134 void QAbstractScrollArea::wheelEvent(QWheelEvent *e)
  1135 {
  1135 {
  1136     Q_D(QAbstractScrollArea);
  1136     Q_D(QAbstractScrollArea);
  1137     QScrollBar *const bars[2] = { d->hbar, d->vbar };
  1137     if (static_cast<QWheelEvent*>(e)->orientation() == Qt::Horizontal)
  1138     int idx = (e->orientation() == Qt::Vertical) ? 1 : 0;
  1138         QApplication::sendEvent(d->hbar, e);
  1139     int other = (idx + 1) % 2;
  1139     else
  1140     if (!bars[idx]->isVisible() && bars[other]->isVisible())
  1140         QApplication::sendEvent(d->vbar, e);
  1141         idx = other;   // If the scrollbar of the event orientation is hidden, fallback to the other.
       
  1142 
       
  1143     QApplication::sendEvent(bars[idx], e);
       
  1144 }
  1141 }
  1145 #endif
  1142 #endif
  1146 
  1143 
  1147 #ifndef QT_NO_CONTEXTMENU
  1144 #ifndef QT_NO_CONTEXTMENU
  1148 /*!
  1145 /*!