[qt/qt/qt5compat]: Summary of bulk changes made

KDE Git Services - Bulk Change <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git repository change summary for qt/qt/qt5compat
Pushed by mirror-service into branch '6.12'.
Changed from d27adf6b79d598e6120c1c79f0e6e1c4210d5698 to c36827dad7a1dd1f79ae3d2811d2d52267039ec0
Acknowledgement was received that this change introduces only existing code that has been pushed to another public open source repository.

This change contains the following new commits:

Git commit 86ef784660eaa1f99675b988ad4d159018a71fee by Qt Cherry-pick Bot (on behalf of Ivan Solovev) on 17/08/2026 at 08:51..
Fix memleak in QBinaryJson::to{Raw,Binary}Data()

In Qt 5, the code belonged to QJsonDocument, and the memory was managed
by QJsonDocumentPrivate, which correctly cleaned it up in the d-tor.

However, when moved to Qt5Compat in Qt 6, the code simply became a
namespace with a bunch of free functions, so the underlying d-ptr is
gone. As a result, QBinaryJson::toRawData() simply hands a pointer to
the user, and it's now their responsibility to free the memory.
In case of QBinaryJson::toBinaryData(), the pointer is used to construct
a QByteArray (which did another copy), and was never freed afterwards.
That's a memory leak on the Qt side.

This patch fixes the memleak in QBinaryJson::toBinaryData(), and also
documents that the user has to free the memory obtained from
QBinaryJson::toRawData(). It also adds a qWarning() to the toRawData()
function, to steer the users towards toBinaryData() usage.
A follow-up patch will deprecate toRawData() immediately in 6.12.

Since toRawData() was used in toBinaryData() implementation, the
patch introduces a new static toRawDataHelper() that actually contains
all the logic.

The tests are also fixed to avoid memory leaks.

Amends the introduction of the code in Qt5Compat repo (Qt 6.0).

Fixes: QTBUG-149054
Pick-to: 6.11 6.8 6.5
Change-Id: If376d19f9788c753e29fd237abf7849307491504
Reviewed-by: Thiago Macieira <[email protected]>
(cherry picked from commit 82604842849a66554baac66ef4f4a4469f62d848)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
https://invent.kde.org/qt/qt/qt5compat/-/commit/86ef784660eaa1f99675b988ad4d159018a71fee

Git commit 29317277b367ad6539b1f4ffc224c6d6d1096564 by Qt Cherry-pick Bot (on behalf of Ivan Solovev) on 17/08/2026 at 08:52..
Deprecate QBinaryJson::toRawData() immediately in 6.12

This method is not safe, with no clear path to make it behave like in
Qt 5 again, see below. Deprecate it in favor of the memory-safe
alternative.

[ChangeLog][Deprecation Notice][QBinaryJson] Deprecated the toRawData()
method, because the returned memory has to be manually released by the
user, in stark contrast to Qt 5, where it remained owned by the object.
A backward-compatible alternative is to use toBinaryData() instead.

Task-number: QTBUG-149054
Change-Id: I59f9e38bb6b4031320160ab2617802e8cc59b89e
Reviewed-by: Marc Mutz <[email protected]>
Reviewed-by: Thiago Macieira <[email protected]>
(cherry picked from commit f90f59e7447ff56fe816ac67370603a20de6b6f2)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
https://invent.kde.org/qt/qt/qt5compat/-/commit/29317277b367ad6539b1f4ffc224c6d6d1096564

Git commit c36827dad7a1dd1f79ae3d2811d2d52267039ec0 by Qt Cherry-pick Bot (on behalf of Marc Mutz) on 17/08/2026 at 09:13..
Enable strict mode 6.12 in qt5compat

No code changes necessary, the "not yet in strict mode" set already in
.cmake.conf was exactly the diff between strict mode 6.11 and 6.12.

Change-Id: I27433f473e4ab9988e7cf8dfec621fb69e5f450d
Reviewed-by: Ivan Solovev <[email protected]>
(cherry picked from commit 5bf03da5cee39efe5b583662eb17bf5d02524cb7)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
https://invent.kde.org/qt/qt/qt5compat/-/commit/c36827dad7a1dd1f79ae3d2811d2d52267039ec0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.