<?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[How I do to run Maroon In Trouble example?]]></title><description><![CDATA[<p dir="auto">Hi. Is there anyone who can run Maroon in Trouble? I downloaded the source code from examples in Qt Creator and I changed the code from main.cpp to the next (the original code doesn't find shared.h):</p>
<pre><code>/*#include "../../shared/shared.h"
DECLARATIVE_EXAMPLE_MAIN(demos/maroon/maroon)*/

#include &lt;QGuiApplication&gt;
#include &lt;QQmlApplicationEngine&gt;

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QQmlApplicationEngine engine;
    engine.load(QUrl(QStringLiteral("qrc:/demos/maroon/maroon.qml")));

    return app.exec();
}
</code></pre>
<p dir="auto">I copied the <a href="http://doc.qt.io/qt-5/qtquick-demos-maroon-example.html" target="_blank" rel="noopener noreferrer nofollow ugc">code from the documentation</a> file by file and it still not working.</p>
<p dir="auto">I use Qt-Creator 3.4.1 and Qt 5.4.2 on Kubuntu 14.04. What am I doing bad?</p>
]]></description><link>https://forum.qt.io/topic/55793/how-i-do-to-run-maroon-in-trouble-example</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 03:36:28 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/55793.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 28 Jun 2015 19:19:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How I do to run Maroon In Trouble example? on Mon, 29 Jun 2015 05:50:56 GMT]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/cold_distance">@<bdi>Cold_Distance</bdi></a>,<br />
<code>QQmlApplicationEngine</code> unlike <code>QQuickView</code> does not automatically create a root window which means you have to create a <code>Window</code> or <code>ApplicationWindow</code> in the QML file.<br />
The file which you are loading <code>maroon.qml</code> does not contain a <code>Window</code> or <code>ApplicationWindow</code> as root but contains and <code>Item</code> as root. So <code>QQmlApplicationEngine</code> will <strong>fail</strong> here.<br />
To rectify it you will either need to add <code>Window</code> to QML <em><strong>OR</strong></em> use <code>QQuickView</code> load that QML.<br />
Using <code>QQuickView</code> instead of <code>QQmlApplicationEngine</code> in this case will be faster with minimal changes.</p>
]]></description><link>https://forum.qt.io/post/280224</link><guid isPermaLink="true">https://forum.qt.io/post/280224</guid><dc:creator><![CDATA[p3c0]]></dc:creator><pubDate>Mon, 29 Jun 2015 05:50:56 GMT</pubDate></item></channel></rss>