I am not able to populate this table, I do not knoe what I'm doing wrong, I have been reading some posts, and seems like everything is correct...however, nothing is appearing in my table.
Here is my code:
The totalProcess list is like that totalProcess = [ [list1],[list2],[list3]...]
def updateTable(self,totalProcess):
for x in xrange(10):
for i in xrange(len(totalProcess[x])):
item = QtGui.QTableWidgetItem(totalProcess[x][i])
self.ui.tableWidgetResults.setItem(x,i,item)
Any help will be appreciated!!
Have QTableWidget's rowCount and columnCount attributes been set? QTableWidget will only display items within them. Otherwise the code is correct.
PS: There is no need to loop through the indices as in some other languages; you can use
for x in list
to iterate through the element of the list (x
will be the element of the list).