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

Documentation for Drag.mimeData wrong? Or just unclear?

    XMLWordPrintable

Details

    Description

      Executive summary: The documentation for pure QML Drag and Drop is pretty sparse and apparently incorrect. It could really use a rework!

      Specific case: In the documentation for the Drag QML Type, Drag.mimeData claims that it takes a stringlist as its argument. However, I could only get it to work by passing it a json object - at least it looks like a json object, e.g.

      Drag.dragType: Drag.Automatic
      // The following property value is (correctly) a stringlist
      Drag.keys: [ "application/x-mydatatype" ]
      // The following property value is definitely not a stringlist
      Drag.mimeData: { "application/x-mydatatype" : "the data as a string" }
      etc.
      

      Is the data type wrong in the documentation? And why is there no additional information as to the necessary format of the json object? Furthermore, I expected the DropArea to be willing to accept any object with the correct matching key in Drag.keys. This is not the case. The DropArea refused to even acknowledge any dragged item (disallowing drop) unless the Drag.mimeData was correctly defined (as in the above example). This really made it very difficult to program in QML for Drag and Drop!

      Attachments

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

        Activity

          People

            docteam Qt Documentation Team
            momo Linda Gundal
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes