View Single Post
Old 11-07-2023, 03:03 PM   #1
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,471
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Attn plugin developers: new Qt bug regarding dates

Kovid found a new bug in how Qt handles dates. Formerly
Code:
QDateTime(some_python_date)
preserved the timezone, where now it doesn't. This can cause problems where the date moves a day.

See https://github.com/kovidgoyal/calibr...b4d3ec86b2a711 for how examples of how he fixed it.

Examples:
Code:
        self.setDateTime(now())
is changed to:
        self.setDateTime(qt_from_dt(now()))
Code:
        return None if is_date_undefined(val) else QDateTime(as_local_time(val))
is changed to
        return None if is_date_undefined(val) else qt_from_dt(val)
chaley is offline   Reply With Quote