diff options
| author | Marc Mutz <marc.mutz@qt.io> | 2024-05-22 14:29:30 +0200 |
|---|---|---|
| committer | Marc Mutz <marc.mutz@qt.io> | 2024-12-03 22:44:54 +0100 |
| commit | f7e8e54d7e6803c91cc453afdfc46f3d0b4da9c2 (patch) | |
| tree | b7bbd5f28ee2d630b3326e996aefd9d7a6ac9300 /src/corelib/text/qstring.cpp | |
| parent | 563ed822f867c6c3040956017d4ca7f3795f172c (diff) | |
This is the public API for the functionality already implemented in
pt.1 of this patch series (except the replacement of the remaining
Q_UNREACHABLE).
I opted to do the minimal change to enable this important
functionality: the ArgBase hierarchy stays and gets extended a bit
differently than originally envisioned. ArgBase, of course, is just
yet another QAnyStringView re-implementation, so eventually, this will
go. But the churn to do this in a binary-compatible way would just be
too big. Instead of the U8 tag representing UTF-8 arguments, repurpose
this up-to-now unused tag to mean QAnyStringView. This allows to get
rid of the qStringLikeToArg() overloads, leaving only one accepting
QAnyStringView. This is the only one that new code will ever call. But
we still need to support L1 and U16 ArgBases for old code.
[ChangeLog][QtCore][QString/QStringView/QAnyStringView] Added
(multi-)arg() support for UTF-8 (QUtf8StringView) and QAnyStringView
arguments. Passing C string literals or QByteArrays to arg() now no
longer implicitly converts to QString first.
Fixes: QTBUG-124365
Change-Id: I0d710365a45d2c62af26184e8a857c3f4cdeeae2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
| -rw-r--r-- | src/corelib/text/qstring.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 270bc770e2d..6cff436fae5 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -9113,8 +9113,8 @@ static qsizetype resolveStringRefsAndReturnTotalSize(ParseResult &parts, const A case ArgBase::L1: part.reset(static_cast<const QLatin1StringArg&>(arg).string); break; - case ArgBase::U8: - Q_UNREACHABLE(); // waiting for QUtf8String... + case ArgBase::Any: + part.reset(static_cast<const QAnyStringArg&>(arg).string); break; case ArgBase::U16: part.reset(static_cast<const QStringViewArg&>(arg).string); |
