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 load QTreeView asynchrone.
Forum Update on Monday, May 27th 2025

How to load QTreeView asynchrone.

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 464 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.
  • D Offline
    D Offline
    developer_61
    wrote on last edited by
    #1

    Hello,

    i want to load QTreeView asynchrone. So that the UI not freeze after I click on a Button and load the QTreeView.
    For now it is freeze and snychrone.

    Regards

    jsulmJ 1 Reply Last reply
    0
    • D developer_61

      Hello,

      i want to load QTreeView asynchrone. So that the UI not freeze after I click on a Button and load the QTreeView.
      For now it is freeze and snychrone.

      Regards

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

      @developer_61 said in How to load QTreeView asynchrone.:

      For now it is freeze and snychrone

      Please provide more information, especially code where you load the tree. Also, how big is that tree when it's loaded?

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

      1 Reply Last reply
      0
      • D Offline
        D Offline
        developer_61
        wrote on last edited by developer_61
        #3

        @jsulm
        i mean with freeze for that point where its loading. I want it asynchrone there.

        void MainWindow::loadQTree(const QString& string)
        {
           init(string); //here i'm using in this function an xml parse it etc. cause the tree is build of an xml
        }
        

        is there no standard to make it asynchronous?
        The files are like 28.000 Bytes big.

        jsulmJ 1 Reply Last reply
        0
        • D developer_61

          @jsulm
          i mean with freeze for that point where its loading. I want it asynchrone there.

          void MainWindow::loadQTree(const QString& string)
          {
             init(string); //here i'm using in this function an xml parse it etc. cause the tree is build of an xml
          }
          

          is there no standard to make it asynchronous?
          The files are like 28.000 Bytes big.

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

          @developer_61 said in How to load QTreeView asynchrone.:

          is there no standard to make it asynchronous?

          Use a thread for your XML parsing and send parsed data from that thread to the GUI thread to add it to the tree.
          But I'm wondering why parsing of 28kB XML would take that long? Can you show init()?

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

          1 Reply Last reply
          0
          • D Offline
            D Offline
            developer_61
            wrote on last edited by
            #5

            @jsulm how to use that thread? and is it possible to do that during this loading with for example an small gear?
            no no it is not freezing long, really short time but I still want it to be asynchronous.

            jsulmJ 1 Reply Last reply
            0
            • D developer_61

              @jsulm how to use that thread? and is it possible to do that during this loading with for example an small gear?
              no no it is not freezing long, really short time but I still want it to be asynchronous.

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

              @developer_61 said in How to load QTreeView asynchrone.:

              how to use that thread?

              Start here: https://doc.qt.io/qt-5/thread-basics.html
              "is it possible to do that during this loading with for example an small gear?" yes

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

              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