<?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[Copying files from qrc suddenly stopped working]]></title><description><![CDATA[<p dir="auto">Hi, I'm trying to copy 2 files from a resource (qrc). It was working fine, untill I changed the path where I was originally copying the files to. I tried changing it back, but that also stopped working. I haven't changed anything anywhere, just the destination path.<br />
Here's what I have:</p>
<pre><code>QString dir = getUserPath() + "/AppData/Local/Temp/Sucharek/";
QDir createTempFolder; createTempFolder.mkdir(dir);

qDebug() &lt;&lt; QFile::copy(":/files/drivers.zip", dir + "drivers.zip"); //returns false, the other one too
QFile::copy(":/files/platform-tools.zip", dir + "platform-tools.zip");
</code></pre>
<p dir="auto">I have checked the spelling, the path, tried changing it to a different destination path, still returns false and doesn't work.<br />
Edit: The folder in specified path does exist.</p>
]]></description><link>https://forum.qt.io/topic/137427/copying-files-from-qrc-suddenly-stopped-working</link><generator>RSS for Node</generator><lastBuildDate>Tue, 16 Jun 2026 00:25:29 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/137427.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 23 Jun 2022 17:38:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Copying files from qrc suddenly stopped working on Thu, 23 Jun 2022 17:59:17 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a>, I did a clean build and it's working now, thanks.<br />
Thanks for all your replies.</p>
]]></description><link>https://forum.qt.io/post/718798</link><guid isPermaLink="true">https://forum.qt.io/post/718798</guid><dc:creator><![CDATA[Sucharek]]></dc:creator><pubDate>Thu, 23 Jun 2022 17:59:17 GMT</pubDate></item><item><title><![CDATA[Reply to Copying files from qrc suddenly stopped working on Thu, 23 Jun 2022 17:52:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sucharek">@<bdi>Sucharek</bdi></a><br />
If nothing else is working, did you do a full clean delete and rebuild?  Just to make sure the resources are properly compiled into the executable right.</p>
]]></description><link>https://forum.qt.io/post/718795</link><guid isPermaLink="true">https://forum.qt.io/post/718795</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 23 Jun 2022 17:52:18 GMT</pubDate></item><item><title><![CDATA[Reply to Copying files from qrc suddenly stopped working on Thu, 23 Jun 2022 17:50:40 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a>, the prefix is: /files</p>
]]></description><link>https://forum.qt.io/post/718794</link><guid isPermaLink="true">https://forum.qt.io/post/718794</guid><dc:creator><![CDATA[Sucharek]]></dc:creator><pubDate>Thu, 23 Jun 2022 17:50:40 GMT</pubDate></item><item><title><![CDATA[Reply to Copying files from qrc suddenly stopped working on Thu, 23 Jun 2022 17:49:22 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Did you add a prefix or an alias to that file ?</p>
]]></description><link>https://forum.qt.io/post/718792</link><guid isPermaLink="true">https://forum.qt.io/post/718792</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 23 Jun 2022 17:49:22 GMT</pubDate></item><item><title><![CDATA[Reply to Copying files from qrc suddenly stopped working on Thu, 23 Jun 2022 17:48:27 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a>, <code>:/files/platform-tools.zip</code> and the other one exists:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/66980e06-28c3-4490-8659-84f6d04d9f5e.png" alt="689d89fb-a9fe-4b00-997d-a0901093742f-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I used the non-static version and QFile returned <code>Cannot open :/files/platform-tools.zip for input</code>. Once again, I checked the spelling, paths, they do exist.<br />
The commands I'm using:<br />
<code>QFile file(":/files/platform-tools.zip"); file.copy(dir + "platform-tools.zip"); qDebug() &lt;&lt; file.errorString();</code></p>
]]></description><link>https://forum.qt.io/post/718791</link><guid isPermaLink="true">https://forum.qt.io/post/718791</guid><dc:creator><![CDATA[Sucharek]]></dc:creator><pubDate>Thu, 23 Jun 2022 17:48:27 GMT</pubDate></item><item><title><![CDATA[Reply to Copying files from qrc suddenly stopped working on Thu, 23 Jun 2022 17:42:52 GMT]]></title><description><![CDATA[<p dir="auto">Check if ``:/files/platform-tool.zip` really <a href="https://doc.qt.io/qt-6/qfile.html#exists-1" target="_blank" rel="noopener noreferrer nofollow ugc">exists</a>. Also use the non-static version of <a href="https://doc.qt.io/qt-6/qfile.html#copy" target="_blank" rel="noopener noreferrer nofollow ugc">QFile::copy()</a> and check the <a href="https://doc.qt.io/qt-6/qiodevice.html#errorString" target="_blank" rel="noopener noreferrer nofollow ugc">error string</a> afterwards.</p>
]]></description><link>https://forum.qt.io/post/718790</link><guid isPermaLink="true">https://forum.qt.io/post/718790</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Thu, 23 Jun 2022 17:42:52 GMT</pubDate></item></channel></rss>