summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@nokia.com>2012-06-21 17:44:04 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-28 17:15:17 +0200
commitab536c3c71deaaa3b67ca87c47628355d9f348e8 (patch)
treea3a7bff9a2f3f0ecc61da1d5f265cdc1502231ab /examples
parent50dfd15dcc49d12c5335a37999aef041d7fdfaae (diff)
Make QCalendarWidget use its locale's firstDayOfWeek.
QCalendarWidget currently uses Qt::Sunday as the default first day of the week. It has been suggested that a better user experience would see the calendar's locale be used instead. Task-number: QTBUG-19811 Change-Id: I4441bf9ffd52213ef622a4a7f498530b7cc9e110 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/widgets/calendarwidget/window.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/widgets/calendarwidget/window.cpp b/examples/widgets/calendarwidget/window.cpp
index 6796ef7f9d..8ba044bf11 100644
--- a/examples/widgets/calendarwidget/window.cpp
+++ b/examples/widgets/calendarwidget/window.cpp
@@ -67,7 +67,10 @@ Window::Window()
void Window::localeChanged(int index)
{
- calendar->setLocale(localeCombo->itemData(index).toLocale());
+ const QLocale newLocale(localeCombo->itemData(index).toLocale());
+ calendar->setLocale(newLocale);
+ int newLocaleFirstDayIndex = firstDayCombo->findData(newLocale.firstDayOfWeek());
+ firstDayCombo->setCurrentIndex(newLocaleFirstDayIndex);
}
//! [1]