0

I've created QDateTimeEdit widget in QtDesigner with calendarPopup option checked.

I need months to be shown in English language but they are shown in my system locale language.

I've tried this:

self.ui.dateTimeEdit.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates))

and this:

self.ui.dateTimeEdit.setLocale(QtCore.QLocale(QtCore.QLocale.English))

...but months are still showing in my local language. What am I doing wrong?

4

1 回答 1

1

您需要为日历小部件设置区域设置:

self.ui.dateTimeEdit.calendarWidget().setLocale(...)

假设 QDateTimeEdit 为其内部日历小部件设置区域设置是合乎逻辑的。这似乎是一个 Qt 错误。

于 2014-01-15T11:47:33.247 回答