-
Bug
-
Resolution: Cannot Reproduce
-
P1: Critical
-
None
-
5.1.0 , 5.2.0 Beta1
-
None
-
MacOSx 10.7, 10.8 & 10.9 with Qt5.1/Qt5.2 beta
I'm trying to use QtXmlPatterns module in order to parse an XML file. Unfortunately using Qt5.1 on MacOsX 10.7&10.8 I found a problem I have not with Qt4.8.5.
#include <QCoreApplication> #include <QGuiApplication> #include <QXmlQuery> #include <QStringList> #include <QDebug> int main(int argc, char *argv[]) { //QGuiApplication a(argc, argv); QCoreApplication a(argc, argv); QXmlQuery qry; qry.setQuery("doc(\"file.xml\")"); QStringList lst; qry.evaluateTo(&lst); qDebug() << lst; return 0; }
this is the .pro I'm using.
QT += core gui xmlpatterns TARGET = Test TEMPLATE = app CONFIG -= app_bundle SOURCES += main.cpp
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.
On Windows and on Linux the same program run smoothly even if I use the QCoreApplication or the QGuiApplication or the QApplication.
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).