Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.2, 5.7.1, 5.8.0, 5.9.0 Alpha
-
None
-
Kubuntu 16.10, Windows 10
-
e5c0371d18e285d7849cbd0569970e209bd01b49
Description
Changing locale settings for a widget of type QDateEdit or QDateTimeEdit is not propagated to its child widgets, specifically QCalendarWidget.
I believe this is not the expected behavior.
Minimum test case is attached.
#include <QApplication> #include <QDialog> #include <QDateEdit> #include <QCalendarWidget> #include <QVBoxLayout> #include <QDebug> int main(int argc, char *argv[]) { QApplication a(argc, argv); QLocale::setDefault(QLocale(QLocale::Persian, QLocale::Iran)); QDialog d; QVBoxLayout layout(&d); // Persian Locale QDateEdit dateEdit(&d); layout.addWidget(&dateEdit); dateEdit.setLocale(QLocale(QLocale::English, QLocale::UnitedKingdom)); dateEdit.setCalendarPopup(true); // Or maybe set locale after enabling popup calendar. Same as previous case // de.setLocale(QLocale(QLocale::English, QLocale::UnitedKingdom)); dateEdit.setDisplayFormat("yyyy-MM-dd"); dateEdit.setDate(QDate::currentDate()); // d.show(); /* * Now `dateEdit' shows a date in English (line edit), * and a popup calendar in Persian */ return a.exec(); }
Attachments
For Gerrit Dashboard: QTBUG-59106 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
186500,8 | Test locale propagation from date-time editor to its calendar popup | dev | qt/qtbase | Status: MERGED | +2 | 0 |
187464,7 | Fix propagation of locale from widget to its children | 5.8 | qt/qtbase | Status: MERGED | +2 | 0 |