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. It is posible to update a QTablewidget row by row?

It is posible to update a QTablewidget row by row?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 463 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.
  • E Offline
    E Offline
    electric-dev
    wrote on last edited by
    #1

    Hello good evening ,I am making a small application that obtains IP numbers from a network and display them in a QTablewidget .The problem that I am facing is that the IP numbers are displayed in the table all at the same time and I would like them to be displayed one by one as they are obtained ,can this be achieved with a QTablewidget ?

    jsulmJ JonBJ 2 Replies Last reply
    0
    • JonBJ JonB

      @electric-dev
      As @jsulm has said there ought be no problem. If you are not seeing updates that sounds like you might be blocking the Qt event loop? Do you perchance have code like

      while waitForAndGetAnIPNumberUntilNoMore()
          updateTableWidget();
      

      ? That kind of approach, which we see from beginners, won't work as it does not allow event loop to be re-entered and hence the update to be shown. Instead you would see all updates in one go when the while loop finally exits.

      E Offline
      E Offline
      electric-dev
      wrote on last edited by
      #5

      @JonB Hello, good morning, you are right, now I was able to solve the problem I had using QThread, thank you.

      1 Reply Last reply
      0
      • E electric-dev

        Hello good evening ,I am making a small application that obtains IP numbers from a network and display them in a QTablewidget .The problem that I am facing is that the IP numbers are displayed in the table all at the same time and I would like them to be displayed one by one as they are obtained ,can this be achieved with a QTablewidget ?

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

        @electric-dev said in It is posible to update a QTablewidget row by row?:

        can this be achieved with a QTablewidget ?

        Sure, just add each IP as soon as you receive it. What exact problem do you have?

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

        E 1 Reply Last reply
        1
        • E electric-dev

          Hello good evening ,I am making a small application that obtains IP numbers from a network and display them in a QTablewidget .The problem that I am facing is that the IP numbers are displayed in the table all at the same time and I would like them to be displayed one by one as they are obtained ,can this be achieved with a QTablewidget ?

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

          @electric-dev
          As @jsulm has said there ought be no problem. If you are not seeing updates that sounds like you might be blocking the Qt event loop? Do you perchance have code like

          while waitForAndGetAnIPNumberUntilNoMore()
              updateTableWidget();
          

          ? That kind of approach, which we see from beginners, won't work as it does not allow event loop to be re-entered and hence the update to be shown. Instead you would see all updates in one go when the while loop finally exits.

          E 1 Reply Last reply
          0
          • jsulmJ jsulm

            @electric-dev said in It is posible to update a QTablewidget row by row?:

            can this be achieved with a QTablewidget ?

            Sure, just add each IP as soon as you receive it. What exact problem do you have?

            E Offline
            E Offline
            electric-dev
            wrote on last edited by electric-dev
            #4

            @jsulm Hello, good morning, I was able to solve it using QThread.Thank you

            1 Reply Last reply
            0
            • JonBJ JonB

              @electric-dev
              As @jsulm has said there ought be no problem. If you are not seeing updates that sounds like you might be blocking the Qt event loop? Do you perchance have code like

              while waitForAndGetAnIPNumberUntilNoMore()
                  updateTableWidget();
              

              ? That kind of approach, which we see from beginners, won't work as it does not allow event loop to be re-entered and hence the update to be shown. Instead you would see all updates in one go when the while loop finally exits.

              E Offline
              E Offline
              electric-dev
              wrote on last edited by
              #5

              @JonB Hello, good morning, you are right, now I was able to solve the problem I had using QThread, thank you.

              1 Reply Last reply
              0
              • E electric-dev has marked this topic as solved on

              • Login

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