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. xml file
Qt 6.11 is out! See what's new in the release blog

xml file

Scheduled Pinned Locked Moved Unsolved General and Desktop
16 Posts 2 Posters 5.8k 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
    siva9111
    wrote on last edited by
    #7

    hi ,
    text files are loading but xml files are not loading by QUrl

    jsulmJ 1 Reply Last reply
    0
    • S siva9111

      hi ,
      text files are loading but xml files are not loading by QUrl

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #8

      @siva9111 said in xml file:

      xml files are not loading by QUrl

      XML files are text files, they should load same way other files do.
      Please show the code where you load the XML file in your text browser.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        siva9111
        wrote on last edited by
        #9

        this is working :
        QUrl url=QUrl::fromLocalFile("C:/Users/Administrator/Desktop/siva.txt");
        ui.textBrowser->setSource(url);

        this not loading:
        QUrl url=QUrl::fromLocalFile("C:/Users/Administrator/Desktop/xmlinfo.xml");
        ui.textBrowser->setSource(url);

        jsulmJ 1 Reply Last reply
        0
        • S siva9111

          this is working :
          QUrl url=QUrl::fromLocalFile("C:/Users/Administrator/Desktop/siva.txt");
          ui.textBrowser->setSource(url);

          this not loading:
          QUrl url=QUrl::fromLocalFile("C:/Users/Administrator/Desktop/xmlinfo.xml");
          ui.textBrowser->setSource(url);

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #10

          @siva9111 said in xml file:

          C:/Users/Administrator/Desktop/xmlinfo.xml

          Does this file exist?
          What does url.isValid() return?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            siva9111
            wrote on last edited by
            #11

            file exist

            jsulmJ 1 Reply Last reply
            1
            • S siva9111

              file exist

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #12

              @siva9111 What about my second question?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • S Offline
                S Offline
                siva9111
                wrote on last edited by
                #13

                if(url.isValid()){
                QMessageBox::information(0,"info",url.errorString());
                }

                iam executed above code ....messagebox displayed

                (due to new user iam unable to replying to you sir....its taking 10min time for next reply ...see ur inbox sir)

                jsulmJ 1 Reply Last reply
                1
                • S siva9111

                  if(url.isValid()){
                  QMessageBox::information(0,"info",url.errorString());
                  }

                  iam executed above code ....messagebox displayed

                  (due to new user iam unable to replying to you sir....its taking 10min time for next reply ...see ur inbox sir)

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #14

                  @siva9111 Does it work if you use https://doc.qt.io/qt-5/qtextedit.html#setPlainText instead of setSource?

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    siva9111
                    wrote on last edited by
                    #15

                    does not work

                    jsulmJ 1 Reply Last reply
                    0
                    • S siva9111

                      does not work

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #16

                      @siva9111 said in xml file:

                      does not work

                      Please show the code. setPlainText() should always work...

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      2

                      • Login

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