Parsing xml file [solved]
General and Desktop
8
Posts
3
Posters
2.0k
Views
1
Watching
-
wrote on 25 Feb 2014, 15:59 last edited by
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
-
wrote on 26 Feb 2014, 05:40 last edited by
hii ablch,
and For choosing a file use
QString filename = QFileDialog::getOpenFileName(); -
wrote on 26 Feb 2014, 10:59 last edited by
I tried to use QFileDialog but i have an error when running the program "no gui is being used"
-
wrote on 26 Feb 2014, 11:03 last edited by
have you added QT +=gui in your .pro file ?
-
wrote on 26 Feb 2014, 11:16 last edited by
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
-
wrote on 26 Feb 2014, 11:44 last edited by
thanks for your help! it works
-
wrote on 26 Feb 2014, 12:14 last edited by
it's nice that your problem is solved Please prepend [Solved] in your title so other members can see it as solved.
thanks
8/8