I have a qtableview to display result of a sql query.I have problems with filelds that defined to have float data types.
Table is defined in database as:
table1(studentId int,
studentGrade int,
weight float)
Here is how my table in database look like:
studentId studentGrade weight
1 80 0.7
2 90 0.8
studentId studentGrade weight
1 80 0.7
2 90 0.8
To copy to clipboard, switch view to plain text mode
i fill qSqlQueryModel with query (select * from table1) and then set model to qtableview.
But float fields' precision is lost.
Here is how my QTabelView looks like:
studentId studentGrade weight
1 80 0.69999999
2 90 0.7999999
studentId studentGrade weight
1 80 0.69999999
2 90 0.7999999
To copy to clipboard, switch view to plain text mode
anybody knows how to fix this?? i just want to see 0.7 and 0.8 in my qtableview.
thanx in adnavce.
Bookmarks