Details
-
Suggestion
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.3.1
-
None
Description
This is a use case that seems to have come up a number of times on the web:
Someone is making an FTP client (or some other application in which you browse a remote directory) and want to be able to drag the file from the file browser and drop it into a native application like explorer or konqueror. I believe this can be considered standard functionality in e.g. an FTP client.
The closest Qt can support in terms of mime types is a "text/uri-list". For Windows Explorer to accept the drag object, the URI needs to point to a local file, and it needs to exist. Platform specific code on Windows seems to use a special clipboard data type called CF_FILECONTENTS to achieve this, but this is not supported in Qt, and would not solve the problems on other platforms than Windows.
Another possible solution might be to somehow be alerted in the application when the object has been dropped, so that you can stall the process until the file has been downloaded and placed in a local file. Overriding retrieveData() in QMimeData for this does not work, since this function is called while the object is dragged, and not just when it is dropped.
Could we add some kind of API to Qt that makes it possible to solve this use case?