PDA

View Full Version : Dropsite demo not working in QtDemo



aarunt1
4th March 2010, 08:06
I'm trying to get the Dropsite (drag and drop) demo to work in QtDemo but when I drag an image into the field, a generic image is shown. I am using Qt 4.6 on Windows 7. Please help. Thanks!

wysota
4th March 2010, 10:26
What do you mean by "a generic image"? Where do you drag the image from?

aarunt1
4th March 2010, 11:21
I should have said icon. In this case it is a icon image that has been stretched out. I have tried dragging an image from my computer and from the internet. Here is what it looks like:

http://i28.photobucket.com/albums/c247/aarunt1/dropsite.jpg

wysota
4th March 2010, 11:24
It's not an image, it's a file. If you drag an icon from a file manager, you are dragging the file, not the image inside it. If you want to drag an image, open the image in an application that supports it (like a web browser) and start dragging it (the image, not the url) from there.

aarunt1
4th March 2010, 13:13
I tried that already. This is always the result. I have tried dragging an image from my browser and this is what I get. I have tried dragging an image file to it and I get the same thing. I have tried it on different machines with the same result. Did you try it?

Also, when I was using Qt 4.5 this WORKED. I could drag from a file and it WORKED. I could drag from my browser and it WORKED. So why does it not work in 4.6? What you are saying is that it is detecting it as a file correct? I only need to drag and drop images into this field. Is there a way to make it so it will only take in image files?


EDIT: I have edited the code and even though I have omitted it detecting anything put images it STILL detects it as a file. How do you get it to detect images!? Please try this example out. Thanks

wysota
4th March 2010, 13:41
I tried that already. This is always the result. I have tried dragging an image from my browser and this is what I get. I have tried dragging an image file to it and I get the same thing. I have tried it on different machines with the same result. Did you try it?
Yes but not on Windows.


What you are saying is that it is detecting it as a file correct?
Yes, it seems so - text/uri-list is a regular mime for files. But if you drag the image from your webbrowser, you shouldn't get a text/uri-list.

How do you get it to detect images!?
I open an image in Firefox, I press LMB on the image and start dragging it, then I hover the mouse over the dropsite window, wait a bit and the image is detected. Dropping the drag or not is irrelevant.

aarunt1
4th March 2010, 14:09
thanks for the reply. I believe Windows must be the case. What OS are you running? I had tried to get it running on Ubuntu Linux but could not get it configured correctly. I have not tried it on OSX but that is where I eventually want the project to run. Perhaps I can try this on Windows XP.

What is weird is that I had my friend, who is also running Windows 7, run the pre-compiled Dropsite demo from the qt\examples\draganddrop\dropsite\release folder. He was able to drag and drop files from either his hard drive or from a browser and they both worked fine. But then he opened the dropsite.pro in QtCreator and recompiled it. When he tried to run it again it did exactly what is happening to me. Why would it be that it ran fine but then upon recompile it does not work correctly? Is it some kind of build issue with Qt and Windows 7? Please let me know. Thanks!

wysota
4th March 2010, 14:26
thanks for the reply. I believe Windows must be the case. What OS are you running?
Linux/KDE.


Why would it be that it ran fine but then upon recompile it does not work correctly?
Maybe the prebuilt binary was compiled with a different version of Qt than the one your friend used during compilation?

aarunt1
4th March 2010, 21:38
Perhaps it could be a different version of Qt, but I tried all kinds of different versions on my Windows 7 64-bit machine and it doesn't even detect the drag at all. It just stays completely blank. I need to find an XP machine but currently can't. I will try to install different versions of Qt on my Windows 7 32-bit machine and see if that works, if not I will see if I can install XP on it and hopefully that works.

wysota
5th March 2010, 11:33
You can check if there are any bug reports on this on Qt bug tracker.