How to add item to an existing QTableWidget?
-
Hello again!
I have a tableWidget and I add data to it from input interface, I cannot add a new item at the next of the last item, How can I do it? how can I find the last position in the QTableWidget?
thank you!
-
Hi,
Do you mean rowCount() - 1 ?
-
No, it will work for QlistWidget, but for QTableWidget(X.Y) this is not enough. if I had QlistWidget also it would help me because
X= listWidget.count()/tableWidget.columnCount() and
Y = listWidget.count()%tableWidget.columnCount(); but I have only
QtableWidget. -
Looking for columnCount() too then?
-
and I can do it by using nested for loop and check each cell if it's NULL or not, but that's not very good solution, I'm interested if there's any built in method
-
Andre will it work if I have 10X4 table and the last item is set in the cell with position 4x2?
-
Then, to me, it is not clear what you are after.