10#include <unicode/utypes.h>
11#include <unicode/ucol.h>
12#include <unicode/ustring.h>
13#include <unicode/ures.h>
25 UErrorCode status = U_ZERO_ERROR;
28 if (U_FAILURE(status)) {
29 qWarning(
"Could not create collator: %d", status);
36 ucol_setAttribute(
collator, UCOL_NORMALIZATION_MODE, UCOL_ON, &status);
46 ? UCOL_DEFAULT_STRENGTH : UCOL_SECONDARY;
48 status = U_ZERO_ERROR;
49 ucol_setAttribute(
collator, UCOL_STRENGTH,
val, &status);
50 if (U_FAILURE(status))
51 qWarning(
"ucol_setAttribute: Case First failed: %d", status);
53 status = U_ZERO_ERROR;
54 ucol_setAttribute(
collator, UCOL_NUMERIC_COLLATION,
numericMode ? UCOL_ON : UCOL_OFF, &status);
55 if (U_FAILURE(status))
56 qWarning(
"ucol_setAttribute: numeric collation failed: %d", status);
58 status = U_ZERO_ERROR;
59 ucol_setAttribute(
collator, UCOL_ALTERNATE_HANDLING,
61 if (U_FAILURE(status))
62 qWarning(
"ucol_setAttribute: Alternate handling failed: %d", status);
77 return s2.size() ? -1 : 0;
86 reinterpret_cast<const UChar *
>(
s1.data()),
s1.size(),
87 reinterpret_cast<const UChar *
>(
s2.data()),
s2.size());
103 int size = ucol_getSortKey(d->
collator, (
const UChar *)
string.constData(),
104 string.size(), (uint8_t *)
result.data(),
result.size());
107 size = ucol_getSortKey(d->
collator, (
const UChar *)
string.constData(),
108 string.size(), (uint8_t *)
result.data(),
result.size());
Qt::CaseSensitivity caseSensitivity
QExplicitlySharedDataPointer< QCollatorSortKeyPrivate > d
int compare(const QCollatorSortKey &key) const
Compares this key to otherKey, which must have been created by the same QCollator's sortKey() as this...
QCollatorSortKey sortKey(const QString &string) const
Returns a sortKey for string.
int compare(const QString &s1, const QString &s2) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static const QLocalePrivate * get(const QLocale &l)
QByteArray bcp47Name(char separator='-') const
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept
constexpr Initialization Uninitialized
Q_CORE_EXPORT int qstrcmp(const char *str1, const char *str2)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1