summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/compat/removed_api.cpp2
-rw-r--r--src/corelib/io/qbuffer.cpp5
-rw-r--r--src/corelib/io/qbuffer.h9
3 files changed, 11 insertions, 5 deletions
diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp
index aa1a496f0f..42f2ef97ea 100644
--- a/src/corelib/compat/removed_api.cpp
+++ b/src/corelib/compat/removed_api.cpp
@@ -285,6 +285,8 @@ QT_WARNING_POP
#if QT_CORE_REMOVED_SINCE(6, 5)
+#include "qbuffer.h" // inline removed API
+
#include "qenvironmentvariables.h"
bool qputenv(const char *varName, const QByteArray &value)
diff --git a/src/corelib/io/qbuffer.cpp b/src/corelib/io/qbuffer.cpp
index c244dacab3..0dcc02459d 100644
--- a/src/corelib/io/qbuffer.cpp
+++ b/src/corelib/io/qbuffer.cpp
@@ -267,12 +267,15 @@ void QBuffer::setData(const QByteArray &data)
}
/*!
- \fn void QBuffer::setData(const char *data, int size)
+ \fn void QBuffer::setData(const char *data, qsizetype size)
\overload
Sets the contents of the internal buffer to be the first \a size
bytes of \a data.
+
+ \note In Qt versions prior to 6.5, this function took the length as
+ an \c{int} parameter, potentially truncating sizes.
*/
/*!
diff --git a/src/corelib/io/qbuffer.h b/src/corelib/io/qbuffer.h
index 96144b63a8..a7c6bde562 100644
--- a/src/corelib/io/qbuffer.h
+++ b/src/corelib/io/qbuffer.h
@@ -33,7 +33,11 @@ public:
void setBuffer(QByteArray *a);
void setData(const QByteArray &data);
- inline void setData(const char *data, int len);
+#if QT_CORE_REMOVED_SINCE(6, 5) && QT_POINTER_SIZE != 4
+ void setData(const char *data, int len) { setData(data, qsizetype(len)); }
+#endif
+ void setData(const char *data, qsizetype len)
+ { setData(QByteArray(data, len)); }
const QByteArray &data() const;
bool open(OpenMode openMode) override;
@@ -60,9 +64,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_emitSignals())
};
-inline void QBuffer::setData(const char *adata, int alen)
-{ setData(QByteArray(adata, alen)); }
-
QT_END_NAMESPACE
#endif // QBUFFER_H