<?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[Icon resource not registering]]></title><description><![CDATA[<p dir="auto">I'm trying to set the title bar icon for my program using an ico file registered in a qrc file but I can't get it to show up.</p>
<p dir="auto">I tried these calls, using the copied file path by right clicking the resource.</p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/8672ff20-6fda-4615-987d-d94e3228c114.PNG" alt="1.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="https://ddgobkiprc33d.cloudfront.net/4c111d06-3244-4648-8f74-e38006d4a080.PNG" alt="2.PNG" class=" img-fluid img-markdown" /></p>
<p dir="auto">In main function,<br />
app.setWindowIcon(QIcon(":/icon.ico"));<br />
or<br />
app.setWindowIcon(QIcon("qrc:/icon.ico"));</p>
<p dir="auto">It doesn't show up. This function works if I supply a direct filepath. Maybe I'm missing something in the makefile? It currently has</p>
<p dir="auto">qt_add_qml_module(RESOURCES resources.qrc)</p>
<p dir="auto">How can I set the window title bar icon using a resource file?</p>
]]></description><link>https://forum.qt.io/topic/156092/icon-resource-not-registering</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Apr 2026 10:40:50 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/156092.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 17 Apr 2024 13:21:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Icon resource not registering on Wed, 17 Apr 2024 15:42:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> No, the full function is:</p>
<p dir="auto">qt_add_qml_module(appTM_QML<br />
URI TM_QML<br />
VERSION 1.0<br />
QML_FILES Main.qml<br />
SOURCES tm.h tm.cpp<br />
SOURCES database.h database.cpp<br />
QML_FILES SpreadGraph.qml<br />
QML_FILES Data_View.qml<br />
SOURCES serialporthandler.h serialporthandler.cpp<br />
QML_FILES<br />
QML_FILES SerialSettings.qml<br />
QML_FILES GlobalObject.qml<br />
RESOURCES resources.qrc<br />
)</p>
<p dir="auto">The resources part was auto added by QT creator when I created the qrc file.</p>
]]></description><link>https://forum.qt.io/post/797053</link><guid isPermaLink="true">https://forum.qt.io/post/797053</guid><dc:creator><![CDATA[EqiupmentConnected]]></dc:creator><pubDate>Wed, 17 Apr 2024 15:42:44 GMT</pubDate></item><item><title><![CDATA[Reply to Icon resource not registering on Wed, 17 Apr 2024 14:46:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/eqiupmentconnected">@<bdi>EqiupmentConnected</bdi></a> said in <a href="/post/797039">Icon resource not registering</a>:</p>
<blockquote>
<p dir="auto">qt_add_qml_module(RESOURCES resources.qrc)</p>
</blockquote>
<p dir="auto">Does your qml module really have the name 'RESOURCES' ?</p>
]]></description><link>https://forum.qt.io/post/797047</link><guid isPermaLink="true">https://forum.qt.io/post/797047</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Wed, 17 Apr 2024 14:46:39 GMT</pubDate></item></channel></rss>