summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/text/qstringconverter.cpp6
-rw-r--r--src/corelib/text/qstringconverter.h2
-rw-r--r--tests/auto/corelib/text/qstringconverter/tst_qstringconverter.cpp4
3 files changed, 10 insertions, 2 deletions
diff --git a/src/corelib/text/qstringconverter.cpp b/src/corelib/text/qstringconverter.cpp
index 90f277ba61..7f68c5113e 100644
--- a/src/corelib/text/qstringconverter.cpp
+++ b/src/corelib/text/qstringconverter.cpp
@@ -2374,4 +2374,10 @@ const char *QStringConverter::nameForEncoding(QStringConverter::Encoding e)
\sa requiredSpace
*/
+/*!
+ \fn char16_t *QStringDecoder::appendToBuffer(char16_t *out, QByteArrayView in)
+ \since 6.6
+ \overload
+*/
+
QT_END_NAMESPACE
diff --git a/src/corelib/text/qstringconverter.h b/src/corelib/text/qstringconverter.h
index f10aa3b6d3..373c1ad1e9 100644
--- a/src/corelib/text/qstringconverter.h
+++ b/src/corelib/text/qstringconverter.h
@@ -140,6 +140,8 @@ public:
}
return iface->toUtf16(out, ba, &state);
}
+ char16_t *appendToBuffer(char16_t *out, QByteArrayView ba)
+ { return reinterpret_cast<char16_t *>(appendToBuffer(reinterpret_cast<QChar *>(out), ba)); }
Q_CORE_EXPORT static QStringDecoder decoderForHtml(QByteArrayView data);
diff --git a/tests/auto/corelib/text/qstringconverter/tst_qstringconverter.cpp b/tests/auto/corelib/text/qstringconverter/tst_qstringconverter.cpp
index c93983293c..253749ede9 100644
--- a/tests/auto/corelib/text/qstringconverter/tst_qstringconverter.cpp
+++ b/tests/auto/corelib/text/qstringconverter/tst_qstringconverter.cpp
@@ -252,8 +252,8 @@ void tst_QStringConverter::invalidConverter()
decoder.resetState();
QVERIFY(!decoder.hasError());
- QChar buffer[100];
- QChar *position = decoder.appendToBuffer(buffer, "Even more");
+ char16_t buffer[100];
+ char16_t *position = decoder.appendToBuffer(buffer, "Even more");
QCOMPARE(position, buffer);
QVERIFY(decoder.hasError());
}