diff options
Diffstat (limited to 'src/corelib/tools/qlocale.cpp')
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index d986b9b..5c4085a 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -86,6 +86,10 @@ static QLocalePrivate *system_lp = 0; Q_GLOBAL_STATIC(QLocalePrivate, globalLocalePrivate) #endif +#ifdef QT_USE_ICU +extern bool qt_initIcu(const QString &localeName); +#endif + /****************************************************************************** ** Helpers for accessing Qt locale database */ @@ -520,6 +524,12 @@ void QLocalePrivate::updateSystemPrivate() res = sys_locale->query(QSystemLocale::PositiveSign, QVariant()); if (!res.isNull()) system_lp->m_plus = res.toString().at(0).unicode(); + +#ifdef QT_USE_ICU + if (!default_lp) + qt_initIcu(system_lp->bcp47Name()); +#endif + } #endif @@ -879,6 +889,10 @@ void QLocale::setDefault(const QLocale &locale) { default_lp = locale.d(); default_number_options = locale.numberOptions(); + +#ifdef QT_USE_ICU + qt_initIcu(locale.bcp47Name()); +#endif } /*! |