[PyQt] SystemLocaleShortDate omits the century on Linux

Sibylle Koczian nulla.epistola at web.de
Fri Mar 13 14:46:36 GMT 2020


Am 11.03.2020 um 20:47 schrieb Maurizio Berti:
> It completely depends on how the system "tells" what is the date format.
> Apparently, Windows defaults to 4 digits for your localization, while 
> it's set to 2 for Linux.

So I thought too, but then why does "date +%x", which should show "the 
locale's date representation", give all 4 digits? This is very confusing.

> You can change them in both systems: in Windows it's on the regional 
> settings, while on Linux it depends on your distro/window manager/etc.
> 

In this case Windows does it right. I'll have yet to find the right 
setting for Linux. But in the meantime: if I want a QTableView to render 
QDate values in another format, a custom delegate is the way to go, 
right? But which method? All the examples I've seen for overwritten 
paint() methods seem unnecessary complicated for this sort of small change.

Sibylle



More information about the PyQt mailing list