summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-07-07 05:45:45 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2010-07-13 03:58:34 (GMT)
commite6e140fe65a6a7ed1baf7bc03afe930e7b188f26 (patch)
tree38e935ddc15a0a3b5ae634d59e9387c9c9800585 /src
parente942f655236ea3c17bb3edba81630508b65af057 (diff)
downloadQt-e6e140fe65a6a7ed1baf7bc03afe930e7b188f26.zip
Qt-e6e140fe65a6a7ed1baf7bc03afe930e7b188f26.tar.gz
Qt-e6e140fe65a6a7ed1baf7bc03afe930e7b188f26.tar.bz2
Don't crash if drag.target has no parentItem
Task-number: QTBUG-11986 (cherry picked from commit 44d78dca77b8a5f4f0d1bb67e84c21a4c57345b6)
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp4
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.