Re: QClipboard and Windows
Re: QClipboard and Windows
Quote:
Originally Posted by
jpn
I already tried it.
The urls() doesn't return anything because the clipboard format used by Windows for filepaths isn't standard (I guess you didn't expect that, don't you?:p). Windows uses some shitty format (application/x-qt-windows-mime;value="Shell IDList Array or something like that) and I don't understand how to use QWindowsMime:crying: which should override the problem. Now I'm trying to use directly the windows API to obtain a dump of the data saved in the clipboard and then I plan to extrapolate the filepaths from there. It's just tedious.
Anyone got better ideas?
Re: QClipboard and Windows
At least the drag and drop data from Windows Explorer contains "text/uri-list". I'd expected the clipboard data to follow same convention.
Re: QClipboard and Windows
I dont think you are evaluating the mime data properly.
I checked the Drop Site example in Qt Demo. When I drag and drop multiple files, I get
Format -
application/x-qt-windows-mime;value="Shell IDList Array"
...
...
text/uri-list
In the text/uri-list , in the contents part I see the list of file names.
Please refer to the Drop Site example and see urself. May be clipboard does same thing. You need to iterate over the mime data like in the example.
Re: QClipboard and Windows
Ok I will give a try with that tutorial.
However if I try to take "text/uri-list" data from the MimeData it returns empty string (even though I already selected and "copied" some files).
EDIT:
OMG I think I found the error. You were right, using urls() function return a url list of the selected files. The problem seems to be about some configuration option in the project file. I forgot to specifiy the qmakespec and the TARGET variable so basically I executed the same program over and over without modifying anything:eek:.
This brings me to another question: Is there a GOOD Windows IDE compatible with QT, which supports project file creation and customization, and project building and debugging??
I tried CodeBlocks but it doesn't work that well (I can't start the debug).