How to add item to an existing QTableWidget?
-
wrote on 8 Jan 2015, 14:45 last edited by
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 ?
-
wrote on 9 Jan 2015, 07:54 last edited by
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. -
wrote on 9 Jan 2015, 07:57 last edited by
Looking for columnCount() too then?
-
wrote on 9 Jan 2015, 07:57 last edited by
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
-
wrote on 9 Jan 2015, 07:59 last edited by
Andre will it work if I have 10X4 table and the last item is set in the cell with position 4x2?
-
wrote on 9 Jan 2015, 08:12 last edited by
Then, to me, it is not clear what you are after.
6/7