diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index 9fe3827d86..99c08f1673 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -672,6 +672,13 @@ QByteArray QByteArray::chopped(qsizetype n) const { return sliced(0, size() - n); } #endif +#include "qcborstreamreader.h" + +QCborError QCborStreamReader::lastError() +{ + return std::as_const(*this).lastError(); +} + #include "qdatetime.h" QDateTime::QDateTime(QDate date, QTime time, const QTimeZone &timeZone) diff --git a/src/corelib/serialization/qcborstreamreader.cpp b/src/corelib/serialization/qcborstreamreader.cpp index a3053953ac..47d1f8e014 100644 --- a/src/corelib/serialization/qcborstreamreader.cpp +++ b/src/corelib/serialization/qcborstreamreader.cpp @@ -929,7 +929,7 @@ void QCborStreamReader::reset() \sa isValid() */ -QCborError QCborStreamReader::lastError() +QCborError QCborStreamReader::lastError() const { return d->lastError; } diff --git a/src/corelib/serialization/qcborstreamreader.h b/src/corelib/serialization/qcborstreamreader.h index cc4b9cdf42..5a870d17a3 100644 --- a/src/corelib/serialization/qcborstreamreader.h +++ b/src/corelib/serialization/qcborstreamreader.h @@ -77,7 +77,10 @@ public: void clear(); void reset(); +#if QT_CORE_REMOVED_SINCE(6, 6) QCborError lastError(); +#endif + QCborError lastError() const; qint64 currentOffset() const;