diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index b80af92a549..d315aed8e6b 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -1380,6 +1380,8 @@ QUuid::Version QUuid::version() const noexcept #if QT_CORE_REMOVED_SINCE(6, 10) +#include "qcborstreamwriter.h" // Q_WEAK_OVERLOAD added + #include "qcoreapplication.h" #if QT_CONFIG(permissions) diff --git a/src/corelib/serialization/qcborstreamwriter.cpp b/src/corelib/serialization/qcborstreamwriter.cpp index 4b1ef64313d..950c08270d4 100644 --- a/src/corelib/serialization/qcborstreamwriter.cpp +++ b/src/corelib/serialization/qcborstreamwriter.cpp @@ -397,6 +397,7 @@ void QCborStreamWriter::append(QCborNegativeInteger n) /*! \fn void QCborStreamWriter::append(const QByteArray &ba) + \fn void QCborStreamWriter::append(QByteArrayView ba) \overload Appends the byte array \a ba to the stream, creating a CBOR Byte String @@ -411,6 +412,9 @@ void QCborStreamWriter::append(QCborNegativeInteger n) As the example shows, unlike JSON, CBOR requires no escaping for binary content. + \note The overload taking a \l QByteArrayView has been present since Qt + 6.10. + \sa appendByteString(), QCborStreamReader::isByteArray(), QCborStreamReader::readByteArray() */ diff --git a/src/corelib/serialization/qcborstreamwriter.h b/src/corelib/serialization/qcborstreamwriter.h index 976a0cb34a4..dbc340e0b35 100644 --- a/src/corelib/serialization/qcborstreamwriter.h +++ b/src/corelib/serialization/qcborstreamwriter.h @@ -42,7 +42,11 @@ public: void append(quint64 u); void append(qint64 i); void append(QCborNegativeInteger n); +#if !QT_CORE_REMOVED_SINCE(6, 10) // wasn't a template until 6.10 + Q_WEAK_OVERLOAD +#endif void append(const QByteArray &ba) { appendByteString(ba.constData(), ba.size()); } + void append(QByteArrayView ba) { appendByteString(ba.data(), ba.size()); } void append(QLatin1StringView str); void append(QStringView str); void append(QCborTag tag);