summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-02-03 10:30:20 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2010-02-03 10:41:10 (GMT)
commitd53315d30b38352db11063096ee3867a40bdc234 (patch)
tree6ccfe9142099d627b2b7acd5458477a2cecb1477 /src
parent7d4ef9167249df5f00831dc07e57705eb1ddd22a (diff)
downloadQt-d53315d30b38352db11063096ee3867a40bdc234.zip
Qt-d53315d30b38352db11063096ee3867a40bdc234.tar.gz
Qt-d53315d30b38352db11063096ee3867a40bdc234.tar.bz2
Revert "QAbstractScrollArea: Wheel over a scrollarea that has only one horizontal scrollbar"
This reverts commit 46a3e518b3070cf7cb4cbbb2cb58254454cf169d. This shown to cause more problem than it solved Also update the changelog Reviewed-by: Thierry
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/qabstractscrollarea.cpp11
-rw-r--r--src/gui/widgets/qabstractslider.cpp2
2 files changed, 6 insertions, 7 deletions
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp
index 87f6c83..1d496d5 100644
--- a/src/gui/widgets/qabstractscrollarea.cpp
+++ b/src/gui/widgets/qabstractscrollarea.cpp
@@ -1134,13 +1134,10 @@ void QAbstractScrollArea::mouseMoveEvent(QMouseEvent *e)
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
diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp
index 2874647..77c5a01 100644
--- a/src/gui/widgets/qabstractslider.cpp
+++ b/src/gui/widgets/qabstractslider.cpp
@@ -697,6 +697,8 @@ void QAbstractSlider::wheelEvent(QWheelEvent * e)
{
Q_D(QAbstractSlider);
e->ignore();
+ if (e->orientation() != d->orientation && !rect().contains(e->pos()))
+ return;
int stepsToScroll = 0;
qreal offset = qreal(e->delta()) / 120;