void Window::localeChanged(int index) { QLocale newLocale(localeCombo->itemData(index).toLocale()); calendar->setLocale(newLocale); int newLocaleFirstDayofWeek = firstDayCombo->findData(newLocale.firstDayOfWeek()); firstDayCombo->setCurrentIndex(newLocaleFirstDayofWeek); }
void MInputContext::setLanguage(const QString &language) { QLocale newLocale(language); Qt::LayoutDirection oldDirection = inputDirection(); if (newLocale != inputLocale) { inputLocale = newLocale; emitLocaleChanged(); } Qt::LayoutDirection newDirection = inputDirection(); if (newDirection != oldDirection) { emitInputDirectionChanged(newDirection); } }