PDA

View Full Version : Jambi: Using non-standard mimetypes



Ron Ofir
1st August 2007, 20:19
Hello everybody!

I am a new Qt Jambi user, though I did have some basic experience with Qt 3 after trying it out some years ago. I know this a C++ Qt forum, but I hoped that you could help me anyway, and I hope that I'm not breaking any rules by posting this post :p

So, my problem is this: I'm writing a Java program using Qt which accesses a remote server and lets you manipulate the files that are on the server, quite like an FTP client. I want to make my program DnD compatible, that is, I want users to be able to drop files into my program (which is pretty much just a tree in a window) and drag files out of it. Supporting drops is very easy, as I get a handy URI and can easily upload it. The tricky part is the drags, as I don't have a URI to give to the OS (I'm currently writing it for windows, though I hope to make versions for Mac and X11 too). After looking around in the docs, I found out about QWindowsMime, but I also found out that it is not visible to the Jambi version, instead, it is used internally. So how can I use it? Can I just set the mime type to be "text/uri-list" (I want a CF_INETURL) and Qt will take of the rest for me?
Another question: I saw that when I drop a hyperlink into my program, Qt introduces a new mime type: "application/x-qt-windows-mime;value="FileContents"". If I'm not mistaken, it should be parallel to CFSTR_FILECONTENTS, which can also be a solution to my problem. So I tried setting that as the mime type, but I found out using Clispy that Qt just leaves the mime type as it is, and does not automagically make it into a CFSTR_FILECONTENTS. Is there anything I can do to make Qt do the switch?

I hope my questions were understandable.
Thanks in advance,
Ron Ofir.