Results 1 to 6 of 6

Thread: QDomDocument was not declared in this scope

  1. #1
    Join Date
    Aug 2009
    Location
    Brisbane, Australia
    Posts
    75
    Thanks
    18
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QDomDocument was not declared in this scope

    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:

    Qt Code:
    1. TARGET = trial1
    2. TEMPLATE = app
    3. SOURCES += main.cpp \
    4. startupdialog.cpp \
    5. phonebook.cpp \
    6. configure.cpp \
    7. advanced.cpp \
    8. modules/borderlayout.cpp
    9. HEADERS += startupdialog.h \
    10. phonebook.h \
    11. configure.h \
    12. advanced.h \
    13. modules/borderlayout.h
    14. FORMS += startupdialog.ui \
    15. phonebook.ui \
    16. configure.ui \
    17. advanced.ui
    18. RESOURCES += jddi.qrc
    19. QT += XML
    To copy to clipboard, switch view to plain text mode 

    Any ideas?

    Thanks
    Brendan

  2. #2
    Join Date
    Aug 2009
    Location
    Greece, Chania
    Posts
    63
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: QDomDocument was not declared in this scope

    Did you run qmake again for the new pro file??
    Also check if you're missing some includes in your source.

  3. #3
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QDomDocument was not declared in this scope

    may be its "xml" and not "XML"

  4. The following user says thank you to nish for this useful post:

    grantbj74 (25th August 2009)

  5. #4
    Join Date
    Aug 2009
    Location
    Brisbane, Australia
    Posts
    75
    Thanks
    18
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDomDocument was not declared in this scope

    Thanks for reply.

    I compile with QT Creator under Windows XP.

    I have tried Building All.

    I also added
    Qt Code:
    1. #include <QDomDocument>
    To copy to clipboard, switch view to plain text mode 

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

    I guess I must be missing something basic.

  6. #5
    Join Date
    Aug 2009
    Location
    Brisbane, Australia
    Posts
    75
    Thanks
    18
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDomDocument was not declared in this scope

    Thanks MrDeath

    Lowercase xml did the job

    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).

  7. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDomDocument was not declared in this scope

    QXmlStreamReader doesn't depend on the xml module - so the answer is "no".
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. qssl
    By jsmith in forum Qt Programming
    Replies: 29
    Last Post: 7th April 2009, 22:21
  2. nmake error during .pro compiling
    By mattia in forum Installation and Deployment
    Replies: 5
    Last Post: 18th June 2008, 10:15
  3. Just for fun game
    By vermarajeev in forum Qt-based Software
    Replies: 6
    Last Post: 13th December 2007, 21:52
  4. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  5. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.