Hi,
I use QSqlTableModel to access table stored in database,when I traverse and handle every row in one table which contains about 3500 rows, i find it need 3-4 seconds that is too slow. Is it normal and how to improve it?
here is my code,
Qt Code:
  1. int GetRecordCount()ï½›
  2. while(sqlTableModel.canFetchMore())
  3. ï½›
  4. sqlTableModel.fetchMore();
  5. }
  6. return sqlTableModel.rowCount();
  7. }
  8.  
  9. //traverse table
  10. for (i=0 ï¼›i<=GetRecordCount()ï¼›i++)
  11. ï½›
  12. QSqlRecord record = sqlTableModel.record(i);
  13. //...
  14. //...
  15. }
To copy to clipboard, switch view to plain text mode