diff options
Diffstat (limited to 'src/declarative/fx/qfxpathview.cpp')
-rw-r--r-- | src/declarative/fx/qfxpathview.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp index 98121e6..6546f69 100644 --- a/src/declarative/fx/qfxpathview.cpp +++ b/src/declarative/fx/qfxpathview.cpp @@ -496,7 +496,8 @@ bool QFxPathView::sendMouseEvent(QGraphicsSceneMouseEvent *event) Q_D(QFxPathView); QGraphicsSceneMouseEvent mouseEvent(event->type()); QRectF myRect = mapToScene(QRectF(0, 0, width(), height())).boundingRect(); - QFxItem *grabber = static_cast<QFxItem*>(mouseGrabberItem()); + QGraphicsScene *s = scene(); + QFxItem *grabber = s ? qobject_cast<QFxItem*>(s->mouseGrabberItem()) : 0; if ((d->stealMouse || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) { mouseEvent.setAccepted(false); for (int i = 0x1; i <= 0x10; i <<= 1) { @@ -523,7 +524,7 @@ bool QFxPathView::sendMouseEvent(QGraphicsSceneMouseEvent *event) default: break; } - grabber = static_cast<QFxItem*>(mouseGrabberItem()); + grabber = qobject_cast<QFxItem*>(s->mouseGrabberItem()); if (grabber && d->stealMouse && !grabber->keepMouseGrab() && grabber != this) grabMouse(); |