summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qchar.cpp18
-rw-r--r--src/corelib/tools/qchar.h10
-rw-r--r--src/corelib/tools/qlocale_p.h8
-rw-r--r--src/corelib/tools/qregexp.cpp2
-rw-r--r--src/corelib/tools/qstring.cpp4
-rw-r--r--src/corelib/tools/qstring.h10
6 files changed, 26 insertions, 26 deletions
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp
index e097e4a5fe..0c190c6a3d 100644
--- a/src/corelib/tools/qchar.cpp
+++ b/src/corelib/tools/qchar.cpp
@@ -1885,11 +1885,11 @@ static void composeHelper(QString *str, QChar::UnicodeVersion version, int from)
QChar *d = s.data();
// ligatureHelper() never changes planes
if (QChar::requiresSurrogates(ligature)) {
- d[starter] = QChar::highSurrogate(ligature);
- d[starter + 1] = QChar::lowSurrogate(ligature);
+ d[starter] = QChar(QChar::highSurrogate(ligature));
+ d[starter + 1] = QChar(QChar::lowSurrogate(ligature));
s.remove(i, 2);
} else {
- d[starter] = ligature;
+ d[starter] = QChar(ligature);
s.remove(i, 1);
}
continue;
@@ -1962,16 +1962,16 @@ static void canonicalOrderHelper(QString *str, QChar::UnicodeVersion version, in
int p = pos;
// exchange characters
if (!QChar::requiresSurrogates(u2)) {
- uc[p++] = u2;
+ uc[p++] = QChar(u2);
} else {
- uc[p++] = QChar::highSurrogate(u2);
- uc[p++] = QChar::lowSurrogate(u2);
+ uc[p++] = QChar(QChar::highSurrogate(u2));
+ uc[p++] = QChar(QChar::lowSurrogate(u2));
}
if (!QChar::requiresSurrogates(u1)) {
- uc[p++] = u1;
+ uc[p++] = QChar(u1);
} else {
- uc[p++] = QChar::highSurrogate(u1);
- uc[p++] = QChar::lowSurrogate(u1);
+ uc[p++] = QChar(QChar::highSurrogate(u1));
+ uc[p++] = QChar(QChar::lowSurrogate(u1));
}
if (pos > 0)
--pos;
diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h
index 73344ecf52..e028a24c24 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -443,17 +443,17 @@ public:
#endif
inline unsigned char combiningClass() const noexcept { return QChar::combiningClass(ucs); }
- inline QChar mirroredChar() const noexcept { return QChar::mirroredChar(ucs); }
+ inline QChar mirroredChar() const noexcept { return QChar(QChar::mirroredChar(ucs)); }
inline bool hasMirrored() const noexcept { return QChar::hasMirrored(ucs); }
QString decomposition() const;
inline Decomposition decompositionTag() const noexcept { return QChar::decompositionTag(ucs); }
inline int digitValue() const noexcept { return QChar::digitValue(ucs); }
- inline QChar toLower() const noexcept { return QChar::toLower(ucs); }
- inline QChar toUpper() const noexcept { return QChar::toUpper(ucs); }
- inline QChar toTitleCase() const noexcept { return QChar::toTitleCase(ucs); }
- inline QChar toCaseFolded() const noexcept { return QChar::toCaseFolded(ucs); }
+ inline QChar toLower() const noexcept { return QChar(QChar::toLower(ucs)); }
+ inline QChar toUpper() const noexcept { return QChar(QChar::toUpper(ucs)); }
+ inline QChar toTitleCase() const noexcept { return QChar(QChar::toTitleCase(ucs)); }
+ inline QChar toCaseFolded() const noexcept { return QChar(QChar::toCaseFolded(ucs)); }
inline Script script() const noexcept { return QChar::script(ucs); }
diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h
index 1e3da35a02..37afb8542b 100644
--- a/src/corelib/tools/qlocale_p.h
+++ b/src/corelib/tools/qlocale_p.h
@@ -285,9 +285,9 @@ public:
quint16 m_language_id, m_script_id, m_country_id;
// FIXME QTBUG-69324: not all unicode code-points map to single-token UTF-16 :-(
- quint16 m_decimal, m_group, m_list, m_percent, m_zero, m_minus, m_plus, m_exponential;
- quint16 m_quotation_start, m_quotation_end;
- quint16 m_alternate_quotation_start, m_alternate_quotation_end;
+ char16_t m_decimal, m_group, m_list, m_percent, m_zero, m_minus, m_plus, m_exponential;
+ char16_t m_quotation_start, m_quotation_end;
+ char16_t m_alternate_quotation_start, m_alternate_quotation_end;
quint16 m_list_pattern_part_start_idx, m_list_pattern_part_start_size;
quint16 m_list_pattern_part_mid_idx, m_list_pattern_part_mid_size;
@@ -417,7 +417,7 @@ inline char QLocaleData::digitToCLocale(QChar in) const
if (in == m_group)
return ',';
- if (in == m_exponential || in == QChar::toUpper(m_exponential))
+ if (in == m_exponential || in == QChar(QChar::toUpper(m_exponential)))
return 'e';
// In several languages group() is a non-breaking space (U+00A0) or its thin
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index dd38ba0360..d81826b47b 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -2035,7 +2035,7 @@ bool QRegExpMatchState::matchHere()
#ifndef QT_NO_REGEXP_CCLASS
const QRegExpCharClass &cc = eng->cl.at(m ^ QRegExpEngine::CharClassBit);
if (eng->cs)
- inside = cc.in(ch);
+ inside = cc.in(QChar(ch));
else if (cc.negative())
inside = cc.in(QChar(ch).toLower()) &&
cc.in(QChar(ch).toUpper());
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 47db97cdfc..12506afdef 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -3208,7 +3208,7 @@ QString& QString::replace(QChar ch, const QString &after, Qt::CaseSensitivity cs
return remove(ch, cs);
if (after.d->size == 1)
- return replace(ch, after.d->data()[0], cs);
+ return replace(ch, after.front(), cs);
if (d->size == 0)
return *this;
@@ -6666,7 +6666,7 @@ static QString detachAndConvertCase(T &str, QStringIterator it)
} else if (Q_UNLIKELY(QChar::requiresSurrogates(uc))) {
// so far, case convertion never changes planes (guaranteed by the qunicodetables generator)
pp++;
- *pp++ = QChar::lowSurrogate(uc + caseDiff);
+ *pp++ = QChar(QChar::lowSurrogate(uc + caseDiff));
} else {
*pp++ = QChar(uc + caseDiff);
}
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 6788e53057..9896553f7d 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -1002,11 +1002,11 @@ inline QString::QString(QLatin1String aLatin1) : d(fromLatin1_helper(aLatin1.lat
inline int QString::length() const
{ return d->size; }
inline const QChar QString::at(int i) const
-{ Q_ASSERT(uint(i) < uint(size())); return d->data()[i]; }
+{ Q_ASSERT(uint(i) < uint(size())); return QChar(d->data()[i]); }
inline const QChar QString::operator[](int i) const
-{ Q_ASSERT(uint(i) < uint(size())); return d->data()[i]; }
+{ Q_ASSERT(uint(i) < uint(size())); return QChar(d->data()[i]); }
inline const QChar QString::operator[](uint i) const
-{ Q_ASSERT(i < uint(size())); return d->data()[i]; }
+{ Q_ASSERT(i < uint(size())); return QChar(d->data()[i]); }
inline bool QString::isEmpty() const
{ return d->size == 0; }
inline const QChar *QString::unicode() const
@@ -1118,11 +1118,11 @@ public:
{
using namespace QtPrivate::DeprecatedRefClassBehavior;
if (Q_LIKELY(i < s.d->size))
- return s.d->data()[i];
+ return QChar(s.d->data()[i]);
#ifdef QT_DEBUG
warn(WarningType::OutOfRange, EmittingClass::QCharRef);
#endif
- return 0;
+ return QChar();
}
inline QCharRef &operator=(QChar c)
{