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. How to ativate/deactivate XmlListModel via JavaScript
Forum Updated to NodeBB v4.3 + New Features

How to ativate/deactivate XmlListModel via JavaScript

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.7k 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.
  • M Offline
    M Offline
    michprev
    wrote on last edited by
    #1

    Hi,
    I need to deactivate my XmlListModel after start and activate it after my button click.
    How can I do it?

    I tried to set source after my button click but XmlListModel.status returns 2 so it seems like I can not change source via JavaScript.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbrasser
      wrote on last edited by
      #2

      Hi,

      It should be okay to change source via JavaScript -- can you post a code snippet demonstrating the issue?

      Regards,
      Michael

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

        Hi,
        I am sorry for a late reply.

        Example:
        @
        xml.source = "adress";
        console.log(xml.source); //correct
        xml.reload();
        x = 0;
        while (xml.progress != 1) {
        console.log (xml.progress + "\n" + xml.status + "\n" + "---------------------------"); //the progress is always 0 and the status is 2
        x++;
        if (x > 25) {
        break;
        }
        }
        @

        There are not any XmlRole keys in XmlListModel.

        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