From 25d1f3f5b6391af17a38dd4c86fd6b2769abe592 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 27 Oct 2009 18:04:02 +0000 Subject: [PATCH] if the sub widget can't scroll at all, just ignore the mouse event svn path=/trunk/KDE/kdelibs/; revision=1041272 --- private/kineticscroll.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/private/kineticscroll.cpp b/private/kineticscroll.cpp index 6b1a0a64b..c1e952303 100644 --- a/private/kineticscroll.cpp +++ b/private/kineticscroll.cpp @@ -151,6 +151,13 @@ void KineticScrolling::mousePressEvent(QGraphicsSceneMouseEvent *event) { d->syncViewportRect(); d->cposition = -d->parent->property("scrollPosition").value(); + + if (d->cposition == QPointF(0, 0) && + d->viewportGeometry.width() + 2 >= d->contentsSize.width() && + d->viewportGeometry.height() + 2 >= d->contentsSize.height()) { + event->ignore(); + } + doneOvershoot(); Q_UNUSED(event); d->count();