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