Results 1 to 4 of 4

Thread: Remote file list Drop to desktop

  1. #1
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Remote file list Drop to desktop

    I have build a remote file list model to a QTreeWidget
    now i can drag file from desktop & drop to QTreeWidget ++ upload on PUT Webdav method....

    But now how i can drag from QTreeWidget & drop to desktop?
    i muss fill a QClipboard ?

    here is the method drop upload.....

    Qt Code:
    1. void WebDav_Main::dropEvent(QDropEvent *event)
    2. {
    3. /* incomming data file upload to server */
    4. if(event && event->mimeData()) {
    5. const QMimeData *data = event->mimeData();
    6. QStringList urlmixed;
    7. urlmixed.clear();
    8. QList<QUrl> urlelist;
    9. if (data->hasUrls()) {
    10. urlelist = data->urls();
    11. for ( int i = 0; i < urlelist.size(); ++i ) {
    12. QUrl gettyurl(urlelist.at(i));
    13. if (gettyurl.isValid()) {
    14. QString shema = gettyurl.scheme();
    15. qDebug() << "### shema " << shema;
    16. if (shema == "file") {
    17. QString localfileupsgo = gettyurl.toLocalFile();
    18. urlmixed.append(localfileupsgo);
    19. }
    20. }
    21. }
    22. SendUpPutList(urlmixed);
    23. return;
    24. }
    25.  
    26. }
    27. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Remote file list Drop to desktop

    This is a very good question, but unfortunately there is no platform independent solution. The problem is that the drop is handled by the TARGET - in this case by the desktop.

  3. #3
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Remote file list Drop to desktop

    Quote Originally Posted by wysota View Post
    This is a very good question, but unfortunately there is no platform independent solution. The problem is that the drop is handled by the TARGET - in this case by the desktop.
    Why ... i can open firefox open one url or better a picture and drag to desktop? or folder...
    How i can find moore info to drag file only to dir or desktop on window microsofts...
    Or QT can not handle desktop... from window?

    Mac OS X already have a super Mount disk Webdav Method... [Apple + K]
    Linux have a webdav kernel mount.... is inaf...
    Only Window dont have a Easy Client to access Apache2 Webdav

    only netdrive from Novel exist http://www.acs.uwosh.edu/novell/netdrive.htm and this fake client work 90% on cache and not on remote server ... novel developer from this client have the last update from 2002 .... and new Window Vista Mount remote webdav direct to secret service or CIA .... http://en.wikipedia.org/wiki/Next-Ge...Computing_Base

    Palladium
    Last edited by patrik08; 9th February 2007 at 23:54.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Remote file list Drop to desktop

    Quote Originally Posted by patrik08 View Post
    Why ... i can open firefox open one url or better a picture and drag to desktop? or folder...
    Because the desktop knows how to handle a http request.

    How i can find moore info to drag file only to dir or desktop on window microsofts...
    Or QT can not handle desktop... from window?
    The problem is with Windows Explorer which is responsible for handling drops on Windows. The problem is that the object you drop doesn't exist on your machine at the time of the drop and you have to do a special mambo-jambo by filling some structures Explorer likes and then feed the data into a temporary file which will then be copied by the Explorer into the proper place. This is very complicated and requires a decent knowledge of WinAPI to implement.

    Mac OS X already have a super Mount disk Webdav Method... [Apple + K]
    Linux have a webdav kernel mount.... is inaf...
    Only Window dont have a Easy Client to access Apache2 Webdav
    I think we are talking about completely different things here.

  5. The following user says thank you to wysota for this useful post:

    patrik08 (10th February 2007)

Similar Threads

  1. Draging a non-existing file to the Windows Desktop
    By klaus1111 in forum Qt Programming
    Replies: 13
    Last Post: 20th September 2007, 12:47
  2. Replies: 11
    Last Post: 4th July 2006, 16:09

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.