Skip to content

Change QCollator's default locale to QLocale().collation()

This replaces QLocale::system().collation(), which left client code with no way to change this default. Since QLocale's default is the system locale initially, the old behavior is retained until the first call to QLocale;:setDefault(). Addition of a separate collation locale in 5.14 changed from using the default locale to using the system's collation locale; the present change restores the ability to override this.

[ChangeLog][QtCore][QCollator] The default locale used by QCollator is now the collation locale of the default QLocale. This restores the ability (lost at 5.14) to control the locale used by QString::localeAwareCompare(), while retaining the use of a collation locale when the default is the system locale.

Task-number: QTBUG-95050 Pick-to: 6.2 6.1 5.15 Change-Id: I232772bb8f23fffd74573174de70ef2deae372a9 Reviewed-by: Volker Hilsheimer volker.hilsheimer@qt.io (cherry picked from commit 973ca1fa)

Merge request reports