Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.0
-
None
-
44d78dca77b8a5f4f0d1bb67e84c21a4c57345b6
Description
When, instead of passing a reference to an existing element, we pass an inline element to drag.target, qmlviewer.exe crashes.
I would have expected the inline element to be dynamically created and moved around.
Use case : I have an element, say an image. I want the image to be draggable, but instead of dragging it directly, I want to drag a "ghost" of the image (the same image, but with lower opacity), as it is extensively done in windows and Mac OS. I would define this "ghost" inline in the drag target, and expect it to be instanciated when the user starts dragging the picture
import Qt 4.7 Item { height:200 width:200 MouseArea { anchors.fill: parent drag.maximumX: 200 drag.maximumY: 200 drag.target: Rectangle { width: 50; height: 50; color: "grey"} //crashes qmlviewer.exe /* drag.target: dragTarget //works Rectangle { id: dragTarget; width: 50; height: 50; color: "grey" } */ } }