<?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[(resource) images not displaying]]></title><description><![CDATA[<p dir="auto">Hi all -</p>
<p dir="auto">I'm trying to use the resource system to include several small images. I've created and populated a .qrc file like so:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/e84b3094-125e-4b07-a38c-84e86ece18b4.PNG" alt="icons.PNG" class=" img-fluid img-markdown" /><br />
And in one of my .qml files, I have this:</p>
<pre><code>    Image {
        source: ":/icons/Home.png"
    }
</code></pre>
<p dir="auto">I don't get a runtime error, but my image doesn't display. I'm sure I'm leaving a step out of using the resource system. Can anyone tell me what I've missed?</p>
<p dir="auto">Qt 6.4, cmake project.</p>
<p dir="auto">Thanks...</p>
<p dir="auto"><strong>EDIT:</strong> I also added icons.qrc to my CMakeLists.txt file:</p>
<pre><code>qt_add_executable(
    appnga
    main.cpp
    icons.qrc
    resources.qrc
    clock.cpp
    clock.h
)
</code></pre>
]]></description><link>https://forum.qt.io/topic/140025/resource-images-not-displaying</link><generator>RSS for Node</generator><lastBuildDate>Thu, 12 Nov 2026 15:58:09 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/140025.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 12 Oct 2022 21:12:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to (resource) images not displaying on Mon, 17 Oct 2022 21:50:41 GMT]]></title><description><![CDATA[<p dir="auto">I found the problem. I changed the QML line above to:</p>
<pre><code>        source: "qrc:/icons/Home.png"
</code></pre>
<p dir="auto">And now it shows up just fine.</p>
]]></description><link>https://forum.qt.io/post/733019</link><guid isPermaLink="true">https://forum.qt.io/post/733019</guid><dc:creator><![CDATA[mzimmers]]></dc:creator><pubDate>Mon, 17 Oct 2022 21:50:41 GMT</pubDate></item><item><title><![CDATA[Reply to (resource) images not displaying on Wed, 12 Oct 2022 22:57:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mchinand">@<bdi>mchinand</bdi></a> I did that as well (forgot to mention it in my original post).</p>
]]></description><link>https://forum.qt.io/post/732481</link><guid isPermaLink="true">https://forum.qt.io/post/732481</guid><dc:creator><![CDATA[mzimmers]]></dc:creator><pubDate>Wed, 12 Oct 2022 22:57:30 GMT</pubDate></item><item><title><![CDATA[Reply to (resource) images not displaying on Wed, 12 Oct 2022 21:44:36 GMT]]></title><description><![CDATA[<p dir="auto">You probably need to add the following to your CMakeLists.txt file:</p>
<pre><code>set(CMAKE_AUTORCC ON)
</code></pre>
]]></description><link>https://forum.qt.io/post/732480</link><guid isPermaLink="true">https://forum.qt.io/post/732480</guid><dc:creator><![CDATA[mchinand]]></dc:creator><pubDate>Wed, 12 Oct 2022 21:44:36 GMT</pubDate></item></channel></rss>