Hi there,
I'm trying to connect to a Postgres database and read some rows with QSqlQueryModel
When I open the standard connection with
QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
QSqlQueryModel m;
m.setQuery("select task_id, name, project_id, recurrence from task");
everything works fine.
Now when I open the connection with an alternative connection name
QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL", QLatin1String("Main"));
QSqlQueryModel m;
m.setQuery("select task_id, name, project_id, recurrence from task", QSqlDatabase::database(QLatin1String("Main")));
the data in field name is not shown correctly. All german umlauts are not correct.
Why is the encoding for the standard connection different from an alternative connection? How can I set the correct encoding?
Thanks in advance
Andreas
Bookmarks