Reputation: 734
I want to know QCalendarWidget(pyqt and in python) for Persian displayed What should I do?
Or any other language except the English(for example Persian, Arabic,Russian, etc)
Thanks
Upvotes: 3
Views: 2191
Reputation: 10868
You can't. (Yet)
Qt does not support calendars. There is a work-in-progress (code available here) to add non-Gregorian calendaring support for Qt in QtWidgets and QtQuick modules. If everything goes fine, the patch will be merged into Qt 5.11. It's stable enough for now, so you can apply it to Qt 5.10 source and you should be fine.
Disclaimer: I'm not aware of possible licensing issues (if you made changes to Qt, you may need to publish your source code[?]).
Important Notes:
Calendars and Locale are separated and unrelated concepts. This animated gif should elaborate more (it's an early test of our proposed change to Qt):
Upvotes: 2
Reputation: 10951
You can change the language display in QCalenderWidget
by changing the language in local
properties to Persian
using Qt
Output:
EDIT:
If you want to have calendars with Jalali and Hijri support, and persian translation, then you will have to install StarCalender package and use its library for such thing.
Here its source fourge link as well
Upvotes: 1
Reputation: 5885
cal = QtGui.QCalendarWidget()
cal.setLocale(QtCore.QLocale.Persian)
Upvotes: 1