Only the first two rows of the table are populated, but the row numbers of the table are filled as per the query result, and in print displays all the items normally.
def escreveArquivo(self):
con = MySQLdb.connect(host="localhost", user="root", passwd="pswd", db="cliente")
cursor = con.cursor()
cursor.execute('select * from cliente;')
rs = cursor.fetchall()
result = self.ui.tableWidget
result.setRowCount(len(rs))
result.setColumnCount(5)
row = 0
for i in rs:
result.setItem(row, 0, QtWidgets.QTableWidgetItem(str(i[1])))
result.setItem(row, 1, QtWidgets.QTableWidgetItem(str(i[2])))
result.setItem(row, 2, QtWidgets.QTableWidgetItem(str(i[3])))
result.setItem(row, 3, QtWidgets.QTableWidgetItem(str(i[4])))
result.setItem(row, 4, QtWidgets.QTableWidgetItem(str(i[5])))
print(i)
row =+ 1