I'm trying this approach: to use QSqlRecord QSqlQueryModel::record(int row) in a for loop to check each row in the table; from each row I got the content of the desired field using QVariant QSqlRecord::value(int index).

Well, this in theory because with the code below I have an empty value returned from QSqlRecord::value() and so comparison fails

Qt Code:
  1. for(int i = 0; i < numRows; i++) {
  2. record = ((QSqlRelationalTableModel*)ui->scoopsTableView->model())->record(i);
  3. if(record.value(field) != ui->articleComboBox->itemData(ui->articleComboBox->currentIndex()))
  4. ui->scoopsTableView->hideRow(i);
  5. }
To copy to clipboard, switch view to plain text mode 

Where is my error?