It makes no sense to me.
By the way.
1. You are not guaranteed that a SELECT * query will return the record columns in the specified order. Either construct the query by explicitly entering the column names or retrieve the values later via QSqlRecord and field names.

2. There should be no toFloat() on line number 7 ?