Inserting a value that's not a number into a double percision field in PosgreSQL using QSqlQuery::prepare() doesn't work. Qt tries to execute the following query
insert into table (field) values (nan)
while the query should look like
insert into table (field) values ('nan')
note the quotes around 'nan'.