So you have not checked if it actually runs multiple iterations?
E.g. by having a log output inside the loop or logging the value of "i" or "row" after the loop?
Cheers,
_
Ok so let's make things a bit more clear hahaha
Well:
i = the number of the row where each piece of the query is printed
row = the total number of the quantity of rows
Those two both increment +1 each time the loop works starting with the values "i = 0" (The information is printed on the row nº 0) and "row = 1" (The table has a total of 1 row)
And then we have the number of results the query has (1 result per row) so it should print 3 total rows (SELECTED from the database) but unfortunately it only prints 1.
I understood how the code works, I asked if you have confirmed that those two variables have the expected values after the loop.
You write that "i" has the value 1, which, if taken after the loop, would mean the loop ran one iteration.
Cheers,
_
Indeed it ran 1 iteration and then stopped. Without creating a new row and without printing the new information from the query
Ok, so there is one row in your table as expected or is that row empty?
Cheers,
_
Can you simply attach the real CPP file to the post?
Ok guys I just figured it out, what I did to solve it was add a "ui->tableWidget->setRowCount(row);" at the end of the loop and actually it worked just fine. Thank you both for your help and time
Bookmarks