PDA

View Full Version : QDomDocument was not declared in this scope



grantbj74
25th August 2009, 05:25
Hi

I am trying to use QDomDocument. When I try to compile I get: QDomDocument was not declared in this scope.

I heard that you need to add "QT += XML" to the pro. I tried the following and it didn't work:



TARGET = trial1
TEMPLATE = app
SOURCES += main.cpp \
startupdialog.cpp \
phonebook.cpp \
configure.cpp \
advanced.cpp \
modules/borderlayout.cpp
HEADERS += startupdialog.h \
phonebook.h \
configure.h \
advanced.h \
modules/borderlayout.h
FORMS += startupdialog.ui \
phonebook.ui \
configure.ui \
advanced.ui
RESOURCES += jddi.qrc
QT += XML



Any ideas?

Thanks
Brendan

Archimedes
25th August 2009, 05:38
Did you run qmake again for the new pro file??
Also check if you're missing some includes in your source.

nish
25th August 2009, 06:12
may be its "xml" and not "XML"

grantbj74
25th August 2009, 06:16
Thanks for reply.

I compile with QT Creator under Windows XP.

I have tried Building All.

I also added


#include <QDomDocument>


The compiler now also shows: QDomDocument: No such file or directory

I guess I must be missing something basic. :confused:

grantbj74
25th August 2009, 06:29
Thanks MrDeath

Lowercase xml did the job :D

I wonder if thats why I couldn't seem to get anything useful from QXmlStreamReader ? It did compile however (I gave up on QXmlStreamReader and had a crack at QDom).

wysota
25th August 2009, 09:43
QXmlStreamReader doesn't depend on the xml module - so the answer is "no".