Re: [Interest] QTableView, QSqlRelationalTableModel and QDateTimeEdit and timezones

2020-05-01 Thread Lisandro Damián Nicanor Pérez Meyer
Hi Tony! On Fri, 1 May 2020 at 02:00, Tony Rietwyk wrote: > > Hi Lisandro, > > AFAIK that is a bug in the design of the Qt SQL api's. There is no way > to specify to QSqlField/QSqlResult that the date being read is UTC. You > have to read the QSqlQuery yourself, convert the QVariant to QDateTim

Re: [Interest] QTableView, QSqlRelationalTableModel and QDateTimeEdit and timezones

2020-04-30 Thread Tony Rietwyk
Hi Lisandro, AFAIK that is a bug in the design of the Qt SQL api's.  There is no way to specify to QSqlField/QSqlResult that the date being read is UTC.  You have to read the QSqlQuery yourself, convert the QVariant to QDateTime, apply the time spec, then pass the value to the UI. Maybe you

[Interest] QTableView, QSqlRelationalTableModel and QDateTimeEdit and timezones

2020-04-30 Thread Lisandro Damián Nicanor Pérez Meyer
Hi! I have a database (PostgreSql) with a table that holds date/time in UTC. I've read this table with the QSqlRelationalTableModel and show the data with a QTableView and a QDateTimeEdit. I would like both the QTableView and the QDateEdit to show the time in local timezone, but I seem to be fail