<?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[QGuiApplication &amp; QXmlQuery problems on qt5]]></title><description><![CDATA[<p dir="auto">I'm trying to use QtXmlPatterns module in order to parse an XML file. Unfortunately using Qt5.1 on MacOsX 10.7&amp;10.8 I found a problem I have not with Qt4.8.5.</p>
<p dir="auto">@#include &lt;QCoreApplication&gt;<br />
#include &lt;QGuiApplication&gt;<br />
#include &lt;QXmlQuery&gt;<br />
#include &lt;QStringList&gt;<br />
#include &lt;QDebug&gt;</p>
<p dir="auto">int main(int argc, char *argv[])<br />
{<br />
//QGuiApplication a(argc, argv);<br />
QCoreApplication a(argc, argv);<br />
QXmlQuery qry;<br />
qry.setQuery("doc("file.xml")");<br />
QStringList lst;<br />
qry.evaluateTo(&amp;lst);<br />
qDebug() &lt;&lt; lst;<br />
return 0;<br />
}@</p>
<p dir="auto">this is the .pro I'm using.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qt">@<bdi>QT</bdi></a> += core gui xmlpatterns<br />
TARGET = Test<br />
TEMPLATE = app<br />
CONFIG -= app_bundle<br />
SOURCES += main.cpp@</p>
<p dir="auto">If I run a QCoreApplication everything works properly, instead if I switch on QGuiApplication (or a QApplication) this small program hangs forever on the evaluteTo function. It doesn't matter if file.xml exists or not.</p>
<p dir="auto">On Windows and on Linux the same program run smoothly even if I use the QCoreApplication or the QGuiApplication or the QApplication.</p>
<p dir="auto">I tried also to play a little with the QXmlQuery functions. If I call the setFocus function I got the same behaviour (with QCoreApplication everything it's ok, with QGuiApplication it hangs for ever on the setFocus function).</p>
<p dir="auto">Suggestions?</p>
]]></description><link>https://forum.qt.io/topic/32372/qguiapplication-qxmlquery-problems-on-qt5</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 23:21:07 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/32372.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 25 Sep 2013 09:37:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QGuiApplication &amp; QXmlQuery problems on qt5 on Wed, 25 Sep 2013 11:00:23 GMT]]></title><description><![CDATA[<p dir="auto">I tried it but Unfortunately I get the same behaviour.</p>
]]></description><link>https://forum.qt.io/post/196644</link><guid isPermaLink="true">https://forum.qt.io/post/196644</guid><dc:creator><![CDATA[inopportuno]]></dc:creator><pubDate>Wed, 25 Sep 2013 11:00:23 GMT</pubDate></item><item><title><![CDATA[Reply to QGuiApplication &amp; QXmlQuery problems on qt5 on Wed, 25 Sep 2013 09:46:11 GMT]]></title><description><![CDATA[<p dir="auto">You should run the event loop:<br />
@<br />
return a.exec();<br />
@</p>
<p dir="auto">Otherwise, it might be a bug.</p>
]]></description><link>https://forum.qt.io/post/196629</link><guid isPermaLink="true">https://forum.qt.io/post/196629</guid><dc:creator><![CDATA[sierdzio]]></dc:creator><pubDate>Wed, 25 Sep 2013 09:46:11 GMT</pubDate></item></channel></rss>