diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index cda3c9612a6..8163ddf216d 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -243,6 +243,7 @@ public: void reset() noexcept; void addData(QByteArrayView bytes) noexcept; + bool addData(QIODevice *dev); void finalize() noexcept; // when not called from the static hash() function, this function needs to be // called with finalizeMutex held (finalize() will do that): @@ -698,6 +699,11 @@ void QCryptographicHashPrivate::addData(QByteArrayView bytes) noexcept \since 5.0 */ bool QCryptographicHash::addData(QIODevice *device) +{ + return d->addData(device); +} + +bool QCryptographicHashPrivate::addData(QIODevice *device) { if (!device->isReadable()) return false; @@ -709,7 +715,7 @@ bool QCryptographicHash::addData(QIODevice *device) qint64 length; while ((length = device->read(buffer, sizeof(buffer))) > 0) - d->addData({buffer, qsizetype(length)}); // length always <= 1024 + addData({buffer, qsizetype(length)}); // length always <= 1024 return device->atEnd(); }