Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.10
-
None
-
Qt 5.15.10 msvc2019_64 compiler version installed
-
-
21
Description
QCollator with numericMode generates QCollatorSortKey that have differ results in compare function that QCollator that generates that keys.
The easiest example of that:
mCollator.setNumericMode(true); auto result = mCollator.compare("00", "10"); //-1 ok QCollatorSortKey key1 = mCollator.sortKey("00"); QCollatorSortKey key2 = mCollator.sortKey("10"); auto result2 = mCollator.compare("9", "10"); // -1 ok QCollatorSortKey key3 = mCollator.sortKey("9"); QCollatorSortKey key4 = mCollator.sortKey("10"); auto result3 = mCollator.compare("99", "100"); // -1 ok QCollatorSortKey key5 = mCollator.sortKey("99"); QCollatorSortKey key6 = mCollator.sortKey("100"); bool result4 = key1 < key2; //false wrong bool result5 = key3 < key4; //true ok bool result6 = key5 < key6; //false wrong
It seems that that QCollatorSortKey generated from QCollator not works properly when setNumericMode is set to true.
I attached some example of result after sorting, the range was from 0 to 35000
Attachments
Issue Links
- duplicates
-
QTBUG-88704 QCollatorSortKey is not working properly without ICU support
- Reported
- relates to
-
QTBUG-67490 QCollatorSortKey doesn't work on macOS
- Reported