70782 Commits
Author SHA1 Message Date
Marc MutzandQt Cherry-pick Bot 3691ce4f1c qWaitForWidgetWindow: fix excessive genericity
The first argument was the same in all callers; instead of passing
token-by-token-identical lambdas (which have all distinct types), we
can pass the lambda's captured variables instead and inline the
lambdas into the function.

The third argument was always either int or QDeadlineTimer, so
standardize on QDeadlineTimer. A follow-up change will change all
arguments to QDeadlineTimer in the public API, too, so this is
the future-proof and chrono-first-compatible version.

Note 73c52ba268 for the QDeadlineTimer
construction.

Amends 7e4c2ac711 and
3f2a9523a4.

Change-Id: I75f84abbf60cd77ce48c7ab0ee797e5e8a0879de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 943df16c72065cb7f0d13b9f0bceab06abfe3f71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit bc3500f554b88acc2560ead4e70b603b34cb727a)
(cherry picked from commit 5df97e12394ff15840d78b2af581ea4d9fa92b3b)
2025-06-30 10:41:03 +00:00
Matthias RauterandQt Cherry-pick Bot c197210b65 Add security headers to QSetting files
QSettings can be parsed from *ini files that could potentially be
corrupted. Therefore qsettings.cpp and qsettings_mac.cpp are marked
security critical.

qsettings_[win|wasm].cpp are reading the settings from the registry
or from the browser, data sources that are considered trusted. Therefore
these files are marked security significant. The header are also marked
significant.

QUIP: 23
Task-number: QTBUG-135187
Change-Id: I5474c9a748b238734b5cdd50fb9e46f8379924ed
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 934a9345f703640f57b6cf65ba00eddd8487ac65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b96f25335259d5c93a097aa115d24e0fa63ae816)
(cherry picked from commit 5f081106dd6d331eaa0f3d178ae962c4d80f4695)
2025-06-30 10:41:03 +00:00
Matthias RauterandQt Cherry-pick Bot 61b6720f00 Add security header to QLockFile files
In qlockfile.cpp, the contents of the lock file are parsed. While this
parsing is not very advanced, it meets the criteria of QUIP 23. The
other files do not meet any QUIP 23 criteria and are therefore marked
as significant.

QUIP: 23
Task-number: QTBUG-135187
Change-Id: I87b2e00194583b5a2401443f556a38b472747c3a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 81d58eca8e0f8d181f52be0a4c923246a481ad43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ee48b3cefda3f1de744145aa572728e654017031)
(cherry picked from commit 80029fbf0c43b143428eeb836dae014fd8b0e64a)
2025-06-30 10:41:02 +00:00
Andreas EliassonandQt Cherry-pick Bot eef2133f61 Doc: Add \note to QTest::qWait() to consider QTRY_*() macros instead
There seems to be a case that qWait() is a source of eventual pain.
Add \note to encourage the use of the QTRY_*() macros.

Fixes: QTBUG-136538
Change-Id: I52daa8c38a55f8db66d8c941c7cbfff7b7060a5b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit f27588348bccc0e36236500f2257f8006609318f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 121f5105fd5f4b456a1cbedd378d81f3bc6b5e31)
(cherry picked from commit d49b2a7d46e96bedc2773e5e4654f3b51300e8d6)
2025-06-30 07:53:24 +00:00
Magdalena StojekandQt Cherry-pick Bot 6209308310 Mark qtbase/src/xml files as security critical
qdom.cpp and qdomhelpers.cpp are data parsers.

Fixes: QTBUG-135587
Change-Id: I3ea77f46f91d5e05d7d6ce88f416e3062f8096ea
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit a5722944bea247159f1d105c0bf767b9bf19cf21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b0ccd8f8370f2db7f3136c4f47ac55d9024f2894)
(cherry picked from commit c75d68376950cae1f5c97013677e38d2792d0c06)
2025-06-28 07:20:54 +00:00
Marc MutzandQt Cherry-pick Bot 0509f2003c Mark QTextStream as security-critical
This component processes input external to the process, and the
application depends on this component to report errors to detect
failure, so this component is security-critical.

The headers, however, contain only a miniscule amount of
implementation, essentially a few forwarders each and, in the public
header, the QTextStreamManipulator, everything else is out-of-line, so
I've opted to mark both headers as significant, header,
declarations-only. I'll de-inline what makes sense in a follow-up
commit.

Amends 8df072fc8006510c9b743e8ffedaaf51a876883a.

This completes the review of src/corelib/serialization, building on
the following prequel commits:
- 0b9d4c3a857144bad2937f964101c57ae7efec4c (QDataStream)
- 0a7ee06b27c55f10b65b053cabdc893ae8f23893 (QXmlStream{Reader,Writer})
- 046e6c5701da96dd64b613c2bc9cfd245c83b1a5 (QXmlUtils)
- cd4813a3c304a6d9d5d8096d91a8fc297818d624 (QJson and QCbor)

There are no other implementation files in this subdir at the time of
commit.

QUIP: 23
Fixes: QTBUG-135194
Change-Id: If5264e3ad1eca230f48042888b1256ce0a329d8e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 286bb6c32bbf892d31e8aa54b492eade02e0ede3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 57e247a5c77091478f7e10a0db89314740326328)
(cherry picked from commit f25045f013d788bab3b07da715309ea6c9889f07)
2025-06-28 07:20:54 +00:00
Samuel GaistandQt Cherry-pick Bot 6fa28d350c Add clamping to QColorTransferGenericFunction
This ensures that the inputs are within range for the use of these
function.

Depending on the values passed, they can trigger FE_INVALID errors
and thus NaN as return values.

This can happen for example when feeding an invalid ICC profile to
QColorSpace::fromIccProfile.

Credit to OSS-Fuzz

Fixes: QTBUG-137159
Pick-to: 6.5
Change-Id: I435a5768fbb7d3e6cb84d578703e7dde2e39a27e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit f12d046383decf8f468de62732c9cff7d4303cbf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8706176f8f78df9bf5cc560fb80aefa3fda01d98)
(cherry picked from commit f4822eec1855231f189e5348dffc29299f6edf93)
2025-06-28 07:20:54 +00:00
Albert Astals CidandQt Cherry-pick Bot 4eb6340257 Document QString::QString(QStringView sv)
and mention it's since 6.8

Amends 21dfb0ebcc

Change-Id: If4e027678f64468072e379b7aca3f011bfc2ca42
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 513f5a9b8a6855c3c8b6ff8a45fd219c6240bc21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 120ea13b99462fa8fb2f88aa692a9433b91eb3d0)
(cherry picked from commit b879c869a3cd8e35f719e90d731772b25394cb13)
2025-06-28 07:20:54 +00:00
Marc MutzandQt Cherry-pick Bot 7970de44d4 QObject: Extract Method q_choose_{assign,append} from doSetProperty()
We'll apply that doSetFoo() pattern in more places going forward, so
extract the central switch between lvalue and rvalue into a pair of
class helper functions for easier reuse.

Needed a new header for this, so started a qtclasshelper_p.h.

Amends 39cdf431f0.

Change-Id: I864b7faba41a74058e42d2ca96a0cc519751389f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ec24625373c680fd51237b809792e9cd98c792f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit abee7d7c5289b5fe44f3ae6ca17ad28efe41121f)
(cherry picked from commit c9f841473d64164dbc53f8e00a7129eaf7eede7a)
2025-06-28 07:20:54 +00:00
Marc MutzandQt Cherry-pick Bot bc90fbb51e Mark QXmlUtils as security-critical
QXmlUtils are used by QXmlStream and QDom, both of which are (or ought
soon to be) marked as security-critical. The component is clearly a
data-parser, too, with the same input as QXmlStream and QDom, so has to
be security-critical, too.

The header file contains only declarations, so it gets the default
score:significant.

Amends 8df072fc8006510c9b743e8ffedaaf51a876883a.

QUIP: 23
Task-number: QTBUG-135194
Change-Id: I415486dbba0c748e6af561ea4f098ea42c4b1830
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 046e6c5701da96dd64b613c2bc9cfd245c83b1a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d15f3c7815881531ce02478c879af120095fe525)
(cherry picked from commit af2bc3b9f8a104624998249e0966bd3a76d5e4e9)
2025-06-28 05:43:31 +00:00
Mårten NordheimandQt Cherry-pick Bot 75cb94996d Update public suffix list
Version 2025-06-16_09-45-02_UTC.

[ChangeLog][Third-Party Code] Updated the public suffix list to upstream
version 2025-06-16_09-45-02_UTC.

Pick-to: 6.5 5.15
Task-number: QTBUG-137782
Change-Id: I8f4b430d5d01f73e9cc27ce6947d1fc595a97848
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f6a0c8cf94bf1c7f67ec2e7c7f298e0034c8483f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 24b19d896d96740ba4e98a877360c1a7817fe6a5)
(cherry picked from commit c628ee2ab78a083feb1c316917a40b531e82ce6e)
2025-06-27 08:29:09 +00:00
Marc Mutz 144f6cb7fc Mark QJson and QCbor classes as security-critical
These components process input external to the process, and the
application depends on these components to report errors to
detect failure, so these components are security-critical.

The writers are, too, because a valid use of the classes is to
stream-read something, filter or edit a few nodes, and then
stream back, in which case writers see the same input as the
readers, only in reverse, and have to build a valid output.

Where there's doubt whether a header should be considered
critical or not, err on the side of critical. We can always
revisit the decision later when we know what semantics we'll
attach to this marking.

Where a header only contains declarations (and class definitions),
mark as significant with reason "header, declarations only". It is
probably a good idea to avoid any non-trivial inline code in
headers whose .cpp files are security-critical, but moving all
inline code out-of-line is a task for a different patch.

Amends 8df072fc8006510c9b743e8ffedaaf51a876883a.

Manual conflict resolution for 6.8:
- the qjsonparseerror.h header wasn't, yet, split off (was done in
  7be9b5997d84910eeacead251ccdf002f1754147 for 6.9), so dropped the
  marking of that file.

QUIP: 23
Task-number: QTBUG-135194
Change-Id: Ie317c4df652430e6e68954c37d553b760836dff8
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit cd4813a3c304a6d9d5d8096d91a8fc297818d624)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e6414e3ee63baa7444f2ca3dacb20aace42278f2)
(cherry picked from commit 41c7f4852b6c68acef25be2f7fe4ccca4d3c4d47)
2025-06-27 08:29:09 +00:00
Matthias RauterandQt Cherry-pick Bot 61d8dfbb86 Mark qabstractfileengine.cpp as security critical
QAbstractFileEngine::readLine reads from the file info data. The header
is not marked and will default to security significant.

QUIP: 23
Task-number: QTBUG-135187
Change-Id: I0dda64d78a515ed70a32777191af7c681cbfc067
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 961e6edd1378ad496978267f3f4791f340646253)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e58b9ab1b591c224e8ba25dc14148692eae2906a)
(cherry picked from commit adc18a9847831ae9c288126e7e70d327c543c06f)
2025-06-27 08:29:09 +00:00
Matthias RauterandQt Cherry-pick Bot 305f6eb92c Add default security header to remaining mimetype files
QUIP: 23
Task-number: QTBUG-135191
Change-Id: I81ceead665ee0313a492616188c33c6568070b11
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit de9ef7dae8cbaeecf192698edfbab05950f5e7a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 388a331fa92c7b269a60c561a43a4ffd15f03bda)
(cherry picked from commit 45b63d3208cae59f1d023cf2f133602a12270465)
2025-06-27 08:29:09 +00:00
Matthias RauterandQt Cherry-pick Bot cd7f41c08e Mark QFileDevice security significant
qfiledevice.cpp contains some minimal data inspection, see
putCharHelper(). However, this is very simple and not sufficient to make
the file critical.

QUIP: 23
Task-number: QTBUG-135187
Change-Id: I76e608fa42b0bca003fc5d0166fd863583df075a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 2eb3d79a578e13b686875fdce26b397a796d162f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d2d682e91473fd6cbe74fb29f2ae522342485bf5)
(cherry picked from commit 42dc822727a9ef25787c2db6a6a7167f50139754)
2025-06-27 08:29:09 +00:00
Alexei CazacovandQt Cherry-pick Bot 8b9763e549 Doc: Update the benchmarking option descriptions
This commit adds a `perf` option description and mentions that the
`tickcounter` options requires a hardware support.

Fixes: QTBUG-134795
Change-Id: I8462073850b6811508776b40e867e62eb88f78e7
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit 8def878a59982d9a378cf0e3975cda86627f086e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4ed2e7d62e4bd0247f64496313456e11e6235aa2)
(cherry picked from commit 5a2ad3619e9131ea7ce1954e3629b79d5555ca60)
2025-06-27 08:29:09 +00:00
Matthias RauterandQt Cherry-pick Bot edad9d6430 Mark QBuffer security critical
QBuffer operates on external data and data corruption issues have
been found before.

QUIP: 23
Task-number: QTBUG-135187
Change-Id: I6f9ccd58ec423142f3551af3ba4e3c20d3f8392f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4f84818a8c50d54dd72a5024dc2a430dc268bdb3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 80df727a0bfccbe5d558e5cae48dbb3d127161e0)
(cherry picked from commit 474090152acbf889472c635229803124177c6757)
2025-06-27 08:29:09 +00:00
Matthias RauterandQt Cherry-pick Bot b8c01ad971 Mark qmimedatabase.cpp security critical
loadProviders() is parsing data, but it should only be trusted data.

The function isTextFile() apparently reads data from an untrusted file
to identify it as text file. Therefore this file has to be considered
security critical.

QUIP: 23
Task-number: QTBUG-135191
Change-Id: I8884293eff5584038f3388dc0309cfa70eae0c89
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3e88d518eb3ef0c7225e5f551e154ac22a37f578)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7560e3cec6df8128789415a1367622d257750a2b)
(cherry picked from commit da08a1a2d33b12c6132175f67ac3db584e6bb2b1)
2025-06-27 08:29:09 +00:00
Matthias RauterandQt Cherry-pick Bot 86879fdd0e Mark qfilesystementry.cpp security critical
QFileSystemEntry inspects paths, that can be provided by the user
following the code documentation. As such it has to be categorized as
critical.

QUIP: 23
Task-number: QTBUG-135187
Change-Id: I629c39bd1aedf216a067dab9a21eb09ad495b301
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit e00985a8b9e4c5767447f95558f8a5703445045e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b16b7c49dddbc9461c3b047af97c2047e73def53)
(cherry picked from commit 5abb681243947fc5a408b5bf4d448f8148f1e24d)
2025-06-27 08:29:09 +00:00
Marc MutzandQt Cherry-pick Bot 3ce1fa2ad1 QGuiApplication: use the rvalue overload of QObject::setProperty()
Said overload was added in 39cdf431f0,
and its use prevents a forced detach in setProperty() that comes from
the function taking a copy of the QVariant and then calling .data()
on it. The rvalue overload prevents this.

Change-Id: I4f84dae61ab0091d1058c9dee5a02c09b0ac41b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 56709e812c2ebb3d7f942508947ac7b0394d71ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 426fa2868d52b33d2a7316bcdf30def5c767408c)
(cherry picked from commit 21ad7298cd3a28e5b3f8a668211e2ec0bb46245a)
2025-06-27 05:55:00 +00:00
Marc MutzandQt Cherry-pick Bot 20e11997f5 QLockFilePrivate: de-inline all functions
This class is going to be marked as security-critical, and so we don't
want code in the header (because fixes in inline code require
recompiling all users, not just re-linking).

Incidentally, de-inlining getLockFileHandle() removes the need to
include some nasty (qt_windows.h) headers in the header (which means
we need to revert part of 779bdf481c and
go back from NSDMI to ctor-init-list, at least for `fileHandle`).

As a drive-by, make the constructor explicit.

Pick-to: 6.5
Change-Id: I3d376c2c02eb1f7de7a0b923ac4424b1057fdb1c
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 5a567e3ed2a0181d88b2f22b844852a23222a168)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1ac094ebb51b3f9955c671327f6a77413fe35db9)
(cherry picked from commit 78cd15b12375025d105fa942c8bd52ed953c1ac8)
2025-06-27 05:54:40 +00:00
Marc MutzandQt Cherry-pick Bot 042e63e2e2 gui/removed_api.cpp: add missing comment block in 6.7 section
Amends 6c72080f26.

Change-Id: I8af92558be9ebef70fe99d4d6e9dcfdc14ef90ba
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2edf8a4cafcb95a66505ff8bdd5bcfed203b4463)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a5c4828da0ead6955d21f5ca681748be2e3fa6ed)
(cherry picked from commit 057075fc0f4089a98e9795ce52945fbff6fe8a3b)
2025-06-27 05:54:33 +00:00
Marc MutzandQt Cherry-pick Bot 99768c783d QPainter: make qt_show_painter_debug_output constexpr
Nothing is modifying the variable, so make it constexpr (was: mutable)
and change all the if's into if-constexpr's.

While the compiler doesn't care unless QT_DEBUG_DRAW is defined, this
will prevent the next human reader from going on the same fruitless
hunt for a setter as yours truly.

Amends the start of the public history.

Pick-to: 6.5
Change-Id: Ib2f8c0fcb2938ca3548b9452c4d8eb482e6ffbe5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 25f47a07833d1e3aaab89c017e931f5c8f23f147)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 258a6196135a0a85fcea9c67fd625f90cd208108)
(cherry picked from commit abca897399f9f2e96470bb394cd1eb48dfbf0da2)
2025-06-27 05:54:29 +00:00
Marc MutzandQt Cherry-pick Bot 53d4a0b3f9 QQuaternion: make a mutable function-static int[] constexpr
The array, despite being declared mutable, is never modified (and
doing so would be a data race if threads concurrently call
QQuaternion::fromRotationMatrix(), because it was declared static).

Fix by making it constexpr instead. It need not be static, as the
compiler will just optimize it away, anyway.

Amends ba640a75a5.

Pick-to: 6.5
Change-Id: I0a37f7718b1e79f34d8dd56dc56d951cb8a1d44c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit bc6f4c5db46e1d8263e32e02f2ca6e49d6b4082d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2100474c191c070a3ca656d071bf9a46e8e2153b)
(cherry picked from commit f7b04a28b2dd709ca6102ad427ffd9142286fcb2)
2025-06-27 05:54:24 +00:00
Marc MutzandQt Cherry-pick Bot d8401300b7 Build system: support C++23 for C++2b
Adjust user-visible labels and comments from "C++2b" to "C++23" and
alias the machine-readable cmake and qmake features c++/cxx2b to
c++/cxx23.

Pick-to: 6.5
Change-Id: Iea721ea2cb72b9e1d284d84569169fffe21afc10
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 54797309dda3a3861d279120ee05c9df458188c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a44ad3f9a11cc8109363adf1aeac3a681a0baa58)
(cherry picked from commit 7abb9b798b78dcc3ff54fc754f424c490081a4d5)
2025-06-25 12:22:50 +00:00
Mårten NordheimandQt Cherry-pick Bot 3ec015cdc9 QDateTime::currentDateTime: fix time zone offset for repeated hours
Because we were consulting GetLocalTime we didn't get disambiguated
times for repeated hours. Drop that code-path and simple rely on
GetSystemTime instead.

Done-with: Mate Barany <mate.barany@qt.io>
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Fixes: QTBUG-133656
Change-Id: I3f1f09edfd9fb3135ccc12bf98e06254327e76fe
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 1bcfbfa3bc75d2a91752497e59dd6c1b7a287e2b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e3fcc5403cead363d855e7b85315aae33ef19944)
(cherry picked from commit c72fc4695e086fafcad1a46dd71d69d8f8bd5a1c)
2025-06-25 09:13:46 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 50a164e15a Android-Keyboard: Remove redundant code in isKeyboardHidden()
The m_keyboardIsVisible variable already reflects the current
keyboard visibility state. This commit simplifies the
isKeyboardHidden() method by using it directly, removing
unnecessary logic.

Task-number: QTBUG-98984
Change-Id: I6bba90e6fbfb1191415e7ee812517ca15ac1c937
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit acbcf992ee5b9978f22a76e03384b4d9ea34a76f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1e844fbf239669283d70e4d0ecf7678c381abfb4)
(cherry picked from commit ebf3269cfca7d132ca6cd91cb49cc25db93726f3)
2025-06-25 01:37:30 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot cfdd46a90c Android-Keyboard: Improve keyboard visibility tracking
Starting with API level 30, keyboard visibility can be easly checked
using [0]WindowInsets.isVisible(int). This eliminates the need for
relying on callbacks to detect when the keyboard opens or closes.

This commit updates the logic to track keyboard visibility by
observing changes via OnApplyWindowInsetsListener and checking for
visibility changes using the new API.  From now on, for API 30 and
above, the internal keyboard visibility property should no longer be
updated manually.

[0] https://developer.android.com/reference/android/view/WindowInsets#isVisible(int)

Task-number: QTBUG-98984
Change-Id: I40f3ccc4e652f1ae0c6c0ebd154d690d1a9d7ca8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 33cf82c13d6e3e9fc6d15b725f7ebe15be3d4631)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3f72e55bca1a368d6432c516b5048b4f6f8fc1b9)
(cherry picked from commit b62e1c47949b5893fcbbdd40c6576823f646f06c)
2025-06-25 01:37:26 +00:00
Liang QiandQt Cherry-pick Bot 6c5543b94f Fix the build QtWayland on macOS
This follows db7b958fb2d82a85ef45eba852cf411ebde852bf and
427e5d61b7 .

Change-Id: I40bf947d69fc134473bccfc4fc346050a180ae2e
Reviewed-by: Inho Lee <inho.lee@qt.io>
(cherry picked from commit 41796d1975a67757742e3d6f953d6251c067957b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 61b156c000495dbf5f2736de04294e3e6b494c76)
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit f4e1fb49796ceac06e4ca58048950d4eb037f435)
2025-06-25 00:41:21 +00:00
Bartlomiej MoskalandQt Cherry-pick Bot 0da0ae1eb3 Android-Keyboard: Avoid manual keyboard visibility updates on API 30+
Keyboard visibility is now tracked via OnApplyWindowInsetsListener,
which provides reliable visibility state changes starting from API
level 30. In this setup, manually updating the visibility property
is unnecessary and may lead to inconsistencies.

Task-number: QTBUG-98984
Change-Id: Ife80898e20d4038efeae3438fb89b593bdaa056a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 21616e1447fb8583d81cb46b34ad25de4bd29d18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit af519f5d8a93a13b267b0561dac038021d1fc1d5)
(cherry picked from commit 17228c1edbf22202eb7b0a665fb3430102ffeb3e)
2025-06-24 19:38:50 +00:00
Thiago MacieiraandQt Cherry-pick Bot f756b02bd6 QByteArray: call the out-of-line implementation of assign() for char*
We do the same for QString, via QAnyStringView.

Amends commit 18a2c62c07.

Change-Id: I9b112758483774d65000fffdac26d775ffba175d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 231321a91d76920d9d3d772f994d12611eb0ba1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 92662397abf14cc26bc4f65e2b408f630f4998d4)
(cherry picked from commit 7aa425dde0530def4b5ba967c15702f3bbff42b1)
2025-06-24 19:38:50 +00:00
Marc MutzandQt Cherry-pick Bot dcc89f30fc [docs] QObject: mention the return value change in 6.7
We should document it when the signature of a function changes,
incl. its return type.

Add the usual sentence.

Amends e752c77b35.

Change-Id: I694e20dec95572a128501ffc8c6e759781b4ce83
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 36effb230418427b48c9ac8d144eb102018a5291)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit dd8af5036ee41ce74e4bb8bcddf88b9e798275a6)
(cherry picked from commit d0115e99096b8dc49f7be3ca5397817deae828e6)
2025-06-24 19:38:50 +00:00
Liang QiandQt Cherry-pick Bot d7293a5aef tests: fix a typo in tst_QWindow::touchInterruptedByPopup()
Change-Id: I6d846c7bfdaa6034994057725dd65c7ab75c9273
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 419eaf13eafccc1457c0bc516f08e6ff68b37e55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4576d0a5bf7196cef95266b8e5e3641ebb5d1b4c)
(cherry picked from commit f8e41947dd800d91eb3c9ae2c06d7d4de41a7340)
2025-06-24 19:38:50 +00:00
Alexandru CroitorandQt Cherry-pick Bot dac30f073b CMake: Pass qt-configured linker flag when building examples
If Qt is configured to build with lld, our examples should use it
as well. But we want to do it without forcing the same linker on user
projects.

Normally if we wanted to do it for all user projects, we would
propagate the linker flag via the Platform target, but we can't.

In case of in-tree examples, we propagate the flags using
add_link_options which is directory-scoped, and will apply to all
targets created under the examples directory.

For out-of-tree examples, we pass the flags via the
equivalent CMAKE_<type>_LINKER_FLAGS_INIT variable to the external
project.

Fixes: QTBUG-137882
Change-Id: Iade8ee2f37032b4a7801e5a628c9cc177d478129
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Moss Heim <moss.heim@qt.io>
(cherry picked from commit 2293fe9de819ebc6b31eef334dd94112d71fe663)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ecefe63b8d5608ba648c6e355bd15a0f1eb368c5)
(cherry picked from commit 74a05a5027249f86b5c094127d027237e7532530)
2025-06-24 19:38:50 +00:00
Mårten NordheimandQt Cherry-pick Bot 29497f5222 Bump double-conversion version
They released a new version of double-conversion with no source changes.
See https://github.com/google/double-conversion/releases/tag/v3.3.1
and https://github.com/google/double-conversion/compare/v3.3.0...v3.3.1

[ChangeLog][Third-Party Code] Updated double-conversion to v3.3.1.

Pick-to: 6.5
Task-number: QTBUG-137782
Change-Id: I783890e0d6156c4898b3b644bbccdf018d33b74d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 46ad6121fde2fd72f3664635867103cffe6fa3b7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 54f6da2d4c309bb3e5665c8d61d5e020b3ff87d6)
(cherry picked from commit 921a838dcd7b54a830be60feb7e5d02176bd46cb)
2025-06-24 13:32:22 +00:00
Bartlomiej Moskal eafbac7e26 Android-Keyboard: Use new show() / hide() methods for keyboard control
Starting with API level 30, Android introduced new
[0]WindowInsetsController.show(int) and [1]hide(int) methods for
controlling the keyboard visibility. This commit updates the code to use
these methods on devices running API 30 and above.

[0]https://developer.android.com/reference/android/view/WindowInsetsController#show(int)
[1]https://developer.android.com/reference/android/view/WindowInsetsController#hide(int)

Task-number: QTBUG-98984
Change-Id: Icfcad3430cd269353572f66f72114238045f7756
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3823d99a688813d2692eb0d4b99939a65bb6ee6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 75e575e18f0fbfa8571d9044beea3cf3939881ab)
(cherry picked from commit 2aae64c041e81f7c982b3d3a72fc78ea7ce00a5a)
2025-06-24 15:23:29 +02:00
Marc Mutz 867da8c0e4 Check that QEventLoop can establish an event loop in a std::thread
... and QObjects can have thread affinity to such threads.

This was always understood to be the case, but a recent internal
discussion raised doubt whether it would actually work. Since we
didn't find an actual test for this, add one now.

Manual conflict resolution for 6.8:
- Worked around missing chrono_literal import, added to the test by
  70c47da843a0570784ef1a14d98ccc382425bf1f (which wasn't picked
  back).

Pick-to: 6.5
Change-Id: I73556d54cd0b9c079d78b864ca94b66721ae3599
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 30a94c63eef1b6f629a048ea8f4cc91e211c4587)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 0780802877241ff48b6593f347d3267d3ec46f62)
(cherry picked from commit 82bff7e8e316e4124f1b8cc8156659d4d50d7c6b)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-06-23 08:21:36 +00:00
Konsta AlajärviandQt Cherry-pick Bot c16c436aa4 CRA: Android: Mark QtLoader.java as security critical
Mark QtLoader as critical with "execute-external-code" due to
library loading in:
-loadQtLibraries()
-loadLibraryHelper()
-loadMainLibrary()
-loadLibraries()
QtLoader also parses library paths in:
-parseNativeLibrariesDir()

Fixes: QTBUG-136726
Task-number: QTBUG-135178
Change-Id: I58a11fd44ea8159b8399ac7a27fd50eaab8185a6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit fd52f868accab86f800d632014300aaa4920663a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8447cd262f996b189fd30650aa1ada0c3609d66c)
(cherry picked from commit 93f62bcad302d8a87338d482f315f6b28e71dc6d)
2025-06-23 01:47:31 +00:00
Konsta AlajärviandQt Cherry-pick Bot 5ca79d7019 CRA: Android: Mark qtandroidplatformfiledialoghelper.cpp as security critical
Mark qtandroidplatformfiledialoghelper.cpp as security critical with
"data-parsing" as a reason.

Data parsing in nameFilterExtensions() using QRegularExpression.

Fixes: QTBUG-136820
Task-number: QTBUG-135178
Change-Id: I378698327a36496317782d6dc0acd092c19de7ca
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0a4c11633ba963d8f3a0d64009af0617a3ab3151)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3df9be0f96aad05a339ae3d0185a0a1ef032f509)
(cherry picked from commit 1e566146abc7171404a2e4a196598196b978cfb1)
2025-06-23 01:47:30 +00:00
Lars SchmertmannandAssam Boudjelthia 17ace9a396 Android: Bump androix dependency to 1.16.0
The Android target API level was bumped to 35 in
997a1fae98d35cd0d4d16f37ab68afe2729ff551 so we can
bumb the version of the androidx dependency too.

Change-Id: I30d561cc0b74645c939e7d3dd595926b6013caf9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 36b5854af53650132738cd950a220b45669ae5bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5ded95d6590e79f4a665194a9ed1224fab2ecb58)
(cherry picked from commit 90c6413d24ba0f152f94582fcba7656c97822d92)
2025-06-22 22:31:28 +00:00
Tor Arne VestbøandQt Cherry-pick Bot 38e1a623a0 Propagate minimum visionOS version to qmake
Change-Id: I3dad6ba44a72399c95adbb78d186f78542a6db84
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
(cherry picked from commit 276dc9db430038ef10ae45482d396ccabf4378a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 46069c3bfe3f24e64f91f157cb3ef22b48173f90)
(cherry picked from commit ba244648f0b80cc253a1678940247300addbaae3)
2025-06-21 02:20:04 +00:00
Matthias RauterandQt Cherry-pick Bot 726efac1b5 Mark QFileSelector as security critical
QFileSelector inspects the paths to find the corresponding files.
Further there is the risk of exposing files of the resource system or
choosing files outside of the resource system by accident.

QUIP: 23
Task-number: QTBUG-135187
Change-Id: I6e0783da8bc08102df7cc108389db33940ffa4a6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit cca658d4821b6d7378df13c29d1dab53c44359ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e96fa69938735c271225e866963693c1edb3b794)
(cherry picked from commit a78f47814e67f7c6106dadef000cf132d1b37c25)
2025-06-21 02:19:58 +00:00
Laszlo AgocsandQt Cherry-pick Bot 300bf4bccf rhi: Add missing docs for srb create function
Change-Id: I573d8b95dae7db39f968a8b55aa2adcb14a73fdc
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 3183b7b79126551fe8528a6fbcf6e90830ee695a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b70a755fa2807e2b6a808ded0dfde04ccd57394f)
(cherry picked from commit 8393c41451d508030b6ef62fb536e41a0939cfcc)
2025-06-21 02:19:58 +00:00
Miika PernuandQt Cherry-pick Bot 8546d1c391 QAbstractItemView: fix autoscroll immediately stopping
Adjust the draggedPosition calculation to changes in
QAbstractItemViewPrivate::offset(). The draggedPosition was previously
first calculated by adding mouse pos and offset() value, and mouse pos
was later extracted by subtracting the offset() from draggedPosition.

However, the offset() value no longer remains a constant between the
addition and subtraction, which makes it impossible to get the old
mouse position.

Store the offset and mouse position separately to make the
calculations deterministic across events.

Fixes: QTBUG-130978
Pick-to: 6.5
Change-Id: I5c601ff7ca40c9d8fb7ad949ff15520d199f5c1f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 882a4df4fdd2a5952a605ca783142f46d9a92d5b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e7dda25bdecd552994a2d23b6611e83c7307d9ef)
(cherry picked from commit fefe839d0e09ced5a6aecec8f931d4ba4fb617c8)
2025-06-21 02:19:58 +00:00
Tor Arne VestbøandQt Cherry-pick Bot 562ba31de4 cmake: Propagate minimum visionOS version to CMAKE_OSX_DEPLOYMENT_TARGET
We were missing the plumbing from QT_SUPPORTED_MIN_VISIONOS_VERSION to
CMAKE_OSX_DEPLOYMENT_TARGET which resulted in picking up the SDK version
as the CMAKE_OSX_DEPLOYMENT_TARGET, which is not great for testing the
new visionOS 26 SDK against visionOS 2.5 simulator.

Change-Id: Ic0bb3f4307dced463f51f1781e68c21bd8aa2e96
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
(cherry picked from commit 3c76494db1cd2bc7f2c5f9dd5345a43c5e6af507)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 169cae792db5ecc153d0d9c8fd21ebe62afec3fa)
(cherry picked from commit 2b28ba17108a003843d5e57b922a3b80ade66804)
2025-06-21 02:19:57 +00:00
Michael WeghornandQt Cherry-pick Bot 03c89869b4 a11y: Move qt_accStripAmp helper to private QtGui header
The qt_accStripAmp helper function takes a string that
may contain an accelerator/mnemonic and escaped ampersand
characters and returns a "plain text" version of this that
is suitable for an accessible name of the widget/control
containing that text.

Move the helper function to a new private header
(and source file) in QtGui in order to be able to reuse
this in Qt Quick in an upcoming qtdeclarative commit.

Note for Qt <= 6.9 cherry-picks:
Leave a copy of the static helper function qt_accAmpIndex
in src/widgets/accessible/qaccessiblewidget.cpp
because it's still needed for qt_accHotKey in those branches.
(It is only used by qt_accStripAmp in Qt >= 6.10 since
d612dcd249850a0815cc0396b92d57179a4493f8 and was moved to
the new source file together with qt_accStripAmp in the
dev branch commit.)

Task-number: QTBUG-134208
Pick-to: 6.5
Change-Id: I4dfac2d179baf36101066962b6a5f542b3a6fc03
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fb93950e7ebf7d4bb336e7c9f7a60a6bafdb60ed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 565ce5df254c3d6f6c37b7da2a69c233854def86)
(cherry picked from commit dd98e46a10862a3884da8ee451c6ed92c9d66f49)
2025-06-21 02:19:57 +00:00
Marc MutzandQt Cherry-pick Bot 8720a9dde0 QStringListModel: de-pessimize guard clauses in moveRows()
The guard clauses validating the moveRows() function arguments were in
some random order this author doesn't understand.

Order them by increasing complexity (cheapest first):
- first, check the ints
  - check each one in turn, grouping the LHS
- then, check the relations between the ints that must hold
- then, check the QModelIndexes for invalidity (list models don't have
  hierarchy, so both parents must be roots)
- at this point, we know both arguments have to be equivalent to a
  default-constructed QModelIndex(), so we don't have to pass them to
  rowCount(), we can use the default argument instead
- then, after caching the result of the rowCount() virtual call, check
  the ints w.r.t. their upper bounds

This means we fail and (because of the cached rowCount()) succeed
faster.

This is in preparation for an Extract Method of these clauses for
reuse in other list models.

Amends da9aeb3e4e.

Pick-to: 6.5
Change-Id: I22f7c8e61cfa806ae88b593730b1c1979cf62c46
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit a59baf845c13bda81033b9a84fcc982e330dd8c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4d152547d70a0c4f6e71885f63c41affce88605e)
(cherry picked from commit 456fe216d538e50d42506ceb9b6e954db3676a9f)
2025-06-20 11:50:30 +00:00
Eirik AavitslandandQt Cherry-pick Bot d7a233b334 Update bundled libjpeg-turbo to version 3.1.1
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 3.1.1

Pick-to: 6.5 5.15
Change-Id: Ic18ec6dd91dfaa58318fa56785e6314340e39e0a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 4ac4c9db14b200b937bd12dbe854573e64e91df7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 46cc56d828c8d1c1c787714ea344784c1939d237)
(cherry picked from commit 20866f4d68085faa0dbe50ac46152652edc774c3)
2025-06-20 11:50:30 +00:00
Axel SpoerlandQt Cherry-pick Bot 019f055013 QXcbWindow: Eliminate data race between hide() and deferred activation
When hide() was called on a window that is still hidden with its
activation being deferred, the hide() call could have been overridden
when the deferred activation kicked in.
In tst_QGraphicsScene::tabFocus_sceneWithFocusWidgets() this sometimes
causes the wrong widget to be focused.

Lock the mutex for m_mapped at the beginning of hide().
Cancel deferred activations when setting m_mapped to false.

Can't be autotested.
Flakiness of tst_QGraphicsScene::tabFocus_sceneWithFocusWidgets() will
disappear.

Fixes: QTBUG-123063
Pick-to: 6.5
Change-Id: I80c3419f09a5fd98c2684c672c631c6a63d4ec48
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3080304ce4af900e4732ded7c150509184f588ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3db3930174897716d0749a3c72ff02c6ea269eb5)
(cherry picked from commit b818d99b78b6d08075ff45eebf7e046bf016e603)
2025-06-20 11:50:30 +00:00
Dheerendra PurohitandQt Cherry-pick Bot 79e4ac4935 Doc: Fix typo in QGraphicsSimpleTextItem class description
Removed the incorrect word "path" from the description, which
mistakenly referred to the item as a "text path item".
QGraphicsSimpleTextItem provides a simple text item, not a path item.

Fixes: QTBUG-87180
Change-Id: I977d01c667c65f5d35dc3bc60d5362e681e9b5f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit df69d25f5a94ac7a6b42f0e91dcb3a49ec7841fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b744d3945308322840c17613d6106b9353590c17)
(cherry picked from commit b9d406abfcfbf90f411d7aab6c234b5bbb0ecc7b)
2025-06-20 11:50:30 +00:00