A problem is that You runs this code for every record. Change this code and run it for group of records (ie. every 100 records) something like this :
Qt Code:
  1. QString query = TableQueries::insertDataQuery();
  2. db.transaction();//begin of transaction
  3. db_query.prepare(query);
  4. bool exec = false;
  5. for( int i = 0; i < Id_list.size(); i++ )
  6. {
  7. int pos = 0;
  8. db_query.bindValue(pos++, Id_list.at(i));
  9. db_query.bindValue(pos++, date_list.at(i));
  10. db_query.bindValue(pos++, time_list.at(i));
  11. db_query.bindValue(pos++, value_list.at(i));
  12. exec = db_query.exec();
  13. if( !exec )
  14. break;
  15. }
  16. if( exec )
  17. db.commit();
  18. else
  19. db.rollback();
To copy to clipboard, switch view to plain text mode 
Remember that this is some idea not working code.