There is a class derived from QSqlTableModel, in which only the data method is redefined. At the same time, the QSqlTableModel :: record (int row) method returns an empty record, the fields in which are QVariant (Invalid). In this case, the field names are returned correct. Database - sqlite

  • So far, nothing is clear from your description. Add your code. - aleks.andr

1 answer 1

I found out that the QSqlTableModel :: record () method in its body repeatedly calls the QSqlTableModel :: data () method. Therefore, when redefining the QSqlTableModel :: data () method, the QSqlTableModel :: record () method falls off.