<?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[QML Local Directory Imports will be undefined after an uncertain amount of time]]></title><description><![CDATA[<p dir="auto">The program we develop can open/handle different projects, these projects are loaded via a <code>Loader {}</code></p>
<p dir="auto">The loaded QML project files access other project specific QMLs with locally imported directories e.g.</p>
<pre><code>import "devices" as Devices
</code></pre>
<p dir="auto">Where <em>devices</em> is a folder relative to the QML file that uses the import.<br />
This kind of import works for weeks(the program is running 24/7 at a customer) and the code can access the QML files inside the import e.g. <em>Devices.Lan</em> etc...<br />
However sometimes after a long time for some reason the <em><strong>Devices</strong></em> import will be undefined and all other local folder imports as well.</p>
<p dir="auto">These local folders only have qmldir file in them if there are Singleton QML files e.g.</p>
<pre><code>singleton Lan 1.0 Lan.qml
</code></pre>
<p dir="auto">The projects and their QMLs are not included during build<br />
<code>Qt 6.7.3, mingw 11.20, Windows 11</code></p>
<p dir="auto">Have anyone experienced this?<br />
Some AI suggestion for this problem was (I couldn't find anything about this problem):</p>
<ul>
<li>Creating proper qmldir files for each folder</li>
<li>Build the program with <code>QML_DISABLE_DISK_CACHE=1</code> flag</li>
<li>Add every folder path to qml import paths</li>
</ul>
<p dir="auto">I haven't tried the above suggestions yet as I haven't been able to reproduce the problem locally.<br />
But just in case someone has some insights/ideas I wanted to post here, any kind of discussion might help.</p>
]]></description><link>https://forum.qt.io/topic/164631/qml-local-directory-imports-will-be-undefined-after-an-uncertain-amount-of-time</link><generator>RSS for Node</generator><lastBuildDate>Sat, 20 Jun 2026 04:08:31 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164631.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 04 May 2026 08:11:25 GMT</pubDate><ttl>60</ttl></channel></rss>