322 template <
typename T, if_integral_non_char<T> =
true>
323 [[nodiscard]] QString arg(T a,
int fieldWidth = 0,
int base = 10,
324 QChar fillChar = u' ')
const
326 using U =
typename std::conditional<
328 std::is_enum_v<T>, std::underlying_type<T>,
329 q20::type_identity<T>
331 if constexpr (std::is_signed_v<U>)
332 return arg_impl(qlonglong(a), fieldWidth, base, fillChar);
334 return arg_impl(qulonglong(a), fieldWidth, base, fillChar);
337 template <
typename T, if_floating_point<T> =
true>
338 [[nodiscard]] QString arg(T a,
int fieldWidth = 0,
char format =
'g',
int precision = -1,
339 QChar fillChar = u' ')
const
340 {
return arg_impl(
double(a), fieldWidth, format, precision, fillChar); }
342 template <
typename T, if_string_like<T> =
true>
343 [[nodiscard]] QString arg(
const T &a,
int fieldWidth = 0, QChar fillChar = u' ')
const
344 {
return arg_impl(QAnyStringView(a), fieldWidth, fillChar); }
347 QString arg_impl(qlonglong a,
int fieldwidth,
int base, QChar fillChar)
const;
348 QString arg_impl(qulonglong a,
int fieldwidth,
int base, QChar fillChar)
const;
349 QString arg_impl(
double a,
int fieldWidth,
char format,
int precision, QChar fillChar)
const;
350 QString arg_impl(QAnyStringView a,
int fieldWidth, QChar fillChar)
const;
353 template <
typename...Args>
358 typename std::enable_if<
359 sizeof...(Args) >= 2 && std::conjunction_v<is_string_like<Args>...>,
363 arg(Args &&...args)
const
364 {
return qToStringViewIgnoringNull(*
this).arg(std::forward<Args>(args)...); }
366 static QString vasprintf(
const char *format, va_list ap) Q_ATTRIBUTE_FORMAT_PRINTF(1, 0);
367 static QString asprintf(
const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(1, 2);
369 [[nodiscard]] QT_CORE_INLINE_SINCE(6, 8)
370 qsizetype indexOf(QChar c, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
371 [[nodiscard]] qsizetype indexOf(QLatin1StringView s, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
372 [[nodiscard]] qsizetype indexOf(
const QString &s, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
373 [[nodiscard]] qsizetype indexOf(QStringView s, qsizetype from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const noexcept
374 {
return QtPrivate::findString(*
this, from, s, cs); }
375 [[nodiscard]] qsizetype lastIndexOf(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const noexcept
376 {
return lastIndexOf(c, -1, cs); }
377 [[nodiscard]] QT_CORE_INLINE_SINCE(6, 8)
378 qsizetype lastIndexOf(QChar c, qsizetype from, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
379 [[nodiscard]] qsizetype lastIndexOf(QLatin1StringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const
380 {
return lastIndexOf(s, size(), cs); }
381 [[nodiscard]] qsizetype lastIndexOf(QLatin1StringView s, qsizetype from, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
382 [[nodiscard]] qsizetype lastIndexOf(
const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const
383 {
return lastIndexOf(s, size(), cs); }
384 [[nodiscard]] qsizetype lastIndexOf(
const QString &s, qsizetype from, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
386 [[nodiscard]] qsizetype lastIndexOf(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const noexcept
387 {
return lastIndexOf(s, size(), cs); }
388 [[nodiscard]] qsizetype lastIndexOf(QStringView s, qsizetype from, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const noexcept
389 {
return QtPrivate::lastIndexOf(*
this, from, s, cs); }
391 [[nodiscard]]
inline bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
392 [[nodiscard]]
inline bool contains(
const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
393 [[nodiscard]]
inline bool contains(QLatin1StringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
394 [[nodiscard]]
inline bool contains(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const noexcept;
395 [[nodiscard]] qsizetype count(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
396 [[nodiscard]] qsizetype count(
const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
397 [[nodiscard]] qsizetype count(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
399#if QT_CONFIG(regularexpression)
400 [[nodiscard]] qsizetype indexOf(
const QRegularExpression &re, qsizetype from = 0,
401 QRegularExpressionMatch *rmatch =
nullptr)
const;
403 [[nodiscard]] qsizetype lastIndexOf(
const QRegularExpression &re, QRegularExpressionMatch *rmatch =
nullptr)
const;
406 template <
typename T = QRegularExpressionMatch, std::enable_if_t<std::is_same_v<T, QRegularExpressionMatch>,
bool> =
false>
407 [[nodiscard]] qsizetype lastIndexOf(
const QRegularExpression &re, T *rmatch =
nullptr)
const
408 {
return lastIndexOf(re, size(), rmatch); }
410 [[nodiscard]] qsizetype lastIndexOf(
const QRegularExpression &re, qsizetype from,
411 QRegularExpressionMatch *rmatch =
nullptr)
const;
412 [[nodiscard]]
bool contains(
const QRegularExpression &re, QRegularExpressionMatch *rmatch =
nullptr)
const;
413 [[nodiscard]] qsizetype count(
const QRegularExpression &re)
const;
417 SectionDefault = 0x00,
418 SectionSkipEmpty = 0x01,
419 SectionIncludeLeadingSep = 0x02,
420 SectionIncludeTrailingSep = 0x04,
421 SectionCaseInsensitiveSeps = 0x08
423 Q_DECLARE_FLAGS(SectionFlags, SectionFlag)
425 [[nodiscard]]
inline QString section(QChar sep, qsizetype start, qsizetype end = -1, SectionFlags flags = SectionDefault)
const;
426 [[nodiscard]] QString section(
const QString &in_sep, qsizetype start, qsizetype end = -1, SectionFlags flags = SectionDefault)
const;
427#if QT_CONFIG(regularexpression)
428 [[nodiscard]] QString section(
const QRegularExpression &re, qsizetype start, qsizetype end = -1, SectionFlags flags = SectionDefault)
const;
431#if QT_CORE_REMOVED_SINCE(6
, 7
)
432 QString left(qsizetype n)
const;
433 QString right(qsizetype n)
const;
434 QString mid(qsizetype position, qsizetype n = -1)
const;
436 QString first(qsizetype n)
const;
437 QString last(qsizetype n)
const;
438 QString sliced(qsizetype pos)
const;
439 QString sliced(qsizetype pos, qsizetype n)
const;
440 QString chopped(qsizetype n)
const;
442 [[nodiscard]] QString left(qsizetype n)
const &
444 if (size_t(n) >= size_t(size()))
448 [[nodiscard]] QString left(qsizetype n) &&
450 if (size_t(n) >= size_t(size()))
451 return std::move(*
this);
452 return std::move(*
this).first(n);
454 [[nodiscard]] QString right(qsizetype n)
const &
456 if (size_t(n) >= size_t(size()))
460 [[nodiscard]] QString right(qsizetype n) &&
462 if (size_t(n) >= size_t(size()))
463 return std::move(*
this);
464 return std::move(*
this).last(n);
466 [[nodiscard]] QString mid(qsizetype position, qsizetype n = -1)
const &;
467 [[nodiscard]] QString mid(qsizetype position, qsizetype n = -1) &&;
469 [[nodiscard]] QString first(qsizetype n)
const &
470 { verify(0, n);
return sliced(0, n); }
471 [[nodiscard]] QString last(qsizetype n)
const &
472 { verify(0, n);
return sliced(size() - n, n); }
473 [[nodiscard]] QString sliced(qsizetype pos)
const &
474 { verify(pos, 0);
return sliced(pos, size() - pos); }
475 [[nodiscard]] QString sliced(qsizetype pos, qsizetype n)
const &
476 { verify(pos, n);
return QString(begin() + pos, n); }
477 [[nodiscard]] QString chopped(qsizetype n)
const &
478 { verify(0, n);
return sliced(0, size() - n); }
480 [[nodiscard]] QString first(qsizetype n) &&
484 return std::move(*
this);
486 [[nodiscard]] QString last(qsizetype n) &&
487 { verify(0, n);
return sliced_helper(*
this, size() - n, n); }
488 [[nodiscard]] QString sliced(qsizetype pos) &&
489 { verify(pos, 0);
return sliced_helper(*
this, pos, size() - pos); }
490 [[nodiscard]] QString sliced(qsizetype pos, qsizetype n) &&
491 { verify(pos, n);
return sliced_helper(*
this, pos, n); }
492 [[nodiscard]] QString chopped(qsizetype n) &&
493 { verify(0, n);
return std::move(*
this).first(size() - n); }
495 bool startsWith(
const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
496 [[nodiscard]]
bool startsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const noexcept
497 {
return QtPrivate::startsWith(*
this, s, cs); }
498 bool startsWith(QLatin1StringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
499 bool startsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
501 bool endsWith(
const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
502 [[nodiscard]]
bool endsWith(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const noexcept
503 {
return QtPrivate::endsWith(*
this, s, cs); }
504 bool endsWith(QLatin1StringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
505 bool endsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
507 bool isUpper()
const;
508 bool isLower()
const;
510 [[nodiscard]] QString leftJustified(qsizetype width, QChar fill = u' ',
bool trunc =
false)
const;
511 [[nodiscard]] QString rightJustified(qsizetype width, QChar fill = u' ',
bool trunc =
false)
const;
514 [[nodiscard]] QString toLower()
const &
515 {
return toLower_helper(*
this); }
516 [[nodiscard]] QString toLower() &&
517 {
return toLower_helper(*
this); }
518 [[nodiscard]] QString toUpper()
const &
519 {
return toUpper_helper(*
this); }
520 [[nodiscard]] QString toUpper() &&
521 {
return toUpper_helper(*
this); }
522 [[nodiscard]] QString toCaseFolded()
const &
523 {
return toCaseFolded_helper(*
this); }
524 [[nodiscard]] QString toCaseFolded() &&
525 {
return toCaseFolded_helper(*
this); }
526 [[nodiscard]] QString trimmed()
const &
527 {
return trimmed_helper(*
this); }
528 [[nodiscard]] QString trimmed() &&
529 {
return trimmed_helper(*
this); }
530 [[nodiscard]] QString simplified()
const &
531 {
return simplified_helper(*
this); }
532 [[nodiscard]] QString simplified() &&
533 {
return simplified_helper(*
this); }
535 [[nodiscard]] QString toLower()
const;
536 [[nodiscard]] QString toUpper()
const;
537 [[nodiscard]] QString toCaseFolded()
const;
538 [[nodiscard]] QString trimmed()
const;
539 [[nodiscard]] QString simplified()
const;
541 [[nodiscard]] QString toHtmlEscaped()
const;
543 QString &insert(qsizetype i, QChar c);
544 QString &insert(qsizetype i,
const QChar *uc, qsizetype len);
545 inline QString &insert(qsizetype i,
const QString &s) {
return insert(i, s.constData(), s.size()); }
546 inline QString &insert(qsizetype i, QStringView v) {
return insert(i, v.data(), v.size()); }
547 QString &insert(qsizetype i, QLatin1StringView s);
548 QString &insert(qsizetype i, QUtf8StringView s);
550 QString &append(QChar c);
551 QString &append(
const QChar *uc, qsizetype len);
552 QString &append(
const QString &s);
553 inline QString &append(QStringView v) {
return append(v.data(), v.size()); }
554 QString &append(QLatin1StringView s);
555 QString &append(QUtf8StringView s);
557 inline QString &prepend(QChar c) {
return insert(0, c); }
558 inline QString &prepend(
const QChar *uc, qsizetype len) {
return insert(0, uc, len); }
559 inline QString &prepend(
const QString &s) {
return insert(0, s); }
560 inline QString &prepend(QStringView v) {
return prepend(v.data(), v.size()); }
561 inline QString &prepend(QLatin1StringView s) {
return insert(0, s); }
562 QString &prepend(QUtf8StringView s) {
return insert(0, s); }
564 QString &assign(QAnyStringView s);
565 inline QString &assign(qsizetype n, QChar c)
570 template <
typename InputIterator, if_compatible_iterator<InputIterator> =
true>
571 QString &assign(InputIterator first, InputIterator last)
573 using V =
typename std::iterator_traits<InputIterator>::value_type;
574 constexpr bool IsL1C = std::is_same_v<std::remove_cv_t<V>, QLatin1Char>;
575 constexpr bool IsFwdIt = std::is_convertible_v<
576 typename std::iterator_traits<InputIterator>::iterator_category,
577 std::forward_iterator_tag
580 if constexpr (is_contiguous_iterator_v<InputIterator>) {
581 const auto p = q20::to_address(first);
582 const auto len = qsizetype(last - first);
584 return assign(QLatin1StringView(
reinterpret_cast<
const char*>(p), len));
585 else if constexpr (
sizeof(V) == 4)
586 return assign_helper(p, len);
588 return assign(QAnyStringView(p, len));
589 }
else if constexpr (
sizeof(V) == 4) {
591 if constexpr (IsFwdIt) {
592 const qsizetype requiredCapacity = 2 * std::distance(first, last);
593 reserve(requiredCapacity);
595 while (first != last) {
596 append(QChar::fromUcs4(*first));
600 }
else if constexpr (QtPrivate::IsCompatibleChar8Type<V>::value) {
601 assign_helper_char8(first, last);
602 if (d.constAllocatedCapacity())
603 d.data()[d.size] = u'\0';
606 d.assign(first, last, [](QChar ch) ->
char16_t {
return ch.unicode(); });
607 if (d.constAllocatedCapacity())
608 d.data()[d.size] = u'\0';
613 inline QString &operator+=(QChar c) {
return append(c); }
615 inline QString &operator+=(
const QString &s) {
return append(s); }
616 inline QString &operator+=(QStringView v) {
return append(v); }
617 inline QString &operator+=(QLatin1StringView s) {
return append(s); }
618 QString &operator+=(QUtf8StringView s) {
return append(s); }
620#if defined(QT_RESTRICTED_CAST_FROM_ASCII)
621 template <qsizetype N>
622 QString &insert(qsizetype i,
const char (&ch)[N]) {
return insert(i, QUtf8StringView(ch)); }
623 template <qsizetype N>
624 QString &append(
const char (&ch)[N]) {
return append(QUtf8StringView(ch)); }
625 template <qsizetype N>
626 QString &prepend(
const char (&ch)[N]) {
return prepend(QUtf8StringView(ch)); }
627 template <qsizetype N>
628 QString &operator+=(
const char (&ch)[N]) {
return append(QUtf8StringView(ch)); }
631 QString &remove(qsizetype i, qsizetype len);
632 QString &remove(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive);
633 QString &remove(QLatin1StringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive);
634 QString &remove(
const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive);
636 QString &removeAt(qsizetype pos)
637 {
return size_t(pos) < size_t(size()) ? remove(pos, 1) : *
this; }
638 QString &removeFirst() {
return !isEmpty() ? remove(0, 1) : *
this; }
639 QString &removeLast() {
return !isEmpty() ? remove(size() - 1, 1) : *
this; }
641 template <
typename Predicate>
642 QString &removeIf(Predicate pred)
644 removeIf_helper(pred);
648 QString &replace(qsizetype i, qsizetype len, QChar after);
649 QString &replace(qsizetype i, qsizetype len,
const QChar *s, qsizetype slen);
650 QString &replace(qsizetype i, qsizetype len,
const QString &after);
651 QString &replace(QChar before, QChar after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
652 QString &replace(
const QChar *before, qsizetype blen,
const QChar *after, qsizetype alen, Qt::CaseSensitivity cs = Qt::CaseSensitive);
653 QString &replace(QLatin1StringView before, QLatin1StringView after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
654 QString &replace(QLatin1StringView before,
const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
655 QString &replace(
const QString &before, QLatin1StringView after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
656 QString &replace(
const QString &before,
const QString &after,
657 Qt::CaseSensitivity cs = Qt::CaseSensitive);
658 QString &replace(QChar c,
const QString &after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
659 QString &replace(QChar c, QLatin1StringView after, Qt::CaseSensitivity cs = Qt::CaseSensitive);
660#if QT_CONFIG(regularexpression)
661 QString &replace(
const QRegularExpression &re,
const QString &after);
662 inline QString &remove(
const QRegularExpression &re)
663 {
return replace(re, QString()); }
668 QStringList split(
const QString &sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts,
669 Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
671 QStringList split(QChar sep, Qt::SplitBehavior behavior = Qt::KeepEmptyParts,
672 Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
673#ifndef QT_NO_REGULAREXPRESSION
675 QStringList split(
const QRegularExpression &sep,
676 Qt::SplitBehavior behavior = Qt::KeepEmptyParts)
const;
679 template <
typename Needle,
typename...Flags>
680 [[nodiscard]]
inline auto tokenize(Needle &&needle, Flags...flags)
const &
681 noexcept(
noexcept(qTokenize(std::declval<
const QString &>(), std::forward<Needle>(needle), flags...)))
682 ->
decltype(qTokenize(*
this, std::forward<Needle>(needle), flags...))
683 {
return qTokenize(qToStringViewIgnoringNull(*
this), std::forward<Needle>(needle), flags...); }
685 template <
typename Needle,
typename...Flags>
686 [[nodiscard]]
inline auto tokenize(Needle &&needle, Flags...flags)
const &&
687 noexcept(
noexcept(qTokenize(std::declval<
const QString>(), std::forward<Needle>(needle), flags...)))
688 ->
decltype(qTokenize(std::move(*
this), std::forward<Needle>(needle), flags...))
689 {
return qTokenize(std::move(*
this), std::forward<Needle>(needle), flags...); }
691 template <
typename Needle,
typename...Flags>
692 [[nodiscard]]
inline auto tokenize(Needle &&needle, Flags...flags) &&
693 noexcept(
noexcept(qTokenize(std::declval<QString>(), std::forward<Needle>(needle), flags...)))
694 ->
decltype(qTokenize(std::move(*
this), std::forward<Needle>(needle), flags...))
695 {
return qTokenize(std::move(*
this), std::forward<Needle>(needle), flags...); }
698 enum NormalizationForm {
701 NormalizationForm_KD,
704 [[nodiscard]] QString normalized(NormalizationForm mode, QChar::UnicodeVersion version = QChar::Unicode_Unassigned)
const;
706 [[nodiscard]] QString repeated(qsizetype times)
const;
708 const ushort *utf16()
const;
709 [[nodiscard]] QString nullTerminated()
const &
713 return QString{constData(), size()};
717 [[nodiscard]] QString nullTerminated() &&
721 return QString{constData(), size()};
722 return std::move(*
this);
725 QString &nullTerminate()
729 *
this = QString{constData(), size()};
734 [[nodiscard]] QByteArray toLatin1()
const &
735 {
return toLatin1_helper(*
this); }
736 [[nodiscard]] QByteArray toLatin1() &&
737 {
return toLatin1_helper_inplace(*
this); }
738 [[nodiscard]] QByteArray toUtf8()
const &
739 {
return toUtf8_helper(*
this); }
740 [[nodiscard]] QByteArray toUtf8() &&
741 {
return toUtf8_helper(*
this); }
742 [[nodiscard]] QByteArray toLocal8Bit()
const &
743 {
return toLocal8Bit_helper(isNull() ?
nullptr : constData(), size()); }
744 [[nodiscard]] QByteArray toLocal8Bit() &&
745 {
return toLocal8Bit_helper(isNull() ?
nullptr : constData(), size()); }
747 [[nodiscard]] QByteArray toLatin1()
const;
748 [[nodiscard]] QByteArray toUtf8()
const;
749 [[nodiscard]] QByteArray toLocal8Bit()
const;
751 [[nodiscard]] QList<uint> toUcs4()
const;
754 static QString fromLatin1(QByteArrayView ba);
756 static inline QString fromLatin1(
const QByteArray &ba) {
return fromLatin1(QByteArrayView(ba)); }
757 static inline QString fromLatin1(
const char *str, qsizetype size)
759 return fromLatin1(QByteArrayView(str, !str || size < 0 ? qstrlen(str) : size));
761 static QString fromUtf8(QByteArrayView utf8);
763 static inline QString fromUtf8(
const QByteArray &ba) {
return fromUtf8(QByteArrayView(ba)); }
764 static inline QString fromUtf8(
const char *utf8, qsizetype size)
766 return fromUtf8(QByteArrayView(utf8, !utf8 || size < 0 ? qstrlen(utf8) : size));
768#if defined(__cpp_char8_t) || defined(Q_QDOC)
770 static inline QString fromUtf8(
const char8_t *str)
771 {
return fromUtf8(
reinterpret_cast<
const char *>(str)); }
773 static inline QString fromUtf8(
const char8_t *str, qsizetype size)
774 {
return fromUtf8(
reinterpret_cast<
const char *>(str), size); }
776 static QString fromLocal8Bit(QByteArrayView ba);
778 static inline QString fromLocal8Bit(
const QByteArray &ba) {
return fromLocal8Bit(QByteArrayView(ba)); }
779 static inline QString fromLocal8Bit(
const char *str, qsizetype size)
781 return fromLocal8Bit(QByteArrayView(str, !str || size < 0 ? qstrlen(str) : size));
783 static QString fromUtf16(
const char16_t *, qsizetype size = -1);
784 static QString fromUcs4(
const char32_t *, qsizetype size = -1);
785 static QString fromRawData(
const char16_t *unicode, qsizetype size)
787 return QString(DataPointer::fromRawData(unicode, size));
789 QT_CORE_INLINE_SINCE(6, 10)
790 static QString fromRawData(
const QChar *, qsizetype size);
792#if QT_DEPRECATED_SINCE(6
, 0
)
793 QT_DEPRECATED_VERSION_X_6_0(
"Use char16_t* overload.")
794 static QString fromUtf16(
const ushort *str, qsizetype size = -1)
795 {
return fromUtf16(
reinterpret_cast<
const char16_t *>(str), size); }
796 QT_DEPRECATED_VERSION_X_6_0(
"Use char32_t* overload.")
797 static QString fromUcs4(
const uint *str, qsizetype size = -1)
798 {
return fromUcs4(
reinterpret_cast<
const char32_t *>(str), size); }
801 inline qsizetype toWCharArray(
wchar_t *array)
const;
802 [[nodiscard]]
static inline QString fromWCharArray(
const wchar_t *string, qsizetype size = -1);
804 QString &setRawData(
const QChar *unicode, qsizetype size);
805 QString &setUnicode(
const QChar *unicode, qsizetype size);
807 QString &setUnicode(
const char16_t *utf16, qsizetype size)
808 {
return setUnicode(
reinterpret_cast<
const QChar *>(utf16), size); }
809 QString &setUtf16(
const char16_t *utf16, qsizetype size)
810 {
return setUnicode(
reinterpret_cast<
const QChar *>(utf16), size); }
812#if !QT_CORE_REMOVED_SINCE(6
, 9
)
815 QString &setUtf16(
const ushort *autf16, qsizetype asize)
816 {
return setUnicode(
reinterpret_cast<
const QChar *>(autf16), asize); }
818 int compare(
const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const noexcept;
819 int compare(QLatin1StringView other, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const noexcept;
820 inline int compare(QStringView s, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const noexcept;
821 int compare(QChar ch, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const noexcept
822 {
return compare(QStringView{&ch, 1}, cs); }
824 static inline int compare(
const QString &s1,
const QString &s2,
825 Qt::CaseSensitivity cs = Qt::CaseSensitive)
noexcept
826 {
return s1.compare(s2, cs); }
828 static inline int compare(
const QString &s1, QLatin1StringView s2,
829 Qt::CaseSensitivity cs = Qt::CaseSensitive)
noexcept
830 {
return s1.compare(s2, cs); }
831 static inline int compare(QLatin1StringView s1,
const QString &s2,
832 Qt::CaseSensitivity cs = Qt::CaseSensitive)
noexcept
833 {
return -s2.compare(s1, cs); }
834 static int compare(
const QString &s1, QStringView s2, Qt::CaseSensitivity cs = Qt::CaseSensitive)
noexcept
835 {
return s1.compare(s2, cs); }
836 static int compare(QStringView s1,
const QString &s2, Qt::CaseSensitivity cs = Qt::CaseSensitive)
noexcept
837 {
return -s2.compare(s1, cs); }
839 int localeAwareCompare(
const QString& s)
const;
840 inline int localeAwareCompare(QStringView s)
const;
841 static int localeAwareCompare(
const QString& s1,
const QString& s2)
842 {
return s1.localeAwareCompare(s2); }
844 static inline int localeAwareCompare(QStringView s1, QStringView s2);
846 short toShort(
bool *ok=
nullptr,
int base=10)
const
847 {
return toIntegral_helper<
short>(*
this, ok, base); }
848 ushort toUShort(
bool *ok=
nullptr,
int base=10)
const
849 {
return toIntegral_helper<ushort>(*
this, ok, base); }
850 int toInt(
bool *ok=
nullptr,
int base=10)
const
851 {
return toIntegral_helper<
int>(*
this, ok, base); }
852 uint toUInt(
bool *ok=
nullptr,
int base=10)
const
853 {
return toIntegral_helper<uint>(*
this, ok, base); }
854 long toLong(
bool *ok=
nullptr,
int base=10)
const
855 {
return toIntegral_helper<
long>(*
this, ok, base); }
856 ulong toULong(
bool *ok=
nullptr,
int base=10)
const
857 {
return toIntegral_helper<ulong>(*
this, ok, base); }
858 QT_CORE_INLINE_SINCE(6, 5)
859 qlonglong toLongLong(
bool *ok=
nullptr,
int base=10)
const;
860 QT_CORE_INLINE_SINCE(6, 5)
861 qulonglong toULongLong(
bool *ok=
nullptr,
int base=10)
const;
862 float toFloat(
bool *ok=
nullptr)
const;
863 double toDouble(
bool *ok=
nullptr)
const;
865 inline QString &setNum(
short,
int base=10);
866 inline QString &setNum(ushort,
int base=10);
867 inline QString &setNum(
int,
int base=10);
868 inline QString &setNum(uint,
int base=10);
869 inline QString &setNum(
long,
int base=10);
870 inline QString &setNum(ulong,
int base=10);
871 QString &setNum(qlonglong,
int base=10);
872 QString &setNum(qulonglong,
int base=10);
873 inline QString &setNum(
float,
char format=
'g',
int precision=6);
874 QString &setNum(
double,
char format=
'g',
int precision=6);
876 static QString number(
int,
int base=10);
877 static QString number(uint,
int base=10);
878 static QString number(
long,
int base=10);
879 static QString number(ulong,
int base=10);
880 static QString number(qlonglong,
int base=10);
881 static QString number(qulonglong,
int base=10);
882 static QString number(
double,
char format=
'g',
int precision=6);
884 friend bool comparesEqual(
const QString &s1,
const QString &s2)
noexcept
885 {
return comparesEqual(QStringView(s1), QStringView(s2)); }
886 friend Qt::strong_ordering compareThreeWay(
const QString &s1,
const QString &s2)
noexcept
887 {
return compareThreeWay(QStringView(s1), QStringView(s2)); }
888 Q_DECLARE_STRONGLY_ORDERED(QString)
891 friend bool comparesEqual(
const QString &s1, QUtf8StringView s2)
noexcept
892 {
return QtPrivate::equalStrings(s1, s2); }
894 friend Qt::strong_ordering compareThreeWay(
const QString &s1, QUtf8StringView s2)
noexcept
896 const int res = QtPrivate::compareStrings(s1, s2, Qt::CaseSensitive);
897 return Qt::compareThreeWay(res, 0);
899 Q_DECLARE_STRONGLY_ORDERED(QString, QUtf8StringView, Q_WEAK_OVERLOAD)
902 friend bool comparesEqual(
const QString &s1,
const char8_t *s2)
noexcept
903 {
return comparesEqual(s1, QUtf8StringView(s2)); }
904 friend Qt::strong_ordering compareThreeWay(
const QString &s1,
const char8_t *s2)
noexcept
905 {
return compareThreeWay(s1, QUtf8StringView(s2)); }
906 Q_DECLARE_STRONGLY_ORDERED(QString,
const char8_t *)
909 friend bool comparesEqual(
const QString &s1, QLatin1StringView s2)
noexcept
910 {
return (s1.size() == s2.size()) && QtPrivate::equalStrings(s1, s2); }
911 friend Qt::strong_ordering
912 compareThreeWay(
const QString &s1, QLatin1StringView s2)
noexcept
914 const int res = QtPrivate::compareStrings(s1, s2, Qt::CaseSensitive);
915 return Qt::compareThreeWay(res, 0);
917 Q_DECLARE_STRONGLY_ORDERED(QString, QLatin1StringView)
920 friend bool comparesEqual(
const QString &s1, std::nullptr_t)
noexcept
921 {
return s1.isEmpty(); }
922 friend Qt::strong_ordering compareThreeWay(
const QString &s1, std::nullptr_t)
noexcept
923 {
return s1.isEmpty() ? Qt::strong_ordering::equivalent : Qt::strong_ordering::greater; }
924 Q_DECLARE_STRONGLY_ORDERED(QString, std::nullptr_t)
926 friend bool comparesEqual(
const QString &s1,
const char16_t *s2)
noexcept
927 {
return comparesEqual(s1, QStringView(s2)); }
928 friend Qt::strong_ordering compareThreeWay(
const QString &s1,
const char16_t *s2)
noexcept
929 {
return compareThreeWay(s1, QStringView(s2)); }
930 Q_DECLARE_STRONGLY_ORDERED(QString,
const char16_t *)
933 friend bool comparesEqual(
const QString &lhs, QChar rhs)
noexcept
934 {
return lhs.size() == 1 && rhs == lhs.front(); }
935 friend Qt::strong_ordering compareThreeWay(
const QString &lhs, QChar rhs)
noexcept
937 const int res = compare_helper(lhs.data(), lhs.size(), &rhs, 1);
938 return Qt::compareThreeWay(res, 0);
940 Q_DECLARE_STRONGLY_ORDERED(QString, QChar)
943#if defined(QT_RESTRICTED_CAST_FROM_ASCII)
944 template <qsizetype N>
945 inline QString(
const char (&ch)[N])
946 : QString(fromUtf8(ch))
948 template <qsizetype N>
949 QString(
char (&)[N]) =
delete;
950 template <qsizetype N>
951 inline QString &operator=(
const char (&ch)[N])
952 {
return (*
this = fromUtf8(ch, N - 1)); }
953 template <qsizetype N>
954 QString &operator=(
char (&)[N]) =
delete;
956#if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII)
957 QT_ASCII_CAST_WARN
inline QString(
const char *ch)
958 : QString(fromUtf8(ch))
960 QT_ASCII_CAST_WARN
inline QString(
const QByteArray &a)
961 : QString(fromUtf8(a))
963 QT_ASCII_CAST_WARN
inline QString &operator=(
const char *ch)
971 QT_ASCII_CAST_WARN
inline QString &operator=(
const QByteArray &a)
980 QT_ASCII_CAST_WARN
inline QString &prepend(
const char *s)
981 {
return prepend(QUtf8StringView(s)); }
982 QT_ASCII_CAST_WARN
inline QString &prepend(
const QByteArray &s)
983 {
return prepend(QUtf8StringView(s)); }
984 QT_ASCII_CAST_WARN
inline QString &append(
const char *s)
985 {
return append(QUtf8StringView(s)); }
986 QT_ASCII_CAST_WARN
inline QString &append(
const QByteArray &s)
987 {
return append(QUtf8StringView(s)); }
988 QT_ASCII_CAST_WARN
inline QString &insert(qsizetype i,
const char *s)
989 {
return insert(i, QUtf8StringView(s)); }
990 QT_ASCII_CAST_WARN
inline QString &insert(qsizetype i,
const QByteArray &s)
991 {
return insert(i, QUtf8StringView(s)); }
992 QT_ASCII_CAST_WARN
inline QString &operator+=(
const char *s)
993 {
return append(QUtf8StringView(s)); }
994 QT_ASCII_CAST_WARN
inline QString &operator+=(
const QByteArray &s)
995 {
return append(QUtf8StringView(s)); }
997#if QT_CORE_REMOVED_SINCE(6
, 8
)
998 QT_ASCII_CAST_WARN
inline bool operator==(
const char *s)
const;
999 QT_ASCII_CAST_WARN
inline bool operator!=(
const char *s)
const;
1000 QT_ASCII_CAST_WARN
inline bool operator<(
const char *s)
const;
1001 QT_ASCII_CAST_WARN
inline bool operator<=(
const char *s)
const;
1002 QT_ASCII_CAST_WARN
inline bool operator>(
const char *s)
const;
1003 QT_ASCII_CAST_WARN
inline bool operator>=(
const char *s)
const;
1005 QT_ASCII_CAST_WARN
inline bool operator==(
const QByteArray &s)
const;
1006 QT_ASCII_CAST_WARN
inline bool operator!=(
const QByteArray &s)
const;
1007 QT_ASCII_CAST_WARN
inline bool operator<(
const QByteArray &s)
const;
1008 QT_ASCII_CAST_WARN
inline bool operator>(
const QByteArray &s)
const;
1009 QT_ASCII_CAST_WARN
inline bool operator<=(
const QByteArray &s)
const;
1010 QT_ASCII_CAST_WARN
inline bool operator>=(
const QByteArray &s)
const;
1012 friend bool comparesEqual(
const QString &lhs, QByteArrayView rhs)
noexcept
1014 return QString::compare_helper(lhs.constData(), lhs.size(),
1015 rhs.constData(), rhs.size()) == 0;
1017 friend Qt::strong_ordering
1018 compareThreeWay(
const QString &lhs, QByteArrayView rhs)
noexcept
1020 const int res = QString::compare_helper(lhs.constData(), lhs.size(),
1021 rhs.constData(), rhs.size());
1022 return Qt::compareThreeWay(res, 0);
1024 Q_DECLARE_STRONGLY_ORDERED(QString, QByteArrayView, QT_ASCII_CAST_WARN)
1026 friend bool comparesEqual(
const QString &lhs,
const QByteArray &rhs)
noexcept
1027 {
return comparesEqual(lhs, QByteArrayView(rhs)); }
1028 friend Qt::strong_ordering
1029 compareThreeWay(
const QString &lhs,
const QByteArray &rhs)
noexcept
1031 return compareThreeWay(lhs, QByteArrayView(rhs));
1033 Q_DECLARE_STRONGLY_ORDERED(QString, QByteArray, QT_ASCII_CAST_WARN)
1035 friend bool comparesEqual(
const QString &lhs,
const char *rhs)
noexcept
1036 {
return comparesEqual(lhs, QByteArrayView(rhs)); }
1037 friend Qt::strong_ordering
1038 compareThreeWay(
const QString &lhs,
const char *rhs)
noexcept
1040 return compareThreeWay(lhs, QByteArrayView(rhs));
1042 Q_DECLARE_STRONGLY_ORDERED(QString,
const char *, QT_ASCII_CAST_WARN)
1047 typedef QChar *iterator;
1048 typedef const QChar *const_iterator;
1049 typedef iterator Iterator;
1050 typedef const_iterator ConstIterator;
1051 typedef std::reverse_iterator<iterator> reverse_iterator;
1052 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
1053 inline iterator begin();
1054 inline const_iterator begin()
const;
1055 inline const_iterator cbegin()
const;
1056 inline const_iterator constBegin()
const;
1057 inline iterator end();
1058 inline const_iterator end()
const;
1059 inline const_iterator cend()
const;
1060 inline const_iterator constEnd()
const;
1061 reverse_iterator rbegin() {
return reverse_iterator(end()); }
1062 reverse_iterator rend() {
return reverse_iterator(begin()); }
1063 const_reverse_iterator rbegin()
const {
return const_reverse_iterator(end()); }
1064 const_reverse_iterator rend()
const {
return const_reverse_iterator(begin()); }
1065 const_reverse_iterator crbegin()
const {
return const_reverse_iterator(end()); }
1066 const_reverse_iterator crend()
const {
return const_reverse_iterator(begin()); }
1069 typedef qsizetype size_type;
1070 typedef qptrdiff difference_type;
1071 typedef const QChar & const_reference;
1072 typedef QChar & reference;
1073 typedef QChar *pointer;
1074 typedef const QChar *const_pointer;
1075 typedef QChar value_type;
1076 inline void push_back(QChar c) { append(c); }
1077 inline void push_back(
const QString &s) { append(s); }
1078 inline void push_front(QChar c) { prepend(c); }
1079 inline void push_front(
const QString &s) { prepend(s); }
1080 void shrink_to_fit() { squeeze(); }
1081 iterator erase(const_iterator first, const_iterator last);
1082 inline iterator erase(const_iterator it) {
return erase(it, it + 1); }
1083 constexpr qsizetype max_size()
const noexcept
1088 static inline QString fromStdString(
const std::string &s);
1089 std::string toStdString()
const;
1090 static inline QString fromStdWString(
const std::wstring &s);
1091 inline std::wstring toStdWString()
const;
1093 static inline QString fromStdU16String(
const std::u16string &s);
1094 inline std::u16string toStdU16String()
const;
1095 static inline QString fromStdU32String(
const std::u32string &s);
1096 inline std::u32string toStdU32String()
const;
1098 Q_IMPLICIT
inline operator std::u16string_view()
const noexcept;
1100#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
1101 static QString fromCFString(CFStringRef string);
1102 CFStringRef toCFString()
const Q_DECL_CF_RETURNS_RETAINED;
1103 static QString fromNSString(
const NSString *string);
1104 NSString *toNSString()
const Q_DECL_NS_RETURNS_AUTORELEASED;
1107#if defined(Q_OS_WASM) || defined(Q_QDOC)
1108 static QString fromEcmaString(emscripten::val jsString);
1109 emscripten::val toEcmaString()
const;
1112 constexpr bool isNull()
const {
return d.isNull(); }
1114 bool isRightToLeft()
const;
1115 [[nodiscard]]
bool isValidUtf16()
const noexcept
1116 {
return QStringView(*
this).isValidUtf16(); }
1118 QString(qsizetype size, Qt::Initialization);
1119 explicit QString(DataPointer &&dd) : d(std::move(dd)) {}
1122#if defined(QT_NO_CAST_FROM_ASCII)
1123#define QSTRING_DECL_DELETED_ASCII_OP Q_DECL_EQ_DELETE_X("This function is not available under QT_NO_CAST_FROM_ASCII")
1124 QString &operator+=(
const char *s) QSTRING_DECL_DELETED_ASCII_OP;
1125 QString &operator+=(
const QByteArray &s) QSTRING_DECL_DELETED_ASCII_OP;
1126 QString(
const char *ch) QSTRING_DECL_DELETED_ASCII_OP;
1127 QString(
const QByteArray &a) QSTRING_DECL_DELETED_ASCII_OP;
1128 QString &operator=(
const char *ch) QSTRING_DECL_DELETED_ASCII_OP;
1129 QString &operator=(
const QByteArray &a) QSTRING_DECL_DELETED_ASCII_OP;
1130#undef QSTRING_DECL_DELETED_ASCII_OP
1134 static const char16_t _empty;
1136 void reallocData(qsizetype alloc, QArrayData::AllocationOption option);
1137 void reallocGrowData(qsizetype n);
1139 QString &assign_helper(
const char32_t *data, qsizetype len);
1141 template <
typename InputIterator>
1142 void assign_helper_char8(InputIterator first, InputIterator last);
1143 static int compare_helper(
const QChar *data1, qsizetype length1,
1144 const QChar *data2, qsizetype length2,
1145 Qt::CaseSensitivity cs = Qt::CaseSensitive)
noexcept;
1146 static int compare_helper(
const QChar *data1, qsizetype length1,
1147 const char *data2, qsizetype length2,
1148 Qt::CaseSensitivity cs = Qt::CaseSensitive)
noexcept;
1149 static int localeAwareCompare_helper(
const QChar *data1, qsizetype length1,
1150 const QChar *data2, qsizetype length2);
1151 static QString sliced_helper(QString &str, qsizetype pos, qsizetype n);
1152 static QString toLower_helper(
const QString &str);
1153 static QString toLower_helper(QString &str);
1154 static QString toUpper_helper(
const QString &str);
1155 static QString toUpper_helper(QString &str);
1156 static QString toCaseFolded_helper(
const QString &str);
1157 static QString toCaseFolded_helper(QString &str);
1158 static QString trimmed_helper(
const QString &str);
1159 static QString trimmed_helper(QString &str);
1160 static QString simplified_helper(
const QString &str);
1161 static QString simplified_helper(QString &str);
1162 static QByteArray toLatin1_helper(
const QString &);
1163 static QByteArray toLatin1_helper_inplace(QString &);
1164 static QByteArray toUtf8_helper(
const QString &);
1165 static QByteArray toLocal8Bit_helper(
const QChar *data, qsizetype size);
1166#if QT_CORE_REMOVED_SINCE(6
, 6
)
1167 static qsizetype toUcs4_helper(
const ushort *uc, qsizetype length, uint *out);
1169 static qsizetype toUcs4_helper(
const char16_t *uc, qsizetype length,
char32_t *out);
1170 static qlonglong toIntegral_helper(QStringView string,
bool *ok,
int base);
1171 static qulonglong toIntegral_helper(QStringView string,
bool *ok, uint base);
1172 template <
typename Predicate>
1173 qsizetype removeIf_helper(Predicate pred)
1175 const qsizetype result = d->eraseIf(pred);
1177 d.data()[d.size] = u'\0';
1181 friend class QStringView;
1182 friend class QByteArray;
1183 friend struct QAbstractConcatenable;
1184 template <
typename T>
friend qsizetype erase(QString &s,
const T &t);
1185 template <
typename Predicate>
friend qsizetype erase_if(QString &s, Predicate pred);
1187 template <
typename T>
static
1188 T toIntegral_helper(QStringView string,
bool *ok,
int base)
1190 using Int64 =
typename std::conditional<std::is_unsigned<T>::value, qulonglong, qlonglong>::type;
1191 using Int32 =
typename std::conditional<std::is_unsigned<T>::value, uint,
int>::type;
1194 Int64 val = toIntegral_helper(string, ok, Int32(base));
1195 if (T(val) != val) {
1203 Q_ALWAYS_INLINE
constexpr void verify([[maybe_unused]] qsizetype pos = 0,
1204 [[maybe_unused]] qsizetype n = 1)
const
1207 Q_ASSERT(pos <= d.size);
1209 Q_ASSERT(n <= d.size - pos);
1213 inline DataPointer &data_ptr() {
return d; }
1214 inline const DataPointer &data_ptr()
const {
return d; }
1221int QLatin1StringView::compare(QUtf8StringView other, Qt::CaseSensitivity cs)
const noexcept
1222{
return QtPrivate::compareStrings(*
this, other, cs); }
1228QString QLatin1StringView::toString()
const {
return *
this; }
1234int QStringView::compare(QUtf8StringView other, Qt::CaseSensitivity cs)
const noexcept
1235{
return QtPrivate::compareStrings(*
this, other, cs); }
1241QString QStringView::toString()
const
1242{
return QString(*
this); }
1244qint64 QStringView::toLongLong(
bool *ok,
int base)
const
1245{
return QString::toIntegral_helper<qint64>(*
this, ok, base); }
1246quint64 QStringView::toULongLong(
bool *ok,
int base)
const
1247{
return QString::toIntegral_helper<quint64>(*
this, ok, base); }
1248long QStringView::toLong(
bool *ok,
int base)
const
1249{
return QString::toIntegral_helper<
long>(*
this, ok, base); }
1250ulong QStringView::toULong(
bool *ok,
int base)
const
1251{
return QString::toIntegral_helper<ulong>(*
this, ok, base); }
1252int QStringView::toInt(
bool *ok,
int base)
const
1253{
return QString::toIntegral_helper<
int>(*
this, ok, base); }
1254uint QStringView::toUInt(
bool *ok,
int base)
const
1255{
return QString::toIntegral_helper<uint>(*
this, ok, base); }
1256short QStringView::toShort(
bool *ok,
int base)
const
1257{
return QString::toIntegral_helper<
short>(*
this, ok, base); }
1258ushort QStringView::toUShort(
bool *ok,
int base)
const
1259{
return QString::toIntegral_helper<ushort>(*
this, ok, base); }
1265template <
bool UseChar8T>
1266int QBasicUtf8StringView<UseChar8T>::compare(QChar other, Qt::CaseSensitivity cs)
const noexcept
1268 return QtPrivate::compareStrings(*
this, QStringView(&other, 1), cs);
1271template <
bool UseChar8T>
1272int QBasicUtf8StringView<UseChar8T>::compare(QStringView other, Qt::CaseSensitivity cs)
const noexcept
1274 return QtPrivate::compareStrings(*
this, other, cs);
1277template <
bool UseChar8T>
1278[[nodiscard]]
bool QBasicUtf8StringView<UseChar8T>::equal(QChar other)
const noexcept
1280 return QtPrivate::equalStrings(*
this, QStringView(&other, 1));
1283template <
bool UseChar8T>
1284[[nodiscard]]
bool QBasicUtf8StringView<UseChar8T>::equal(QStringView other)
const noexcept
1286 return QtPrivate::equalStrings(*
this, other);
1293template <
bool UseChar8T>
1294QString QBasicUtf8StringView<UseChar8T>::toString()
const
1296 return QString::fromUtf8(data(), size());
1299template<
bool UseChar8T>
1300[[nodiscard]]
int QBasicUtf8StringView<UseChar8T>::compare(QLatin1StringView other,
1301 Qt::CaseSensitivity cs)
const noexcept
1303 return QtPrivate::compareStrings(*
this, other, cs);
1306template<
bool UseChar8T>
1307[[nodiscard]]
int QBasicUtf8StringView<UseChar8T>::compare(
const QByteArray &other,
1308 Qt::CaseSensitivity cs)
const noexcept
1310 return QtPrivate::compareStrings(*
this,
1311 QBasicUtf8StringView<UseChar8T>(other.data(), other.size()),
1315template <
bool UseChar8T>
1316[[nodiscard]]
bool QBasicUtf8StringView<UseChar8T>::equal(QLatin1StringView other)
const noexcept
1318 return QtPrivate::equalStrings(*
this, other);
1321template <
bool UseChar8T>
1322[[nodiscard]]
bool QBasicUtf8StringView<UseChar8T>::equal(
const QByteArray &other)
const noexcept
1324 return size() == other.size()
1325 && QtPrivate::equalStrings(*
this, QBasicUtf8StringView<UseChar8T>(other.data(),