Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    XML

    QML and Qt Quick
    4
    8
    2797
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mikealfa last edited by

      how to create a XML document in Qt ?

      1 Reply Last reply Reply Quote 0
      • V
        vladimir_s last edited by

        You need to work with QDomDocument, QDomNode and QDomElement classes. If you want to start from scratch, create new QDomDocument object and then populate it with elements.

        1 Reply Last reply Reply Quote 0
        • L
          leon.anavi last edited by

          You can use "QXmlStreamWriter":http://qt-project.org/doc/qt-4.8/qxmlstreamwriter.html to create XML documents. Here is a "simple example":http://www.developer.nokia.com/Community/Wiki/Generate_XML_programatically_in_Qt .

          http://anavi.org/

          1 Reply Last reply Reply Quote 0
          • M
            mikealfa last edited by

            And now how to load the XML file to @QVEctor<QString>m_map@

            1 Reply Last reply Reply Quote 0
            • JohanSolo
              JohanSolo last edited by JohanSolo

              This you'll have to code it yourself, take a look at this for instance.

              `They did not know it was impossible, so they did it.'
              -- Mark Twain

              1 Reply Last reply Reply Quote 0
              • M
                mikealfa last edited by

                didnt help :(

                1 Reply Last reply Reply Quote 0
                • JohanSolo
                  JohanSolo last edited by JohanSolo

                  Maybe try this doc page

                  Googling for "qxmlstreamreader example" gave me those two examples:
                  http://www.developer.nokia.com/Community/Wiki/Using_QXmlStreamReader_to_parse_XML_in_Qt
                  http://www.qtforum.org/article/28453/qxmlstreamreader-parsing-a-simple-xml-document.html

                  Btw, I would say that QVector< QString > is not the most appropriate storage for XML information...

                  `They did not know it was impossible, so they did it.'
                  -- Mark Twain

                  1 Reply Last reply Reply Quote 0
                  • M
                    mikealfa last edited by

                    "youtube link":www.youtube.com/watch?v=NXGE5XUrRSI&feature=youtu.be

                    i watched this video and now understood whats all there in the documentation

                    [edit: fixed link, eddy]

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post