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