Rewrited usage of QSqlRecord.

Avoided multiple creation of QSqlRecord and pulled out record->indexOf's from cycles.