diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-07-07 05:45:45 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-07-07 05:45:45 (GMT) |
commit | 44d78dca77b8a5f4f0d1bb67e84c21a4c57345b6 (patch) | |
tree | 8a50def7bbe2579d8d030cab9498ac3136a00c21 /src | |
parent | 760dd5919ac3bafb5f17b700d5da9b3609318bbb (diff) | |
download | Qt-44d78dca77b8a5f4f0d1bb67e84c21a4c57345b6.zip Qt-44d78dca77b8a5f4f0d1bb67e84c21a4c57345b6.tar.gz Qt-44d78dca77b8a5f4f0d1bb67e84c21a4c57345b6.tar.bz2 |
Don't crash if drag.target has no parentItem
Task-number: QTBUG-11986
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativemousearea.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index caf251d..7b65ca7 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -443,7 +443,7 @@ void QDeclarativeMouseArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event) QPointF startLocalPos; QPointF curLocalPos; - if (drag()->target()->parent()) { + if (drag()->target()->parentItem()) { startLocalPos = drag()->target()->parentItem()->mapFromScene(d->startScene); curLocalPos = drag()->target()->parentItem()->mapFromScene(event->scenePos()); } else { @@ -761,7 +761,7 @@ QDeclarativeDrag *QDeclarativeMouseArea::drag() \c drag provides a convenient way to make an item draggable. \list - \i \c drag.target specifies the item to drag. + \i \c drag.target specifies the id of the item to drag. \i \c drag.active specifies if the target item is currently being dragged. \i \c drag.axis specifies whether dragging can be done horizontally (\c Drag.XAxis), vertically (\c Drag.YAxis), or both (\c Drag.XandYAxis) \i \c drag.minimum and \c drag.maximum limit how far the target can be dragged along the corresponding axes. |