<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Drag &amp; Drop to external application(eg. drag from Qt app to Windows desktop&#x2F;explorer)?]]></title><description><![CDATA[<p dir="auto">Drag &amp; Drop to external application(eg. drag from Qt app to Windows desktop/explorer)?<br />
i want to drag QTreeWidgetItem from my Qt app to Windows desktop/explorer, after i drop, i want to copy the file which the QTreeWidgetItem represents to the destination path of Windows desktop/explorer.<br />
thank you</p>
]]></description><link>https://forum.qt.io/topic/59690/drag-drop-to-external-application-eg-drag-from-qt-app-to-windows-desktop-explorer</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 16:19:14 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/59690.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Oct 2015 09:57:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Drag &amp; Drop to external application(eg. drag from Qt app to Windows desktop&#x2F;explorer)? on Thu, 15 Oct 2015 07:59:49 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
To drag to explorer from Qt there must be a real file. In memory did not work for me.<br />
This drags a Temp file to the desktop/explorer. (in win 7)</p>
<pre><code>#include &lt;QtGui&gt;
#include &lt;QLabel&gt;
class Label : public QLabel {
 protected:
  void mouseMoveEvent(QMouseEvent* event) {
    QTemporaryFile file;
    if (file.open()) {
      QUrl url = QUrl::fromLocalFile(file.fileName());
      file.write(text().toUtf8());
      file.close();

      QDrag* drag = new QDrag(this);
      QMimeData* mimeData = new QMimeData;
      mimeData-&gt;setUrls(QList&lt;QUrl&gt;() &lt;&lt; url);
      drag-&gt;setMimeData(mimeData);
      drag-&gt;exec(Qt::CopyAction);
    }
  }
};

int main(int argc, char* argv[]) {
  QApplication app(argc, argv);
  Label label;
  label.setText("DRAG HERE");
  label.show();
  return app.exec();
}
</code></pre>
]]></description><link>https://forum.qt.io/post/293886</link><guid isPermaLink="true">https://forum.qt.io/post/293886</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Thu, 15 Oct 2015 07:59:49 GMT</pubDate></item><item><title><![CDATA[Reply to Drag &amp; Drop to external application(eg. drag from Qt app to Windows desktop&#x2F;explorer)? on Thu, 15 Oct 2015 05:06:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> but i startDarg in Qt app, and drop in Windows explorer...</p>
]]></description><link>https://forum.qt.io/post/293861</link><guid isPermaLink="true">https://forum.qt.io/post/293861</guid><dc:creator><![CDATA[opengpu2]]></dc:creator><pubDate>Thu, 15 Oct 2015 05:06:45 GMT</pubDate></item><item><title><![CDATA[Reply to Drag &amp; Drop to external application(eg. drag from Qt app to Windows desktop&#x2F;explorer)? on Wed, 14 Oct 2015 21:34:03 GMT]]></title><description><![CDATA[<p dir="auto">Then please, edit your original post and rephrase it, what you are doing there is just creating noise and if somebody had replied you would also generate unneeded fragmentation.</p>
<p dir="auto">With pure Qt API ? No, I don't know, but since it's something Windows specific you should look at the native API for that part.</p>
]]></description><link>https://forum.qt.io/post/293831</link><guid isPermaLink="true">https://forum.qt.io/post/293831</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 14 Oct 2015 21:34:03 GMT</pubDate></item><item><title><![CDATA[Reply to Drag &amp; Drop to external application(eg. drag from Qt app to Windows desktop&#x2F;explorer)? on Wed, 14 Oct 2015 01:15:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> i think ask like this is better:D<br />
thank you!<br />
and do you know how to do this?</p>
]]></description><link>https://forum.qt.io/post/293719</link><guid isPermaLink="true">https://forum.qt.io/post/293719</guid><dc:creator><![CDATA[opengpu2]]></dc:creator><pubDate>Wed, 14 Oct 2015 01:15:34 GMT</pubDate></item><item><title><![CDATA[Reply to Drag &amp; Drop to external application(eg. drag from Qt app to Windows desktop&#x2F;explorer)? on Tue, 13 Oct 2015 21:18:00 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Why did you delete <a href="http://forum.qt.io/topic/59638/" target="_blank" rel="noopener noreferrer nofollow ugc">this thread</a> just to ask the same question again ?</p>
]]></description><link>https://forum.qt.io/post/293704</link><guid isPermaLink="true">https://forum.qt.io/post/293704</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 13 Oct 2015 21:18:00 GMT</pubDate></item></channel></rss>