Don't accept wheel events if sendEvent() returns false.

Otherwise wheeling over disabled items won't let the wheel event
propagate to the parent.

An easy way to reproduce the problem is by having a flickable with
some disabled item in it.

Task-number: QTBUG-33477
Change-Id: Ib327cc34dd9f415617ffbc41064f689507446c05
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
bb10
Sérgio Martins 2013-10-11 18:14:43 +01:00 committed by The Qt Project
parent e2557933cb
commit f59e29d9bf
1 changed files with 3 additions and 2 deletions

View File

@ -4147,8 +4147,9 @@ void QGraphicsScene::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent)
wheelEvent->widget()));
wheelEvent->accept();
bool isPanel = item->isPanel();
d->sendEvent(item, wheelEvent);
if (isPanel || wheelEvent->isAccepted())
bool ret = d->sendEvent(item, wheelEvent);
if (ret && (isPanel || wheelEvent->isAccepted()))
break;
}
}