src/gui/widgets/qabstractscrollarea.cpp
branchRCL_3
changeset 8 3f74d0d4af4c
parent 4 3b1da2848fc7
child 14 c0432d11811c
--- a/src/gui/widgets/qabstractscrollarea.cpp	Mon Mar 15 12:43:09 2010 +0200
+++ b/src/gui/widgets/qabstractscrollarea.cpp	Thu Apr 08 14:19:33 2010 +0300
@@ -1134,13 +1134,10 @@
 void QAbstractScrollArea::wheelEvent(QWheelEvent *e)
 {
     Q_D(QAbstractScrollArea);
-    QScrollBar *const bars[2] = { d->hbar, d->vbar };
-    int idx = (e->orientation() == Qt::Vertical) ? 1 : 0;
-    int other = (idx + 1) % 2;
-    if (!bars[idx]->isVisible() && bars[other]->isVisible())
-        idx = other;   // If the scrollbar of the event orientation is hidden, fallback to the other.
-
-    QApplication::sendEvent(bars[idx], e);
+    if (static_cast<QWheelEvent*>(e)->orientation() == Qt::Horizontal)
+        QApplication::sendEvent(d->hbar, e);
+    else
+        QApplication::sendEvent(d->vbar, e);
 }
 #endif