[Qt-interest] Qt 4.5.2 handles numeric(10.6) as String

Julien Cugnière julien.cugniere at gmail.com
Mon Nov 2 10:17:00 CET 2009


2009/11/2 Sylvain Pointeau <sylvain.pointeau at gmail.com>
> hello,
> I found the solution...
> I use QSqlRecord
> then QSqlField then type() to know if this is a double
> I think that value() return a QVariant that is a QString for precision issue.

Indeed, have a look at the documentation for
QSqlQuery::setNumericalPrecisionPolicy(). You have to set it to
QSql::LowPrecisionDouble if you want values to be returned as double.

--
Julien Cugnière




More information about the Qt-interest-old mailing list