Hello!
My QTableWidget object is being filled from a database. Everything went okay until I had to sort the second column by ascending. So I wrote:When I ran the application I found that a lot of cells of the table widget are empty. Why is that so? Would anybody help me please?Qt Code:
ui.tableWidget->sortByColumn(2, Qt::AscendingOrder);To copy to clipboard, switch view to plain text mode
Added after 15 minutes:
Oh, I think I have just solved the problem. I have added ui.tableWidget->setSortingEnabled(false); before filling the widget ui.tableWidget->setItem(rowNumber, i ,item); and after that - ui.tableWidget->setSortingEnabled(true);
Now everything works fine.
Sorry for that thread. I asked a question and answered it on my own.
Bookmarks