Example #1
0
void Window::localeChanged(int index)
{
    QLocale newLocale(localeCombo->itemData(index).toLocale());
    calendar->setLocale(newLocale);

    int newLocaleFirstDayofWeek = firstDayCombo->findData(newLocale.firstDayOfWeek());
    firstDayCombo->setCurrentIndex(newLocaleFirstDayofWeek);
}
Example #2
0
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);
    }
}