summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2011-03-16 02:08:42 (GMT)
committerMartin Jones <martin.jones@nokia.com>2011-03-16 03:05:22 (GMT)
commit733578aec105c2d2bdb3f6ef57ee3195ebb79696 (patch)
tree4caad3d3e09d81b32168fea7c38db62a25ffeaef /src
parent77342ad3e7beecb75c136ee26c0c77cd1a41b415 (diff)
downloadQt-733578aec105c2d2bdb3f6ef57ee3195ebb79696.zip
Qt-733578aec105c2d2bdb3f6ef57ee3195ebb79696.tar.gz
Qt-733578aec105c2d2bdb3f6ef57ee3195ebb79696.tar.bz2
Disabled non-QDeclarativeItems in Flickable break flicking
Allow Flickable to steal grab from items that are disabled. Change-Id: I71e401cd78695ecb2c3d47abde1c3d13e722d848 Task-number: QT-4677 Reviewed-by: Michael Brasser
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index d64c347..f854262 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -1430,8 +1430,10 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
QGraphicsScene *s = scene();
QDeclarativeItem *grabber = s ? qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem()) : 0;
+ QGraphicsItem *grabberItem = s ? s->mouseGrabberItem() : 0;
+ bool disabledItem = grabberItem && !grabberItem->isEnabled();
bool stealThisEvent = d->stealMouse;
- if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) {
+ if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab() || disabledItem)) {
mouseEvent.setAccepted(false);
for (int i = 0x1; i <= 0x10; i <<= 1) {
if (event->buttons() & i) {
@@ -1478,12 +1480,12 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
break;
}
grabber = qobject_cast<QDeclarativeItem*>(s->mouseGrabberItem());
- if (grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this) {
+ if ((grabber && stealThisEvent && !grabber->keepMouseGrab() && grabber != this) || disabledItem) {
d->clearDelayedPress();
grabMouse();
}
- return stealThisEvent || d->delayedPressEvent;
+ return stealThisEvent || d->delayedPressEvent || disabledItem;
} else if (d->lastPosTime.isValid()) {
d->lastPosTime.invalidate();
}