Drag.Format (gb.qt4)

Static Property Read Format As String

Returns the format of the dropped data, as a MIME type.

Warning

Some drag/drop operations like a file drop may contain other formats and only checking Drag.Format might not be the type you are looking for (it seems to only give the first item).

For example on my Mint/MATE system a file drop reports the following Formats and Format...

Drag Formats: ["x-special/mate-icon-list", "text/uri-list", "text/plain;charset=utf-8", "text/plain"]

Drag.Format: "x-special/mate-icon-list"

So the folowing code will not work as expected..

  • If Drag.Format = "text/uri-list" Then

It is best to use Drag.Formats.Exist() on the particular format string you are looking for.

eg..

If Drag.Formats.Exist("text/uri-list") Then

' do something

Endif