<?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[Qt 6.5 QML-in-QRC vs qt_add_qml_module. What is better?]]></title><description><![CDATA[<p dir="auto">Hello!</p>
<p dir="auto">Just got confused with new Qt functionality <a href="https://doc.qt.io/qt-6/qt-add-qml-module.html" target="_blank" rel="noopener noreferrer nofollow ugc">qt_add_qml_module()</a> The question is about what is better to use? In official documentation mentioned that both ways could be used in Qt 6.5. But what is preferable and why?</p>
<p dir="auto">For now all of projects maintained by me using QML-in-QRC and really don't know why it should be changed on <a href="https://doc.qt.io/qt-6/qt-add-qml-module.html" target="_blank" rel="noopener noreferrer nofollow ugc">qt_add_qml_module()</a> functionality.</p>
]]></description><link>https://forum.qt.io/topic/145308/qt-6-5-qml-in-qrc-vs-qt_add_qml_module-what-is-better</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 11:19:48 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/145308.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 23 May 2023 12:58:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qt 6.5 QML-in-QRC vs qt_add_qml_module. What is better? on Thu, 22 Jun 2023 13:37:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kkoehne">@<bdi>kkoehne</bdi></a> that is unfortunate. cmake is kind of messy. qmake is much simpler.</p>
]]></description><link>https://forum.qt.io/post/762334</link><guid isPermaLink="true">https://forum.qt.io/post/762334</guid><dc:creator><![CDATA[JoeCFD]]></dc:creator><pubDate>Thu, 22 Jun 2023 13:37:59 GMT</pubDate></item><item><title><![CDATA[Reply to Qt 6.5 QML-in-QRC vs qt_add_qml_module. What is better? on Thu, 22 Jun 2023 09:04:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/joecfd">@<bdi>JoeCFD</bdi></a> said in <a href="/post/762260">Qt 6.5 QML-in-QRC vs qt_add_qml_module. What is better?</a>:</p>
<blockquote>
<p dir="auto">Does qmake have the similar setting? a qrc file would be able to be applied in both qmake and cmake files, right?</p>
</blockquote>
<p dir="auto">qmake does miss the high level abstraction for QML modules.  But if you're asking whether you can embed qml files without a .qrc file ... you can:</p>
<pre><code>assets.files = file1.qml file2.qml
assets.prefix = /

RESOURCES += assets
</code></pre>
<blockquote>
<p dir="auto">Or you guys are dropping qmake?</p>
</blockquote>
<p dir="auto">Not any time soon :) But we don't develop it much further.</p>
]]></description><link>https://forum.qt.io/post/762311</link><guid isPermaLink="true">https://forum.qt.io/post/762311</guid><dc:creator><![CDATA[kkoehne]]></dc:creator><pubDate>Thu, 22 Jun 2023 09:04:21 GMT</pubDate></item><item><title><![CDATA[Reply to Qt 6.5 QML-in-QRC vs qt_add_qml_module. What is better? on Thu, 22 Jun 2023 09:00:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bogong">@<bdi>bogong</bdi></a> said in <a href="/post/762227">Qt 6.5 QML-in-QRC vs qt_add_qml_module. What is better?</a>:</p>
<blockquote>
<p dir="auto">But what about security? If there are using of qt_add_qml_module() will be it stored in application in plain QML text or it will be transformed in C++? Haven't found any info about it in any manuals? Main reason of using *.qrc within QML were security. It was making harder process of reading QMLs.</p>
</blockquote>
<p dir="auto">qt_add_qml_module() allows to use the Qt Quick Compiler , which actually generates C++ code: <a href="https://www.qt.io/blog/the-new-qtquick-compiler-technology" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.qt.io/blog/the-new-qtquick-compiler-technology</a> . If it can't be used, it falls back to qrc though.</p>
<p dir="auto">(But please note that embedding QML sources in the binary via qrc is obfuscation as best. It's not rocket science to extract the sources back if you have access to the binary).</p>
]]></description><link>https://forum.qt.io/post/762308</link><guid isPermaLink="true">https://forum.qt.io/post/762308</guid><dc:creator><![CDATA[kkoehne]]></dc:creator><pubDate>Thu, 22 Jun 2023 09:00:15 GMT</pubDate></item><item><title><![CDATA[Reply to Qt 6.5 QML-in-QRC vs qt_add_qml_module. What is better? on Wed, 21 Jun 2023 18:27:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kkoehne">@<bdi>kkoehne</bdi></a> good to know. Does qmake have the similar setting? a qrc file would be able to be applied in both qmake and cmake files, right? Or you guys are dropping qmake?</p>
]]></description><link>https://forum.qt.io/post/762260</link><guid isPermaLink="true">https://forum.qt.io/post/762260</guid><dc:creator><![CDATA[JoeCFD]]></dc:creator><pubDate>Wed, 21 Jun 2023 18:27:39 GMT</pubDate></item><item><title><![CDATA[Reply to Qt 6.5 QML-in-QRC vs qt_add_qml_module. What is better? on Wed, 21 Jun 2023 16:28:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kkoehne">@<bdi>kkoehne</bdi></a> But what about security? If there are using of qt_add_qml_module() will be it stored in application in plain QML text or it will be transformed in C++? Haven't found any info about it in any manuals? Main reason of using *.qrc within QML were security. It was making harder process of reading QMLs.</p>
]]></description><link>https://forum.qt.io/post/762227</link><guid isPermaLink="true">https://forum.qt.io/post/762227</guid><dc:creator><![CDATA[bogong]]></dc:creator><pubDate>Wed, 21 Jun 2023 16:28:09 GMT</pubDate></item><item><title><![CDATA[Reply to Qt 6.5 QML-in-QRC vs qt_add_qml_module. What is better? on Thu, 15 Jun 2023 07:12:54 GMT]]></title><description><![CDATA[<p dir="auto">qt_add_qml_module() is indeed the way to go, as it standardizes  a lot of things, and therefore makes qml more toolable.</p>
<p dir="auto">For the 'cluttering' aspect, you can use include() and CMake variables to separate things if you want to. But personally, I think the list of files is the core of a build system, so I think 'hiding' it in a separate .qrc file is actually a bit of a misfeature ;)</p>
]]></description><link>https://forum.qt.io/post/761493</link><guid isPermaLink="true">https://forum.qt.io/post/761493</guid><dc:creator><![CDATA[kkoehne]]></dc:creator><pubDate>Thu, 15 Jun 2023 07:12:54 GMT</pubDate></item><item><title><![CDATA[Reply to Qt 6.5 QML-in-QRC vs qt_add_qml_module. What is better? on Thu, 15 Jun 2023 06:53:02 GMT]]></title><description><![CDATA[<p dir="auto">I am asking myself the same question - I think I read somewhere that adding qml files as well as image resources with qt_add_qml_module() is really the preferred way (because of linting, cachegen and so on) - I think it was in one of the qt blog post regarding this topic.<br />
My main concern is that this really clutters the CMakeLists when you have many files.</p>
]]></description><link>https://forum.qt.io/post/761490</link><guid isPermaLink="true">https://forum.qt.io/post/761490</guid><dc:creator><![CDATA[felix_u]]></dc:creator><pubDate>Thu, 15 Jun 2023 06:53:02 GMT</pubDate></item><item><title><![CDATA[Reply to Qt 6.5 QML-in-QRC vs qt_add_qml_module. What is better? on Thu, 15 Jun 2023 02:05:52 GMT]]></title><description><![CDATA[<p dir="auto">I have same question, do you resolve it ?</p>
]]></description><link>https://forum.qt.io/post/761485</link><guid isPermaLink="true">https://forum.qt.io/post/761485</guid><dc:creator><![CDATA[eton-esi]]></dc:creator><pubDate>Thu, 15 Jun 2023 02:05:52 GMT</pubDate></item></channel></rss>