Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.15.5, 6.1.2
-
94de5f9b25e1816039885c765e2a5b312f7daa7e (qt/qtbase/dev) a1e694b641aeeb8731f50f22e9223ea57c827c7a (qt/qtbase/6.2)
Description
Due to this change, it is no longer possible to change collation locale used by QString::localeAwareCompare():
https://codereview.qt-project.org/c/qt/qtbase/+/241737
Before it was possible to use QLocale::setDefault(..) to do so. Unfortunately in addition to that, QTBUG-36149 made QString cache the used QCollator, which means it is no longer possible to dynamically change it after the first use and also that introduced a bug where different threads could have different behaviors if it was changed at runtime, but that is now masked off by this more recent change.
I am guessing the right way would probably be to use QCollator directly instead of localeAwareCompare() when a specific collation is required, but it would be great if it was possible to change it.
localeAwareCompare() is also used by QSortFilterProxyModel which would really be nice if it the change was possible without having to subclass it. Also item view widgets use localeAwareCompare by default and there is no way for user to change that.
Attachments
Issue Links
- resulted from
-
QTBUG-36149 Huge performance loss in Qt 5 when locale-aware sorting a QStringList
- Closed