diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index a04550350d2..dd9a13ff355 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -497,6 +497,11 @@ void QMessageAuthenticationCode::setKey(const QByteArray &key) setKey(qToByteArrayViewIgnoringNull(key)); } +void QMessageAuthenticationCode::addData(const QByteArray &data) +{ + addData(qToByteArrayViewIgnoringNull(data)); +} + #include "qstring.h" qsizetype QString::toUcs4_helper(const ushort *uc, qsizetype length, uint *out) diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 9ee2860a27e..ac0ee44860e 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -1355,6 +1355,7 @@ void QMessageAuthenticationCode::setKey(QByteArrayView key) noexcept } /*! + \overload Adds the first \a length chars of \a data to the message. */ void QMessageAuthenticationCode::addData(const char *data, qsizetype length) @@ -1363,9 +1364,13 @@ void QMessageAuthenticationCode::addData(const char *data, qsizetype length) } /*! - \overload addData() + Adds \a data to the message. + + \include qcryptographichash.cpp {qba-to-qbav-6.6} + + \sa resultView(), result() */ -void QMessageAuthenticationCode::addData(const QByteArray &data) +void QMessageAuthenticationCode::addData(QByteArrayView data) noexcept { d->messageHash.addData(data); } diff --git a/src/corelib/tools/qmessageauthenticationcode.h b/src/corelib/tools/qmessageauthenticationcode.h index a753f7045fe..4fd811f74b8 100644 --- a/src/corelib/tools/qmessageauthenticationcode.h +++ b/src/corelib/tools/qmessageauthenticationcode.h @@ -39,7 +39,10 @@ public: void setKey(QByteArrayView key) noexcept; void addData(const char *data, qsizetype length); +#if QT_CORE_REMOVED_SINCE(6, 6) void addData(const QByteArray &data); +#endif + void addData(QByteArrayView data) noexcept; bool addData(QIODevice *device); QByteArrayView resultView() const noexcept;