Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. XML
QtWS25 Last Chance

XML

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 4 Posters 3.2k Views
  • 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 Offline
    M Offline
    mikealfa
    wrote on last edited by
    #1

    how to create a XML document in Qt ?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vladimir_s
      wrote on last edited by
      #2

      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
      0
      • L Offline
        L Offline
        leon.anavi
        wrote on last edited by
        #3

        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
        0
        • M Offline
          M Offline
          mikealfa
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • JohanSoloJ Offline
            JohanSoloJ Offline
            JohanSolo
            wrote on last edited by JohanSolo
            #5

            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
            0
            • M Offline
              M Offline
              mikealfa
              wrote on last edited by
              #6

              didnt help :(

              1 Reply Last reply
              0
              • JohanSoloJ Offline
                JohanSoloJ Offline
                JohanSolo
                wrote on last edited by JohanSolo
                #7

                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
                0
                • M Offline
                  M Offline
                  mikealfa
                  wrote on last edited by
                  #8

                  "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
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved