Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
XMLPatterns, QCoreApplications and the event loop
jc-denton last edited by
I want to use just the Qt XML library with the DOM parser and the QtXMLPatterns library to process XQueries, no gui. Looking at the source of the xmlpatterns utility it just instantiates QCoreApplication. My question now: Why do I need to instantiate QCoreApplication and what about event processing. QXMLPatterns also depends on QtNetwork, which makes sense since one can access remote resources form XQueries. This however raises the question weather any events need to be processed? When I'm done with XML processing I just call app.exit(), where app is the instance of QCoreApplication.
I can't speak authoritatively about your particular question about QtXMLPatterns and such, but it is worth noting that QCoreApplication does set up some other things behind the scenes and provides some foundation to Qt beyond just the main event loop.
To what extent the QtXML stuff uses these things, I'm not sure without looking at the source code.
goetz last edited by
In case the XML part needs to utilize the network for downloading some missing parts, it needs an event loop running - that's provided by QCoreApplication.