Hope some can help me out here. I am trying to understand if what I am experiencing is a bug or a feature.

When I hide data in my QTableView and then do a select all [ctrl+a] followed by a delete all - the rows disappear also the ones that are currently hidden in the view? is that to be expected?

in a QTableView, with data kept in a QStandarditem model

I hide the rows like this;
Qt Code:
  1. for(int i = 0; i < lst.count(); i++) {
  2. ui->playTableView->hideRow(lst.at(i)->row());
  3. }
To copy to clipboard, switch view to plain text mode 

I then use the following code to get the content of one of the columns stored in every visible row;

Qt Code:
  1. if (ui->playTableView->selectionModel()->hasSelection()) {
  2. QModelIndexList indexes = ui->playTableView->selectionModel()->selectedRows();
  3. qSort(indexes.begin(), indexes.end());
  4. for (int i = indexes.count() - 1; i > -1; --i) {
  5. qDebug() << indexes[i];
  6. }
To copy to clipboard, switch view to plain text mode 


So i.e. my view has one visible row, and 25 hidden rows. If I select all rows (1), and execute the code above it will print the QModelIndex of all 26 rows, but I expected only to get one (the one that was actually selected)

is this normal? or am I doing something wrong here?

I could of course check if the rows is hidden or not before I print, but I would have thought that it would be logical and already default behaviour in QT. 5

Thanks in advance.