<?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[Load QML File from Source with QUrl]]></title><description><![CDATA[<p dir="auto">For the QLocation Plugin i try to load a QML File to a QGraphicsView and find this <a href="http://doc.qt.io/qt-4.8/qml-integration.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-4.8/qml-integration.html</a><br />
but at the moment i get an Assert like this with following Code.</p>
<pre><code>QQmlEngine *engine = new QQmlEngine();
        QQmlComponent component(engine, QUrl::fromLocalFile("qrc:/qml/medislocation.qml"));
        QGraphicsObject *object = qobject_cast&lt;QGraphicsObject*&gt;(component.create());
        ui-&gt;gvMedisLocation-&gt;scene()-&gt;addItem(object);
</code></pre>
<pre><code>ASSERT: "!url.isRelative() &amp;&amp; (QQmlFile::urlToLocalFileOrQrc(url).isEmpty() || !QDir::isRelativePath(QQmlFile::urlToLocalFileOrQrc(url)))" in file qml\qqmltypeloader.cpp, line 1637 qml\qqmltypeloader.cpp: 1637
</code></pre>
<p dir="auto">Anyone can explain me that? I try to import QLocation in my DesktopApp and i dont use QtQuick, so i need to import for this Map Function a QML File.</p>
]]></description><link>https://forum.qt.io/topic/84015/load-qml-file-from-source-with-qurl</link><generator>RSS for Node</generator><lastBuildDate>Fri, 23 Oct 2026 14:36:26 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/84015.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 09 Oct 2017 10:36:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Load QML File from Source with QUrl on Tue, 10 Oct 2017 06:54:15 GMT]]></title><description><![CDATA[<p dir="auto">@Fuel said in <a href="/post/419725">Load QML File from Source with QUrl</a>:</p>
<blockquote>
<p dir="auto">Both Arguments dont work. I get the same Assert.</p>
</blockquote>
<p dir="auto">really? The 2 messages seem pretty different to me. So i would say your initial issue is solved.<br />
Now you have another one. But i don't know whats the cause though.</p>
]]></description><link>https://forum.qt.io/post/419799</link><guid isPermaLink="true">https://forum.qt.io/post/419799</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Tue, 10 Oct 2017 06:54:15 GMT</pubDate></item><item><title><![CDATA[Reply to Load QML File from Source with QUrl on Mon, 09 Oct 2017 18:56:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/raven-worx">@<bdi>raven-worx</bdi></a> said in <a href="/post/419610">Load QML File from Source with QUrl</a>:</p>
<blockquote>
<p dir="auto">Try QUrl::fromLocalFile(":/qml/medislocation.qml")) or even qrc:///qml/medislocation.qml") instead</p>
</blockquote>
<p dir="auto">Both Arguments dont work. I get the same Assert.</p>
<p dir="auto">When i use this QUrl::fromLocalFile(":/qml/medislocation.qml")) i get this</p>
<pre><code>QML debugging is enabled. Only use this in a safe environment.
QML Debugger: Waiting for connection on port 56726...
[09:20:53:08:628][10364] IGIESW c:\users\benni\documents\build-kt-desktop_qt_5_9_2_mingw_32bit2-debug\debug\kt.exe found in whitelist: NO
[09:20:53:08:705][10364] IGIWHW Game c:\users\benni\documents\build-kt-desktop_qt_5_9_2_mingw_32bit2-debug\debug\kt.exe found in whitelist: NO
setGeometry: Unable to set geometry 100x100+880+440 on QQuickWindow/''. Resulting geometry:  120x100+880+440 (frame: 8, 31, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 0x0, maximum size: 16777215x16777215).
ASSERT: "!m_thread.isRunning()" in file qqmldebugserver.cpp, line 655
</code></pre>
]]></description><link>https://forum.qt.io/post/419725</link><guid isPermaLink="true">https://forum.qt.io/post/419725</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 09 Oct 2017 18:56:40 GMT</pubDate></item><item><title><![CDATA[Reply to Load QML File from Source with QUrl on Mon, 09 Oct 2017 12:41:46 GMT]]></title><description><![CDATA[<p dir="auto">@Fuel<br />
<code>QUrl::fromLocalFile()</code> expects a file path and returns an URL, so no need to already provide an URL.<br />
Try <code>QUrl::fromLocalFile(":/qml/medislocation.qml"))</code> or even <code>qrc:///qml/medislocation.qml")</code> instead</p>
]]></description><link>https://forum.qt.io/post/419610</link><guid isPermaLink="true">https://forum.qt.io/post/419610</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Mon, 09 Oct 2017 12:41:46 GMT</pubDate></item></channel></rss>