src/gui/widgets/qabstractscrollarea.cpp
changeset 18 2f34d5167611
parent 3 41300fa6a67c
child 22 79de32ba3296
--- a/src/gui/widgets/qabstractscrollarea.cpp	Tue Feb 02 00:43:10 2010 +0200
+++ b/src/gui/widgets/qabstractscrollarea.cpp	Fri Apr 16 15:50:13 2010 +0300
@@ -1,6 +1,6 @@
 /****************************************************************************
 **
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
 ** All rights reserved.
 ** Contact: Nokia Corporation (qt-info@nokia.com)
 **
@@ -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