71231 Commits

Author SHA1 Message Date
Alexandru Croitor
5fd8af81ad CMake: Handle DIRECTORIES in SBOM custom file sets
Previously one could only pass an explicit list of FILES to
_qt_internal_sbom_add_files. Add a new DIRECTORIES option, which will
glob the given directory paths, and include the found files in the
SBOM.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Ia27afa93460d9f2e4462a49e30e4d6338300e8f7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9db03c9dca1b7e403458fd9f43adb17a0ac8e55c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 15:57:45 +00:00
Alexandru Croitor
8a1dcd2bb9 CMake: Extract Qt-specific license concluded handling
Extract the handling of the license concluded expression for Qt
entities into the Qt specific handling file.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Ib6f9a64f66dae0c971c43e8fffbc54362487b271
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit ba93956be1179e4b4afaaecdf53b918b724cf500)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 15:57:44 +00:00
Alexandru Croitor
1f8a8da7c2 CMake: Unqtify THIRD_PARTY_SOURCES handling for SBOM attributions
Nested SBOM attribution targets were always created with the
QT_THIRD_PARTY_SOURCES type even in user projects.
Set an appropriate type depending on whether we are handling a qt
entity type or not.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Id8144d1b8093de78f2987a611a6de8e6d4777084
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0d9106bf7670b08c4bae11c3986b9cf3e0818b52)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 15:57:43 +00:00
Alexandru Croitor
68856adf1d CMake: Add a new SBOM entity type: THIRD_PARTY_SOURCES
It mirrors the Qt-specific QT_THIRD_PARTY_SOURCES one, to be used when
creating an SBOM attribution target that references a 3rd party
library's sources, as opposed to a complete 3rd party library.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I8f7f9f7386ffdc18dd8ae6ee32e39019639f5303
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 8b06d37fb08d22e9f81ae2653aeafc105fc5bb61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 15:57:41 +00:00
Alexandru Croitor
db7e6d6fed CMake: Remove leftover code after refactoring
The assignment is not used anywhere.

Amends f1ac316191c010b1389f6f3549c9f0b4424b9936

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I3e6326b2782ab42dee8219353953ee6f4378ccfb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 17c482d818facd8f7d821aac87876ae079ff79d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 15:57:40 +00:00
Alexandru Croitor
8d8cf0bbfe CMake: Re-order SBOM embedded qt_attribution.json fields
Put the attribution file path and entry first, followed by the id,
and the rest of the fields.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I478a48980e6207646189d6b80ec57dbc9efb4902
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a5c7eb97ceb19ac90f8117240ad04cc717803555)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 15:57:38 +00:00
Alexandru Croitor
c276fa45dc CMake: Allow creating nested SBOM attribution targets for all entities
Allow creating nested SBOM attribution targets also for non-Qt targets
in user projects. This will allow using qt_attribution.json files in
user projects.

Rename PARENT_TARGET to ATTRIBUTION_PARENT_TARGET to make it clear
what the parent target is for.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Ia08ee934a9dc03827fcc26d0fc90e072499e8a21
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a2ddd4fbd88353b21617e539266196b592683a3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 15:57:37 +00:00
Alexandru Croitor
21c5970da4 CMake: Allow including specific attribution ids in SBOMs
Previously one could attach all attributions from a
qt_attribution.json file to a target, or a specific entry based on a
given numeric index.

This is not always practical, as the index of an entry can change, and
including all entries might be too much.

Allow specifying a list of attribution ids to include in the SBOM.
This will parse all the attribution entries and only include those
that match the given ids.

If a list of ids is provided, and any of them is not found, an error
will be shown.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I2ca442fe0cd6d18773861f90f32ab7380aaeacdd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 52045e51e7e95f31a37127215c53e430fa77c8d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 15:57:35 +00:00
Alexandru Croitor
1dc3a9cac2 CMake: Sanitize nested SBOM attribution target names
To avoid issues with characters like "/" which might come from
attribution ids.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I65bec3b301f7fe1008cfd06aba3e1fbbb93f38c3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4a0b5661fdd1f1120018efb5f08bfbc1ed16cc13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 15:57:34 +00:00
Alexandru Croitor
59745fc798 CMake: Remove type restriction on attribution file extra SBOM info
So it can be used in other non-Qt projects.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I11d81d2c6819906fffbffe81f4db1b7af28cb99b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 6cd7f0c09b71ea49bdd3dd925b9a85dfe6cc943e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 15:57:32 +00:00
Alexandru Croitor
bccb4c8328 CMake: Remove type restriction on attribution download location
So it can be read / used in other non-Qt projects. We don't have such
a restriction on other keys read from the qt attribution files.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I225d83b26c68323761a8b13b3e6442057b5f7c7f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 422f5d859f3056433e6ee33ea389f2ecff1543d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 15:57:30 +00:00
Marc Mutz
0e7f52c872 tst_QStringTokenizer: check when the lazy range may be empty
Only when using SkipEmptyParts...

Pick-to: 6.8 6.5
Change-Id: I7dd67b801fa0deaab14eb7bb7e9905f60891ec48
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit cef7892135b4fccc85512629e8bee76ddfbc3240)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 15:11:35 +00:00
Alexei Cazacov
18dd4f9479 Doc: Move 'Classes for string data' topic to Qt Core and add it to TOC
Fixes: QTBUG-133954
Change-Id: If51abefc39eaae29f7d533af2974017793ef9358
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit baeed8e1e75db988aa53aa56353aa9c1f821b542)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 15:11:33 +00:00
Konsta Alajärvi
31e6f4a2ca Unblacklist tst_qrhi threeDimTexture()
Unblacklist tst_qrhi threeDimTexture() test function, by skipping
it with Android OpenGLES.

Fixes: QTQAINFRA-6333
Pick-to: 6.8
Change-Id: I795dd73fc7b35ab065f206030458088d829be9c8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit d8f75f34c94aadff98722ec236a43115dfae8956)
2025-02-27 09:27:51 +00:00
Sze Howe Koh
206a8fec2c [Doc] QObject: Sync warnings of isSignalConnected() and receivers()
Extends e75c1a00e31723f1c9deb8427725fa0a58fae2a8 because calling
receivers() in disconnectNotify() can deadlock too.

As a drive-by, some statements are generalized further:
* "expensive initialization" -> "expensive operations" since that is
  what the relevant snippets actually show.
* The potential race condition is not limited to "after this function
  returns and before the signal gets emitted"

Task-number: QTBUG-106025
Change-Id: Iff014706b9e8d8147e3bbb9ac51542197eec5db3
Pick-to: 6.8 6.5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f5b874fd2d393b783dad85c95a158383420e481a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 06:57:25 +00:00
Thiago Macieira
54ef8bf929 Use QThread::isMainThread() in a few places
It's thread-safe, whereas trying to load qApp isn't in Qt 6.x (will be
in 7.0) and dereferencing it to call QObject::thread() will probably
never be. It's also faster, being a single function call instead of two
or three.

This is not an exhaustive search, it's just a few places I found while
searching for QThread::instance().

Pick-to: 6.8
Change-Id: I3b4e1c75bb3966e2cd2dfffd79bfc8a40f6cf40b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 6fb39ca2cbb111469ce09c8342997eb5375e3239)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 06:57:25 +00:00
Ahmad Samir
d47af17a0d QDir: improve mkdir/mkpath API docs
Pick-to: 6.8 6.5
Task-number: QTBUG-132633
Change-Id: Iafe4a20bacbbf55d19377e8cd04f940d4f2a66f6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 23981aae0e059d876d441bfffae9d9d0fd671bde)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-27 01:04:10 +00:00
Rami Potinkara
d2f48abeb5 Android: update Android SDK to version 35.0.1
This patch updates the macro AndroidBuildToolsVer to
version 35.0.1.

The version 35.0.1 is used elsewhere, see
b49421a984ac2b203b7995f3787b67184c990089

Amends: 9b475eadfcf04194a094454f65295c3a456000a4

Task-number: QTBUG-129462
Pick-to: 6.8 6.5
Change-Id: Ic15e12c563fa3d16315daa13b6f6b6ef19535954
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit 7a7093eb87ebc986555b855611018066e2c39bed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-26 21:27:28 +00:00
Giuseppe D'Angelo
79539c50cd Q_DECL_EQ_DELETE_X: properly version the check for Clang
Clang 20 has fixed the referenced issue. Once more this shows the
importance of versioning compiler-related checks...
Amends 1b1ae345025d1cac953985d4cfebd20fadb6bc99.

Change-Id: Iea88d466883562b0130639d7c0f2f3b984acdbc2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fb1824a9d669c601ebd540c9ca16a9687d7d9706)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-26 20:13:12 +00:00
Cristian Le
926abdce78 Bundle Kitware's RunCMake test module
Introduce a new module `TestInternalPrivate`.

Kitware's RunCMake allows to create more granular unit tests using
`cmake -P` scripts instead of configuring, generating and building full
projects.

[ChangeLog][Third-Party Code]
Add upstream cmake's RunCMake test infrastructure module to
src/testinternal/3rdparty/cmake to aid in creation of cmake auto-tests.

Pick-to: 6.8
Change-Id: I08cb7c6dc6f61bde29f176d58295f4f660b34ca8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 39e7946cb6562c6f9b1baf5c44b1694922d0538e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-26 16:06:36 +00:00
Alexandru Croitor
143b016277 CMake: Add quotes around QT_DEBUG_OPTIMIZATION_FLAGS compiler flags
To more easily spot white space differences.

Pick-to: 6.8
Change-Id: I1e07960f78c95ca536243ce5c4fc6c302c47a7db
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 2dd0c4520fdee50a3511ca2f83decdf807ba2cb3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-26 16:06:35 +00:00
Alexandru Croitor
38835684b3 CMake: Fix full rebuilds when using MSVC and reconfiguring the build
When reconfiguring an MSVC -release build with 'cmake .' after a full
build, instead of being a no-op, it rebuilt everything.

This happened because of CMAKE_CXX_FLAGS_RELEASE being accidentally
modified on each reconfiguration, resulting in extra whitespace being
added to the compiler command line rules.

Specifically, this was because we always added '-O2 -Ob3 ' as a string
to the compiler flags, but due to stripping, always tried to remove
only '-O2 -Ob3' (no trailing white space) when removing the
optimizations flags, resulting in an extra white space for each run.

Remove the trailing white space after '-Ob3 '.

Amends 2fb134f3fe8fdeb1f36c346cff3b09a2b7a095a7

Pick-to: 6.8
Change-Id: I46eb4c3b769ae6b063fe62df05c0cb92f13bda30
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit fdb9a5141446ed8aa767d88a921c24221b0704ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-26 16:06:34 +00:00
Cristian Le
1fa408f328 Make AdditionalTargetInfo.cmake optional
Pick-to: 6.8
Change-Id: I8b8d6383b6c50e9403bc90e76d4da8eb6c314854
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 2433d02856bb55150d62d84b71b7d8a90c0ce81f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-26 16:06:33 +00:00
Cristian Le
0bd6b909ab Add interface to install EXTRA_CMAKE_FILES in other paths
If the source file sets `QT_INSTALL_PATH` property, it will install the
CMake files in the relative path starting from the config-dir in both
the build and install paths.

Pick-to: 6.8
Change-Id: I86197d62bfac96f9c142d8abfe85c9b6f6f1a527
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit aef789ad97ee9b8f3254a0e315a0d8a4785bcbf7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-26 16:06:30 +00:00
Eirik Aavitsland
5f3708e190 Update bundled libpng to version 1.6.47
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.47

Pick-to: 6.8 6.5 5.15
Change-Id: I11a0f266dddaad480a7700c3cdc4ec6da8de2fae
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 8b75f4735b36a77b6426c7dab55190416e6a4af5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-26 07:45:35 +00:00
Giuseppe D'Angelo
dbd149375b Docs: uppercase spelling of utf-8
It should be spelled UTF-8 (official name by the Unicode Consortium).

Pick-to: 6.8
Change-Id: Ib358d0870e77f0cb4cdb920ed5ca829f100707a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0770171dcda24a567d6f57b87fdd284011e56e16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-25 20:35:41 +00:00
Fabian Kosmale
34625db91a qt-cmake-create: Modernize QML template
- Do not use a version for the executable module target
- Rely on QTP0001 for the RESOURCE_PREFIX (via
  qt_standard_project_setup)
- Do not use OUTPUT_DIRECTORY to avoid a URI mismatch, potentially
  causing issues with the implicit import. Instead, use
  RUNTIME_OUTPUT_NAME to avoid a conflict between folder and executable
  name.

Change-Id: Ic6188d96042e7b34eb3f423daf2b57290ca18a11
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit e84145d6c14e92c3a499904f70046bc3ceee5960)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-25 03:04:43 +00:00
Michael Weghorn
6f559732cf QWizard: Drop obsolete sentence in QWizard::currentId doc
Commit 2140edaaab0bf61f354db521efca773568becc56 introduced
QWizard::setCurrentId that allows setting the property
directly, so drop the obsolete sentence in the QWizard::currentId
doc stating that this isn't possible.

Pick-to: 6.8 6.5
Change-Id: I5e7da2323e66a6e8bfd653dfebcba4363023b744
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 71246cbdc64c4a5b3b3859421221bcc36c4a61c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-24 23:57:34 +00:00
Alexey Edelev
16639502a7 Make PlatformGraphics lookup QUIET
Let's do not litter user's logs with our internals.

Pick-to: 6.8
Change-Id: I79e9210960f1298a6e8e2b6f10e1bfefdbfede7f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f9a05c7cae10c05b701003f8ed848d0bfef8290a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-24 22:38:38 +00:00
Lauri Pohjanheimo
3fe904e231 RenderToRgb10Texture test unblacklisted
On CI an Android emulator with SwiftShader software graphics
implementation is used. SwiftShader implementation is unable
to emulate this OpenGL functionality.

Blacklisting removed. QSKIP the test if it is run in Android platform,
OpenGL and SwiftShader sw graphics implementation is found.

Task-number: QTQAINFRA-6331
Pick-to: 6.8
Change-Id: I4a7e64e464ea04409154be2e7b3135ecd88a29fc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-02-24 09:16:05 +02:00
David Faure
ebbf2d298b Document the default value for QAbstractItemView::editTriggers
Change-Id: I4456dcfcecf739299533167867208e1943bc4a26
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
(cherry picked from commit 408959c8c85badfcd374b21fb2e6071c40e5cba4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-23 12:15:39 +00:00
Thiago Macieira
9593852f24 CBOR: remove QT_X11_DEFINES_FOUND dead code
Amends commit be0f1af3f1829da0d321c12dbd40d5743d3b2eb5 ("CBOR: remove
the X11 True and False for good"), which removed the #define from the
top of the files, but didn't remove the checking of the macro from the
bottom of them.

Change-Id: I92e76842a4117f6feed3fffdac2fcec01367101e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 00f3ca950a6cab105c95b53ce2b3b93282abcea8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-23 07:56:00 +00:00
Thiago Macieira
fab3e958da QT_TEST_EQUALITY_OPS: insert QCOMPARE before the current code
The macro, as it was, makes debugging REALLY hard:

FAIL!  : tst_QStorageInfo::operatorEqual()
 The computed value is expected to be equal to the baseline, but is not
  Computed (lhs == rhs)   : 0
  Baseline (expectedEqual): 1
  Loc: [qcomparisontesthelper_p.h(178)]

It prints the location of the macro helper, not the line that called it,
so one has to guess which of the many uses in a function has failed. And
it prints the boolean of whether the comparison result is the expected
value, not the values of left and right.

QT_TEST_ALL_COMPARISON_OPS also needs a similar fix, but I don't have
time for it. Ideally we'd replace the qScopeGuard with a proper QTest
failure report, which would extract the printers for Left and Right.

Change-Id: I7a643066137c5fcdb9e7fffd83d9bf7cf4cccd6c
Reviewed-by: Rym Bouabid <rym.bouabid@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4a4c4252919d4894c7e5c6f2e636dda5dc1b1d0d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-23 01:34:06 +00:00
Christian Ehrlicher
5518a384b2 SQLite: Update SQLite to v3.49.1
[ChangeLog][Third-Party Code] Updated SQLite to v3.49.1

Pick-to: 6.8 6.5 5.15
Task-number: QTBUG-132862
Change-Id: I544a7e2435315469fc174e2b2bf8c9ddbcf78c06
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit bc06c7c61a4fe8fb695d581e43779fa5351febbf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-22 23:02:47 +00:00
Eskil Abrahamsen Blomfeldt
e51d03e334 Escape calculating vertical windows-metrics if they're too big
This amends 073fae097ce40bee1532c252a8c696840b5dfc16 which added
an escape before calculating the vertical metrics if they were too
big and would overflow. It missed one spot, which was when using
the winAscent/winDescent instead of the typo-metrics.

Change-Id: Ib6a7705f6676c66bfd04b37efa30fe2d1b99581c
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit f846754663aae1652e4eec9a441ee222af352319)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 23:23:28 +00:00
Alexandru Croitor
dbfd84ae4c CMake: Rework SBOM PURL handling
Previously, only 3 purl entries could be added to a target, which
tightly coupled to Qt's needs: a QT one pointing to code.qt.io,
a MIRROR one pointing to github, and an upstream one pointing to some
upstream third party location.

Rework the implementation to allow for an unlimited number of PURL
entries and to allow more flexibility when adding PURLs in a user
project.

The new syntax for adding PURLs to a target, which is also the basis
for a future public API is as follows:

qt_internal_add_sbom(<target>
    PURLS
        [[PURL_ENTRY
            PURL_ID <id>
            PURL_TYPE <type>
            PURL_NAMESPACE <namespace>
            PURL_NAME <name>
            PURL_VERSION <version>]...]
    PURL_VALUES
        [purl-string...]
)

The PURLS keyword is used to specify multiple PURL entries, each
starting with the PURL_ENTRY keyword. The PURL_VALUES keyword is used
to specify a list of pre-built purl strings.

PURL_ID is an optional argument used to identify a specific purl
entry, which is mostly needed for Qt's needs, to post-process them
further.

The rest of the options are pre-existing from the previous
implementation.

Implementation-wise, there's a new custom parser to be able to parse
and validate PURL_ENTRY arguments.

The VERSION option was renamed to PACKAGE_VERSION, to avoid some
issues in cmake_parse_arguments parsing with nested VERSION options.

The NO_PURL option was removed because it makes no sense in the new
implementation, because if you specify some PURL arguments, there is
already an intention to generate a PURL entry.

Qt entities no longer have a restriction on which specific purl ids
they can have.

The new Qt specific purl IDs have been renamed:
- QT -> GENERIC
- MIRROR -> GITHUB

Amends f7e1123620b623be0c321b54eaba7a1d618a7ce1

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I050decece1c6d9e6e0e06547043f864d6f497ea7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit a28a9e194cbcaf501c93df988c7dc6f5e09ee5d1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 19:49:41 +00:00
Alexandru Croitor
2d51fc3c69 CMake: Move generic PURL function from qt-specific file to main one
Move generic PURL function from qt-specific file to main one. It was
mistakenly added to the wrong file during the initial split.

Amends f1ac316191c010b1389f6f3549c9f0b4424b9936

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I1884f53ee7d30a25b873d85ee04b8c8d1e0532f5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit fd622bc3ae90ba27069744bf61524139f1642872)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 19:49:41 +00:00
Alexandru Croitor
a70a4f65fe CMake: Move more Qt-specific SBOM PURL functions to the right file
The Qt specific functions belong in the
QtPublicSbomQtEntityHelpers.cmake file, not
QtPublicSbomPurlHelpers.cmake.

Amends f1ac316191c010b1389f6f3549c9f0b4424b9936

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: If5dd77672306c520404b294a6b5bde4f0e6ab8bc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit e7cdf9d4385f02fa82e2d9f23abb8aa06f9440b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 19:49:41 +00:00
Wladimir Leuschner
b1979646fb QWindowsTheme: Set highlight color to accent color in light mode
GetSysColor(COLOR_HIGHLIGHT) did not report the right highlight color in
light mode palette, Leading to a wrong accent color on
Windows. This patch uses the accent color analog to the dark mode
palette for QPalette::Highlight.

Fixes: QTBUG-130458
Pick-to: 6.8
Change-Id: If21f392e31c3187c28e871919ff17f417c8d144b
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit a55db2cbee914d7bdc5678f35da297b79aec7613)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 14:54:42 +00:00
Toni Saario
1a5499ce5f Coin: Extend VxWorks restart matching to RTPLib errors
Running many tests on the VxWorks in the emulator without
restarting it between can cause exhaustion of some
resources and cause an RTP spawn fail in some tests.

This change will restart the emulator in such cases, which
allows the test to try again on fresh boot.

Change-Id: I5ad715f243867d43b055271d6bc61ca4ccb3089b
Reviewed-by: Simo Fält <simo.falt@qt.io>
Reviewed-by: Michał Łoś <michal.los@siili.com>
(cherry picked from commit 5be7a9773e106f9675e8d57121c298539f4ce343)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 14:52:54 +00:00
Marc Mutz
56c05f47f6 QByteArray::remove(n,n): minor code cleanup
The result of d.begin() is only used in one of the branches, so
defining it outside both branches is a bit unmotivated; instead, drag
toRemove_start out of the else branch and reuse it in the then branch,
too.

Amends 358b7a9e747549f85c1d1631dfb21210b52b36f5.

Pick-to: 6.8 6.5
Change-Id: I162d72de7097a1257c8a0a01b69c36fc87466114
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 2831ce613fdaebe94e35a8afe45a057004548991)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 13:28:47 +00:00
Marc Mutz
72f41f8756 QByteArray: delegate to replace(char,char) from replace(QBAV,QBAV)
Don't go and build (among other things) a Boyer-Moore table for the
trivially optimizable replacement of single characters with single
characters. Just call the existing replace(char, char) overload.

Pick-to: 6.8
Change-Id: Ic69527bdaa5ce95bf937295366b94366e2ace933
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 60af93847e365fc00ccc4bcf61bb90ef6da1f0b2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 13:28:41 +00:00
Marc Mutz
6cefb8be96 QLocale: fix UB (signed overflow) in formattedDataSize()
Coverity complains that qCountLeadingZeroBits() may return 64 and then
the RHS will be out-of-range for int. Of course, 64 leading zero bits
means that the argument is 0, which we excluded in the first `if` of
the if-else chain.

I can only guess (because it doesn't tell me which value of `bytes` it
is using for the analysis) that Coverity assumes bytes ==
numeric_limits<qint64>::min() and considers the overflow in qAbs() to
yield a 0, because, it being UB, it may yield anything.

Be that as it may, the fact remains that formattedDataSize() invokes
UB when passed numeric_limits<qint64>::min(), as confirmed by ubsan:

   global/qnumeric.h:479:26: runtime error: negation of -9223372036854775808 cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself
   text/qlocale.cpp:5062:82: runtime error: signed integer overflow: -2147483648 * 3 cannot be represented in type 'int'
   text/qlocale.cpp:5062:26: runtime error: division by zero
   FAIL!  : tst_QLocale::formattedDataSize(English-Decimal-min) Compared values are not the same
      Actual   (QLocale(language).formattedDataSize(bytes, decimalPlaces, units)): "-inf bytes"
      Expected ("output")                                                        : "-9.22 EB"

So fix the overflow by using the new QtPrivate::qUnsignedAbs(). Then
sit back and await Coverity's verdict on the next run.

[ChangeLog][QtCore][QLocale] Fix issue when calling
formattedDataSize() with numeric_limits<qint64>::min().

Amends 9d23aebb271ea534a66cb3aceb2e63d9a1c870d6.

Pick-to: 6.8 6.5 6.2 5.15
Coverity-Id: 474294
Change-Id: I9a5a5acbdcf881a624bb827ca1dd970771f1bb6e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit b93575de01760ff2ab0d817557a642c71cdb4414)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 13:28:39 +00:00
Marc Mutz
9479f9bbfc tst_QCryptographicHash: remove remnants of BigData split
The ensureLargeData() and 'large' members were only used in BigData
tests that have since moved to a different executable.

Amends fff217824b532da7306af1ac755581e76e098a27.

Pick-to: 6.8 6.5 6.2 5.15
Change-Id: Idc99a868e082098dda4e1bee62470370c7e20f62
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5cd046f154a0a31635c935bf6c9f1abd27837b80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 13:28:37 +00:00
Marc Mutz
646bea85a5 QByteArray: don't recurse when needle or replacement alias *this
While the idea to delay the construction of the QVLAs until we know we
need them is elegant, we're doing a lot of checks twice or thrice this
way, so merely re-set the a, b pointers and otherwise continue
executing.

This requires us to default-construct the QVLAs before potentially
assign()ing to them, but that ought to be cheap, given the compiler
can see everything that's going on in QVLA.

Pick-to: 6.8 6.5
Change-Id: I4e42d5ab48711af91cc1785171524be5fb45ae2f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 4308ab70cafa4398aa72dfe63bc580a6ecff9e52)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 13:28:34 +00:00
Patrick Stewart
09c093f969 Close the Qt namespace even when QT_NO_TRANSLATION is defined
Pick-to: 6.8 6.5
Change-Id: I5e463b81f7e73b2946a0e3b3036a09de2105307b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c9c8abb52d4ba77c551513baf678be0761d1c895)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 11:46:18 +00:00
Christian Ehrlicher
3cd991037d QSqlTableModelTest: misc cleanup
Cleanup QSqlTableModelTest:
 - use pmf QSignalSpy ctor
 - use QCOMPARE/QCOMPARE_GE instead QVERIFY where possible
 - properly close additional databases so temporary folders created for
   sqlite can be deleted on exit

Pick-to: 6.8
Change-Id: I84e8960b81128c141a0e2cd6d03837c9b5ac6652
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a47dc990793a1e299e9ba869e1d6c76fa0bf9d65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 11:46:16 +00:00
Joerg Bornemann
3c178b40e7 configure: Fix the -sbomdir argument
The argument must be added in qt_cmdline.cmake to work.

Pick-to: 6.8
Change-Id: Ic256c0fda0caf3794b37ad8c5e8b6515fb45b0e6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5971e94bafacfebdcd28ef84a7cfea61ffd48689)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 10:52:15 +00:00
Thiago Macieira
81443770ce QDirListing: std::exchange is <utility> not <memory>
The Clang analyser in Qt Creator was letting us know that <memory> was
unused in this header. Also, this is Include What You Need.

Pick-to: 6.8
Change-Id: Id7c260818f9e84847971fffda11da096169a0047
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 9dc8bc80de03ccf52fabf63855128c5852d51605)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 03:21:18 +00:00
Even Oscar Andersen
87e28fc8ec wasm: call focus on window if not editable
We used to call focus on the input element even for things
like pushbuttons.

This will display a keyboard on android, instead call
focus on the focus window.

Fixes: QTBUG-133781
Pick-to: 6.8
Change-Id: Ide4d6ec21a14f17b40d3d3de077c0ab073682f19
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
(cherry picked from commit 442e2f4aeb2081c1b8344a8f5cc2c6f2e7bb7d5b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 00:03:29 +00:00