summaryrefslogtreecommitdiffstats
path: root/src/corelib/compat/removed_api.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-03-02 19:05:16 +0100
committerMarc Mutz <marc.mutz@qt.io>2023-03-17 00:41:31 +0100
commit93cb61e305f834a25ccbe0f2b64e0f8ebb72a168 (patch)
tree334231499546af7171d036c129d1f3fd86f77070 /src/corelib/compat/removed_api.cpp
parent0cab9b56e99712c6985eee5af72e53e1fb04113d (diff)
QMessageAuthenticationCode: port to QByteArrayView [1/3]: ctor/setKey()
The class is not used frequently enough to warrant the overhead of a Q_WEAK_ QByteArray overload to fix the SiC Type A for users that pass objects that implicitly convert to QByteArray. QCryptographicHash also doesn't have it. Also mark setKey() noexcept. Now that it takes a view instead of an owning container, it only calls other noexcept functions. ChangeLog will be on patch [3/3]. Task-number: QTBUG-111676 Task-number: QTBUG-111688 Change-Id: Ic2321d0d41ce8eb4d0390889f28b3fd4bd9af103 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/compat/removed_api.cpp')
-rw-r--r--src/corelib/compat/removed_api.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp
index d99ca42122..a04550350d 100644
--- a/src/corelib/compat/removed_api.cpp
+++ b/src/corelib/compat/removed_api.cpp
@@ -486,6 +486,17 @@ void QXmlStreamWriter::writeStartElement(const QString &namespaceUri, const QStr
#if QT_CORE_REMOVED_SINCE(6, 6)
+#include "qmessageauthenticationcode.h"
+
+QMessageAuthenticationCode::QMessageAuthenticationCode(QCryptographicHash::Algorithm method,
+ const QByteArray &key)
+ : QMessageAuthenticationCode(method, qToByteArrayViewIgnoringNull(key)) {}
+
+void QMessageAuthenticationCode::setKey(const QByteArray &key)
+{
+ setKey(qToByteArrayViewIgnoringNull(key));
+}
+
#include "qstring.h"
qsizetype QString::toUcs4_helper(const ushort *uc, qsizetype length, uint *out)