Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to compare two xml files?
QtWS25 Last Chance

how to compare two xml files?

Scheduled Pinned Locked Moved Unsolved General and Desktop
comparexmlfile
7 Posts 3 Posters 554 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.
  • S Offline
    S Offline
    swarnalakshmi
    wrote on last edited by
    #1

    i have a xml file and i created the treeview and when i click the treeView its corressponding attribute value will be displayed on the tableview i used model for this.now i have to upload two xml files and have to compare its value in the tableview.
    if i click treeview in tableview i should be able to view the values two xml files in two colums.i tried creating two models and using the index of one treeview to other but its not working i heard something like proxy model but that also i dont understand i am a newbie so any please help me

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Why not use two QTreeView in a horizontal layout ? One model per tree view and you are good to go.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        swarnalakshmi
        wrote on last edited by
        #3

        hi there,thank you for ur reply. but i should have a single treeview and a tableview with 2 colums if i click a item in a treeview it should populate the values of xml files in the correspnding tableview colums
        is it posiible to create a treeview with xsd file
        i am really confused on how to do this

        JonBJ 1 Reply Last reply
        0
        • S swarnalakshmi

          hi there,thank you for ur reply. but i should have a single treeview and a tableview with 2 colums if i click a item in a treeview it should populate the values of xml files in the correspnding tableview colums
          is it posiible to create a treeview with xsd file
          i am really confused on how to do this

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @swarnalakshmi said in how to compare two xml files?:

          is it posiible to create a treeview with xsd file

          No, Qt does not offer this.

          Either use XML classes to read the documents and populate the tree nodes yourself, or you might want to Google for QDomDocument QTreeView to see if you want to use the former as the model for the latter.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            So you want to create a diff tool for two different trees with only one tree view ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            S 1 Reply Last reply
            0
            • SGaistS SGaist

              So you want to create a diff tool for two different trees with only one tree view ?

              S Offline
              S Offline
              swarnalakshmi
              wrote on last edited by
              #6

              @SGaist yeah there should be one treeView both the xml files will have same schema
              and i want to know how to store the xml file attribute values because when i click the treeview it should show corresponding values in tableview

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Did you check the QXmlStream bookmarks example ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                1

                • Login

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