Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-11986

MouseArea's drag.target crashes when we pass an inline item, instead of an item id

    XMLWordPrintable

Details

    • 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" }
      		*/
      	}
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            gregschlom Gregory Schlomoff
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes