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. Open multiple xml files in qt

Open multiple xml files in qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 425 Views 1 Watching
  • 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.
  • Q Offline
    Q Offline
    QtisHard
    wrote on last edited by
    #1

    I have to open 3 different xml files in 3 different tab widgets in qt.

    Can anyone suggest how I should do this?
    Is it possible to open more than 1 xml file in qt at a time?

    JonBJ 1 Reply Last reply
    0
    • Q QtisHard

      I have to open 3 different xml files in 3 different tab widgets in qt.

      Can anyone suggest how I should do this?
      Is it possible to open more than 1 xml file in qt at a time?

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

      @QtisHard said in Open multiple xml files in qt:

      Is it possible to open more than 1 xml file in qt at a time?

      Of course! Just do what you say, if you have 3 separate XML documents to use on 3 different tabs then just do so.

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        QtisHard
        wrote on last edited by
        #3

        @JonB I am unable to open multiple XML files in QT in different functions using QFile. Can you please guide me towards what I should use?

        The program crashes if I try to open more than 1 XML file at a time.

        QFile f("C:/Users/Tanya/Desktop/QTProblems/finalproject/features.xml") ;
        QFile filename("C:/Users/Tanya/Desktop/QTProblems/finalproject/ages.xml") ;
        QFile file("C:/Users/Tanya/Desktop/QTProblems/finalproject/characters.xml") ;

        Thank you so much for your help @JonB

        JonBJ 1 Reply Last reply
        0
        • Q QtisHard

          @JonB I am unable to open multiple XML files in QT in different functions using QFile. Can you please guide me towards what I should use?

          The program crashes if I try to open more than 1 XML file at a time.

          QFile f("C:/Users/Tanya/Desktop/QTProblems/finalproject/features.xml") ;
          QFile filename("C:/Users/Tanya/Desktop/QTProblems/finalproject/ages.xml") ;
          QFile file("C:/Users/Tanya/Desktop/QTProblems/finalproject/characters.xml") ;

          Thank you so much for your help @JonB

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

          @QtisHard
          I have no idea why this is. It really doesn't matter whether you have multiple XML files or multiple any-kind of files. Each file/XML file/QFile has (or should have) nothing to do with one another. You have some error in your code if it "crashes" or one interferes with another.

          1 Reply Last reply
          1
          • M Offline
            M Offline
            mchinand
            wrote on last edited by mchinand
            #5

            Use a debugger to see exactly where it is crashing. I would create a function that takes a filename QString as a parameter and that returns a QString that contains the contents of the given file. You would then call that function once for each of your XML files.

            Show more of your code; you've only shared code that creates three instances of QFile.

            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