Reputation: 175
I want to read a .xml file and access its tags in c++. I used "QDomDocument":
QDomDocument m_doc;
QFile file_read( "test.xml" );
but receive this error:
"‘QDomDocument’ was not declared in this scope"
I know that I should add a library to my source code like:
#include ...
but I don’t know which library is suitable for using "QDomDocument", can any one help me, please. I appreciate your attention.
Upvotes: 0
Views: 341
Reputation: 395
Qt have well designed docs. Almost every class in Qt have own header same as class name. just type^
#include <QDomDocument>
But there in Qt is one hideout. Qt pretty big lib and it dived into few modules. And QDomDocument is placed in XML.
And for compiling you also need add line to projectfile(typical auto genereted by qtcreator [projname].pro):
QT += xml
Upvotes: 1
Reputation: 180595
QDomDocument
is part of library Qt. In order to use it you need to get the Qt library and set it up on your machine. Then you need to link your project to the Qt library.
Upvotes: 0