<?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[Image &amp; release problem]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I've been using QT for several years, but have just changed to the latest. I was using something like QT 5.6. Now its QT creator 14.0.0 based on QT 6.7.2</p>
<p dir="auto">However I'm having a couple of problems that I hope someone can help me with.</p>
<p dir="auto">In the older version I displayed some images in QPushButtons, but now they only seem to work on a debug build and not on a release one.</p>
<p dir="auto">this is a copy of the code I have from a simple app.</p>
<pre><code>    string im = "C:/some path/some filename.jpg";
    QImage qim(im.c_str());
    bool bim = qim.isNull();

    QPixmap pix (im.c_str());

    QIcon buttonIcon(pix);
    QSize iconSize;
    int w = 60;
    int h = 30;
    iconSize.setWidth(w);
    iconSize.setHeight(h);

    bool bp = pix.isNull();
    bool bi = buttonIcon.isNull();

    ui-&gt;pushButton_2-&gt;setIcon(buttonIcon);
    ui-&gt;pushButton_2-&gt;setIconSize(iconSize);
</code></pre>
<p dir="auto">but as farf as I can tell in the release runs all the images are null. i.e. bim, bp and bi are all true.</p>
<p dir="auto">in a debug run they all seem to work fine. I've tried with a gif file as well as a jpg and that has the same problem.</p>
<p dir="auto">It could be something to do with how it's started I guess. i.e. I build it in qt creator and get the results above when I run from inside qtcreator, and if I just try running the exe directly I get the images are null failures in both the debug and release build.</p>
<p dir="auto">A similar issue I now have is that if I try to run my apps they seem to need a bunch of dlls in the same directory which they never needed before. (like QT6Gui.dll)</p>
]]></description><link>https://forum.qt.io/topic/158125/image-release-problem</link><generator>RSS for Node</generator><lastBuildDate>Thu, 18 Jun 2026 15:28:40 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/158125.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 Aug 2024 14:45:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Image &amp; release problem on Sun, 11 Aug 2024 11:44:31 GMT]]></title><description><![CDATA[<p dir="auto">OK thanks for all the thoughts. On my new laptop it all seems to work perfectly :-)</p>
]]></description><link>https://forum.qt.io/post/807095</link><guid isPermaLink="true">https://forum.qt.io/post/807095</guid><dc:creator><![CDATA[tjl34567]]></dc:creator><pubDate>Sun, 11 Aug 2024 11:44:31 GMT</pubDate></item><item><title><![CDATA[Reply to Image &amp; release problem on Fri, 09 Aug 2024 08:24:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tjl34567">@<bdi>tjl34567</bdi></a> seems like you did the release/deployment mechanism by hand, depending on the error popup you get when launching the exe instead of using the provided proper tools.</p>
<p dir="auto">you're almost certainly missing the "imageformats" folder and the required dlls, such as: qjpeg.dll qpng.dll besides other stuff</p>
<p dir="auto">you should use the windows deployment tool:<br />
<a href="https://doc.qt.io/qt-6/windows-deployment.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-6/windows-deployment.html</a></p>
]]></description><link>https://forum.qt.io/post/806950</link><guid isPermaLink="true">https://forum.qt.io/post/806950</guid><dc:creator><![CDATA[J.Hilk]]></dc:creator><pubDate>Fri, 09 Aug 2024 08:24:43 GMT</pubDate></item><item><title><![CDATA[Reply to Image &amp; release problem on Fri, 09 Aug 2024 08:13:09 GMT]]></title><description><![CDATA[<p dir="auto">windows 10 home on this laptop - and literally a new one has just arrived using windows 11.<br />
I just prefer string to QString - no real reason, just using the same one all the time just means I know where I am (forever adding .c_str() to convert for QT functions :-)<br />
If its even vaguely possibly causing a problem I could try changing it</p>
]]></description><link>https://forum.qt.io/post/806947</link><guid isPermaLink="true">https://forum.qt.io/post/806947</guid><dc:creator><![CDATA[tjl34567]]></dc:creator><pubDate>Fri, 09 Aug 2024 08:13:09 GMT</pubDate></item><item><title><![CDATA[Reply to Image &amp; release problem on Thu, 08 Aug 2024 19:01:03 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">On which version of Windows are you working ?<br />
By the way, why not use QString for your paths rather than doing these conversions ?</p>
]]></description><link>https://forum.qt.io/post/806912</link><guid isPermaLink="true">https://forum.qt.io/post/806912</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 08 Aug 2024 19:01:03 GMT</pubDate></item><item><title><![CDATA[Reply to Image &amp; release problem on Thu, 08 Aug 2024 17:10:32 GMT]]></title><description><![CDATA[<p dir="auto">yes I put in the complete path just to try to make sure it was working correctly. Really I will start from the exe location and navigate to the images folder,  but I just need it make something work first</p>
<p dir="auto">I think I've set up PATH - I added ;C:\Qt\Tools\QtCreator\bin to it which is where I found the dll's it said I was missing, but that doesn't seem to help. It all feels odd. I'm almost sure on the old version I had something similar, but certainly not under qtcreator.  maybe c:\qt\5.6\bin</p>
]]></description><link>https://forum.qt.io/post/806905</link><guid isPermaLink="true">https://forum.qt.io/post/806905</guid><dc:creator><![CDATA[tjl34567]]></dc:creator><pubDate>Thu, 08 Aug 2024 17:10:32 GMT</pubDate></item><item><title><![CDATA[Reply to Image &amp; release problem on Thu, 08 Aug 2024 14:53:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tjl34567">@<bdi>tjl34567</bdi></a> said in <a href="/post/806888">Image &amp; release problem</a>:</p>
<blockquote>
<p dir="auto">It could be something to do with how it's started I guess. i.e. I build it in qt creator and get the results above when I run from inside qtcreator, and if I just try running the exe directly I get the images are null failures in both the debug and release build.</p>
</blockquote>
<p dir="auto">Your code <code>string im = "C:/some path/some filename.jpg";</code> implies you are using an absolute path.  Is that really the case?  Behaviour would not be unexpected if you use a relative path here, as that relies on the <em>current working directory</em> which may not be the same inside vs outside <strong>Creator</strong>.</p>
<p dir="auto">Might be related for DLLs.  They must be found either in the current directory or same as executable (can't recall which, might be the latter) or on the <code>PATH</code> .</p>
]]></description><link>https://forum.qt.io/post/806891</link><guid isPermaLink="true">https://forum.qt.io/post/806891</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Thu, 08 Aug 2024 14:53:49 GMT</pubDate></item></channel></rss>