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. [SOLVED]QML read web .xml information

[SOLVED]QML read web .xml information

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.3k 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
    mariusmssj
    wrote on last edited by
    #1

    Hey guys,

    I am working on a VLC remote and I am able to send commands to the player via this function:
    @function passCommands(command)
    {
    var http = new XMLHttpRequest()
    var url = "http://" + ip + ":" + port + "/requests/status.xml?command=" + command;

    http.open("POST", url, true);
    
    // Send the proper header information along with the request
    http.setRequestHeader("Authorization", "Basic " + Qt.btoa(username + ":" + password));
    http.send();
    

    }@

    I am still quite new to QML so I am having issues of writing a function to read the information from http://192.168.2.2:8080/requests/status.xml file, which does have a simple sturcture:
    @<root>
    <fullscreen>false</fullscreen>
    <aspectratio>default</aspectratio>
    <audiodelay>0</audiodelay>
    <apiversion>3</apiversion>
    <currentplid>16</currentplid>
    <time>1</time>
    <volume>128</volume>
    <length>6450</length>
    <random>false</random>@

    Does anyone have any tips or anything of how I would go about extracting information from the status.xml file?

    Thank you :)

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Can you look at XmlListModel ? This will help you. Also look at XmlHTTPRequest example to solve your issue. If you need further help, do let me know.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mariusmssj
        wrote on last edited by
        #3

        Yep it all works now :) thank you

        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