[Qt-interest] QtSQL driver for postgres is automatically reducing precision, which is not desired

John Moran johnfrederickmoran at gmail.com
Fri May 7 12:50:40 CEST 2010


Hi,

I use Qt's SQL driver and PostgreSQL extensively. I've just upgrading
to Qt 4.6. Qt 4.6 "helpfully" reduces trailing zeros for numeric
datatypes:

QSqlQuery find_val;
find_val;.prepare("SELECT 5.00 ");
QString val = find_val.value(0).toString();

the value of the "val" variable is now "5", not "5.00".

How can I change this behavior to what I would consider the saner,
earlier default of preserving precision? I don't think that Qt should
be performing any automatic post production on the database string -
surely that's the job of the RDBMS.

Regards,
John Moran



More information about the Qt-interest-old mailing list