diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-04-20 10:59:30 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-04-21 11:46:26 +0200 |
commit | 4c3ec0caa839260c2252115535847b9277be32d7 (patch) | |
tree | 9af88142100f772b41cdd3bb58985fd41fe0e5b1 /src/corelib/text/qlocale_win.cpp | |
parent | 589e34eb3210d8725d68941dbeb096424dda68df (diff) |
Revert "Revert "QLocale: Actually get the language script for the system locale""
This reverts commit 449390c3a5f3a91e3895cbba0a583386e93366b7.
QLocale::system() should behave consistently.
If UI widgets are consulting the system locale where they should be
consulting their configured UI locale, that is a bug in the UI widget
and should not be "fixed" by breaking QLocale.
Change-Id: Ib31cf7882a28b26f9a018fba3adabba94a8c43bf
Pick-to: 5.15
Fixes: QTBUG-49031
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/corelib/text/qlocale_win.cpp')
-rw-r--r-- | src/corelib/text/qlocale_win.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/text/qlocale_win.cpp b/src/corelib/text/qlocale_win.cpp index f8c30d95b5..e4f845f2b2 100644 --- a/src/corelib/text/qlocale_win.cpp +++ b/src/corelib/text/qlocale_win.cpp @@ -843,6 +843,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant in) const case ZeroDigit: return d->zeroDigit(); case LanguageId: + case ScriptId: case CountryId: { QString locale = QString::fromLatin1(getWinLocaleName()); QLocale::Language lang; @@ -851,12 +852,12 @@ QVariant QSystemLocale::query(QueryType type, QVariant in) const QLocalePrivate::getLangAndCountry(locale, lang, script, cntry); if (type == LanguageId) return lang; + if (type == ScriptId) + return script == QLocale::AnyScript ? fallbackUiLocale().script() : script; if (cntry == QLocale::AnyCountry) return fallbackUiLocale().country(); return cntry; } - case ScriptId: - return QVariant(QLocale::AnyScript); case MeasurementSystem: return d->measurementSystem(); case Collation: |