I have periodically action to insert a single rows in existing QTableList.
Problem is that inserted row does not display items correctly in the right place.
I think it only happens when QtableList has set.

Qt Code:
  1. this->sortItems( 1, Qt::AscendingOrder );
To copy to clipboard, switch view to plain text mode 

When I remove sorting new rows appears on the bottom and all row items are displayed just find.

This is how I do it.

Qt Code:
  1. void ListView::insertRowFile(File *file) {
  2. DEBUG;
  3.  
  4. int row = this->rowCount();
  5. this->setRowCount(row+1);
  6.  
  7. dateItem->setText(file->FileDate().toString("MM-dd-yyyy hh:mm"));
  8. this->setItem(row, col, dateItem);
  9.  
  10. nameItem->setIcon(file->FileIcon());
  11. dateItem->setText(file->FileName());
  12. this->setItem(row, col, nameItem);
  13.  
  14. }
To copy to clipboard, switch view to plain text mode 


I have tried also

Qt Code:
  1. this->insertRow(row);
To copy to clipboard, switch view to plain text mode 

instead of

Qt Code:
  1. this->setRowCount(row+1);
To copy to clipboard, switch view to plain text mode 

I set sortItems after displaying all rows in initial list construct.

What is a proper way to use insertRow with column sorting enabled ?

Thank You