mandal
11th September 2009, 11:35
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
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
anybody knows how to fix this?? i just want to see 0.7 and 0.8 in my qtableview.
thanx in adnavce.
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
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
anybody knows how to fix this?? i just want to see 0.7 and 0.8 in my qtableview.
thanx in adnavce.