Parsing xml file [solved]
i want to load an xml file which have a name choose by the user. How can I do it??
Qt offers 3 ways to parse Xml files:
- "QXmlStreamReader":http://qt-project.org/doc/qt-5/QXmlStreamReader.html - part of QtCore: is very fast, but not so easy to implement
- "QDom":http://qt-project.org/doc/qt-5/qdomdocument.html - slower, more memory-heavy, but easy to implement
- QXmlReader/ "QXmlSimpleReader":http://qt-project.org/doc/qt-5/qxmlsimplereader.html
and For choosing a file use
QString filename = QFileDialog::getOpenFileName();
I tried to use QFileDialog but i have an error when running the program "no gui is being used"
have you added QT +=gui in your .pro file ?
and also check whether you are using QCoreApplication or QApplication.
in your main function.
"no gui being used " error occurs when you use any gui in QCoreApplication.
so replace QCoreApllication to QApplication.
hope it'll help
thanks for your help! it works
it's nice that your problem is solved Please prepend [Solved] in your title so other members can see it as solved.