Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. (Drag and drop file) How to get destination path?

(Drag and drop file) How to get destination path?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Eleviesta
    wrote on last edited by
    #1

    Hello, I made an application can drag and drop files from explorer to application
    and copy files to desktop by drag and drop from application. Here's my code
    @private:
    QMimeData *qmdata;@

    @void Dialog::dropEvent(QDropEvent * event){
    event->accept();
    qmdata=new QMimeData;
    qmdata->setUrls(event->mimeData()->urls());
    }@

    @void Dialog::mousePressEvent(QMouseEvent* event)
    {
    QDrag *drag = new QDrag(this);
    drag->setMimeData(qmdata);
    drag->exec(Qt::CopyAction);
    QDialog::mousePressEvent(event);
    }@

    The problem is, I can't get any information from drag->exec(Qt::CopyAction).
    Can anybody tell me how I can get destination path of copied file by drag and drop?

    1 Reply Last reply
    1

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved