Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, June 2007
Qt 4.3: Dragging files onto the Desktop?


Message 1 in thread

Hi all,

I'm working on a cross-platform remote-file-browser app, similar in style to 
"Fetch" on the Mac:  It logs in to a remote server, shows you a list of files 
on the remote server's hard drive, and lets you upload files to the server or 
download them from the server to your client's hard drive.

This all works well... now I'm working on adding drag-and-drop support to the 
GUI.  Currently I can drag a file from a system folder on my client computer 
and drop it into my app's QTreeWidget, and an upload of that file will begin.  
That works fine too.

What I'd like to add next is add the ability to drag a file *out* of my app's 
QTreeWidget and onto a system folder, at which point my application would 
begin a download of that file from the server into the dragged-into folder.

The problem is, I can't see how to implement this... since the system folder 
isn't part of my Qt app, I can't just subclass it and reimplement 
dragEnterEvent() and dropEvent() on it.  And since the files on the server 
are often quite large (e.g. gigabytes), it's impractical for me to download 
the file's contents in advance and include them in the QDrag object at the 
start of the drag.  It seems like I would need to get some notification when 
the drag finished, and query the file path represented by the folder where 
the drag was dropped.

Is there any way for me to do what I want using Qt 4.3.0?

Thanks,
Jeremy Friesner

--
 [ signature omitted ]