summaryrefslogtreecommitdiffstats
path: root/src/corelib/text
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-04-20 10:59:30 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-05-20 06:01:06 +0200
commitbf2b794a9af7b0ed9ca2dbf48e12fb221523c645 (patch)
tree16b20756fcbe86ae84ee5132b16264bd3ca89747 /src/corelib/text
parent99a97a34fb9b61e7cedcd40c9b4a60dfe51fe462 (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 Fixes: QTBUG-49031 Reviewed-by: Orgad Shaneh <orgads@gmail.com> (cherry picked from commit 4c3ec0caa839260c2252115535847b9277be32d7) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/text')
-rw-r--r--src/corelib/text/qlocale_win.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/text/qlocale_win.cpp b/src/corelib/text/qlocale_win.cpp
index 4a38adf309..ec0f32e28f 100644
--- a/src/corelib/text/qlocale_win.cpp
+++ b/src/corelib/text/qlocale_win.cpp
@@ -838,6 +838,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;
@@ -846,12 +847,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: