Commit Graph

69952 Commits (ae556d760be0b895e20e4f22d8f682249c0bbcda)

Author SHA1 Message Date
Alexandru Croitor ae556d760b CMake: Remove semicolon from SBOM external document references
The external doc references need to be appended as strings, not list
elements, otherwise there will be semicolons in the output SPDX file.

This issue was inherited as-is from the upstream SBOM generation
project.

We are fortunate the json converted files are missing the semicolons
due to implementation specifics.

Task-number: QTBUG-122899
Change-Id: I2b91775d59d64709b72ff7130dd4f6b506ef8244
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 94e19f42e80fdd8bc03c2f83b351e9662cdac8a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ee8cd912795cc9422aa607e8a072403b660773ad)
2025-03-04 12:02:34 +00:00
Milian Wolff 51e94ff4fc Optimize QUtcTimeZonePrivate common case for UTC id/name
When the name/id is "UTC" then we can reuse the interned
string literals, which allows us to get rid of extra memory
allocations (and frees later on) for these strings.

This patch brings another hefty relative improvement to my benchmark.
Compare the following results for tst_QTimeZone::utc benchmark as
built on my machine with:

    Config: Using QtTest library 6.10.0, Qt 6.10.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 14.2.1 20250207), arch unknown

Before:

    102.004937 nsecs per iteration (total: 102,004,835, iterations: 999999)
    452.836869 CPU cycles per iteration, 4,44 GHz (total: 452,836,417, iterations: 999999)
    1,182.801068 instructions per iteration, 2,612 instr/cycle (total: 1,182,799,886, iterations: 999999)
    267.143901 branch instructions per iteration, 2,62 G/sec (total: 267,143,634, iterations: 999999)

After:

    36.708812 nsecs per iteration (total: 36,708,776, iterations: 999999)
    169.024518 CPU cycles per iteration, 4,6 GHz (total: 169,024,349, iterations: 999999)
    601.286607 instructions per iteration, 3,557 instr/cycle (total: 601,286,006, iterations: 999999)
    139.051610 branch instructions per iteration, 3,79 G/sec (total: 139,051,471, iterations: 999999)

Relative Delta:

            before   after    improvement
    nsecs   102.0    36.7     2.78x
    cycles  452.8    169.0    2.68x
    instr.  1182.8   601.3    1.97x
    branch  276.1    139.1    1.98x

Change-Id: I4aae3ac59edc173f96751d7e05335ad6b63f7275
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit c67659149f7f3a4600a211e82bfd067a8e08ae51)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 0437f1925b8be82f940e9f08b657ab6dfb71340e)
2025-03-04 08:51:37 +00:00
Milian Wolff de5b83ac86 Optimize QTimeZone::utc()
Instead of using the QTimeZone ctor taking a string representing
UTC which then first needs to be parsed, use the offset-from-UTC
ctor with an offset of 0.

This approach is much faster, compare the following results for
the tst_QTimeZone::utc benchmark as built on my machine with:

    Config: Using QtTest library 6.10.0, Qt 6.10.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 14.2.1 20250207), arch unknown

Before:

    358.686871 nsecs per iteration (total: 358,686,513, iterations: 999999)
    896.524312 CPU cycles per iteration, 2,5 GHz (total: 896,523,416, iterations: 999999)
    2,227.000427 instructions per iteration, 2,484 instr/cycle (total: 2,226,998,200, iterations: 999999)
    560.000375 branch instructions per iteration, 1,56 G/sec (total: 559,999,815, iterations: 999999)

After:

    102.004937 nsecs per iteration (total: 102,004,835, iterations: 999999)
    452.836869 CPU cycles per iteration, 4,44 GHz (total: 452,836,417, iterations: 999999)
    1,182.801068 instructions per iteration, 2,612 instr/cycle (total: 1,182,799,886, iterations: 999999)
    267.143901 branch instructions per iteration, 2,62 G/sec (total: 267,143,634, iterations: 999999)

Relative Delta:

            before   after    improvement
    nsecs   358.7    102.0    3.52x
    cycles  896.5    452.8    1.98x
    instr.  2227.0   1182.8   1.88x
    branch  560.0    267.1    2.10x

This is quite a significant change for such a trivial patch.

Change-Id: I5872fe8f1158ff9f6bf306ca8b069559cb59beec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 765193693982abdbc53910ff0d7d1149332ca83e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 22e66638a6c984d366057d1bb0c6de6dc65df373)
2025-03-04 08:51:35 +00:00
Milian Wolff 26e3a06aca Add explicit test coverage for QTimezone::utc
Basically this should work exactly the same as constructing the
QUtcTimeZonePrivate directly. Follow-up performance optimizations
should not change any of this behavior.

Pick-to: 6.5 5.15
Change-Id: I2a3e78965f3a553b8b70cb12f7772b9fdfbf7bf7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7a79ce13a93aab724e8943d83fc903c88466d053)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9cba61e5eb7cbbfb197f2b90d33b294e43291065)
2025-03-04 08:51:32 +00:00
Milian Wolff f55ea3271b Add maybe_unused in benchmark to guard against nodiscard in the future
Requested by Marc Mutz when adding the utc() benchmark.

Pick-to: 6.5 5.15
Change-Id: I6f97f9e4dab07d10718280b4fb7ac158e42b8d67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1f0bcec874dba8adbdf8de34e899565e89e80a38)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit cc6074c543a37426db9227257256c20efde40a79)
2025-03-03 08:21:00 +00:00
Milian Wolff fd8b35a121 Add a benchmark for QTimeZone::utc
On my machine this gives me:

```
********* Start testing of tst_QTimeZone *********
Config: Using QtTest library 6.10.0, Qt 6.10.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 14.2.1 20250207), arch unknown
PASS   : tst_QTimeZone::initTestCase()
PASS   : tst_QTimeZone::utc()
RESULT : tst_QTimeZone::utc():
     358.686871 nsecs per iteration (total: 358,686,513, iterations: 999999)
     896.524312 CPU cycles per iteration, 2,5 GHz (total: 896,523,416, iterations: 999999)
     2,227.000427 instructions per iteration, 2,484 instr/cycle (total: 2,226,998,200, iterations: 999999)
     560.000375 branch instructions per iteration, 1,56 G/sec (total: 559,999,815, iterations: 999999)
PASS   : tst_QTimeZone::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 374ms
********* Finished testing of tst_QTimeZone *********
```

Profiling shows some quite unexpected code paths that
I will try to optimize in follow-up patches. Note that
this function can be called frequently when deserializing
QDateTime over a QDataStream e.g. - I have stumbled over
it while profiling some KDE PIM code in akonadi.

Pick-to: 6.5 5.15
Change-Id: I7439df53ae8512c766f63cb4b0d4f33d14aa3a01
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 29c7beac2e0065cc0d03b9db6a701f7c690c6f56)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c4618d6020b1ab568f40338fb715142d8fe01445)
2025-03-03 08:20:57 +00:00
Marc Mutz 40b45176b9 tst_QByteArray: check replace() doesn't replace the terminating \0
It doesn't.

Pick-to: 6.5 5.15
Change-Id: Ica3fb2b8a65d0f9d14490ecdcce72eba82258916
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit fff69288781bf946ad645fd781ad51ab48ebcbdc)
(cherry picked from commit 8e2c6a590429892d9fecf9a0ccc7c6a00d6c7b6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-01 23:45:32 +00:00
Alexandru Croitor e393bf24d9 CMake: Add function to set up SBOM generation defaults
Move the setting up of options like QT_GENERATE_SBOM into a separate
function, that can be called by projects other than Qt.

Task-number: QTBUG-122899
Change-Id: I337c4e9b0b3154ff97f494887bf88ee01e8ed00c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit dc5c7f9ead7e47b92c5717ca24d585a718a8b5f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit dcb72b531576fc7705ff6dfcc6e2a1546b08fb4f)
2025-03-01 23:45:31 +00:00
Marc Mutz 7637203f8d tst_QByteArray: check replace() with empty and null needles and haystacks
Some time ago, we spent a lot of time fine-tuning the behavior of
indexOf() and split() w.r.t. matching of empty needles, or in empty
haystacks. Make sure that (QByteArray) replace() is behaving
consistently.

It isn't. Filed QTBUG-134079 to track the issue.

Pick-to: 6.5
Task-number: QTBUG-134079
Change-Id: I16af5d2bb5b309a56e81854be434fa9430ae284f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5fc1e9fa0c1925654412af5bf46ff95da99bc190)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c653cf1171d6ccf8a8036d8b396e57465b9a7d4e)
2025-03-01 23:45:26 +00:00
Alexandru Croitor 37ea573216 CMake: Include license and license file attribution in SBOM comment
Some attribution entries don't have a SPDX license id specified, in
that case it's good to at least include the free-form license name and
file path.

Task-number: QTBUG-122899
Change-Id: I75bb5c30645684ea74fe94da92ea30eb29965ad4
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit cf9f09cd60e3db37643ac6cf6cfd51aa00749892)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2769ef7174839578c26b2c7c260d76bce59fe8ca)
2025-03-01 23:45:24 +00:00
Ulf Hermann 80f5aeeb85 QByteArray: Make gcc 12 happy
It somehow concludes that asize may be negative and would then cast to
an obscenely large size_t. This produces the following warning:

.../qbytearray.cpp: In member function ‘replace.constprop.isra’:
.../qbytearray.cpp:2579:23: warning: ‘memcpy’ specified bound between 9223372036854775808 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
 2579 |                 memcpy(d + to, a, asize);
      |                       ^

Check for asize > 0 rather than asize != 0.

Pick-to: 6.5
Change-Id: I63bccb1bf3ff45d539af4efe6843d2c648d7cb86
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 177cd123d29f818413db4bb7a9d92b8485c95947)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b9169c12105414e58b7a0244a867d6e8fa96f572)
2025-03-01 04:54:27 +00:00
Eirik Aavitsland e9146b64f2 Raster engine: Fix painting of zero length, square cap wide lines
Such lines are rendered by drawing a capless line that is pen-width
long, i.e. a square, to represent the two line caps. However, the line
length offset was added before any transformation, so one could end up
with a long line being rendered if the world transform had a large
scale, say.

Change-Id: Idff8a2de54c97e35facc8f4e09c43dfea7397588
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 56de11397559af3b9694ef2b99d93a469889ae5e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8159f4626bb1c1a267f464464cd757638fda7110)
2025-03-01 04:54:25 +00:00
Laszlo Agocs f03c3055e6 rhi: d3d: Fix 3D textures exposed via UAV
The docs for D3D11_TEX3D_UAV do not mention accepting -1 as WSize,
unlike D3D12_TEX3D_UAV. Hence passing in m_depth for D3D11.

Fixes: QTBUG-129300
Change-Id: I517d23e076039543361d2bca1b91cddd47abcfaa
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
(cherry picked from commit 6f89357f59b507c0dcdc177bc1ecfbbc94d6fed3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e71708a6e5e0d9f95682551ca5c4650bd6fa6e74)
2025-02-28 17:15:33 +00:00
Marc Mutz fc16215e0a QByteArray::replace(): use std::string instead of QVLA<char>
QVLA preallocates space for 256 entries, and while that should be
enough for most uses, it may be too much in the way of stack usage.

Instead of using a QVLA with a non-standard preallocation, use the
more compact std::string benefitting from its SSO.

Pick-to: 6.5
Change-Id: Ia22543fb287a1976f316f7a4d27b23a22f511463
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7c21630ce625817f1dc8e7182023b3fc6d36ac37)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d561d864eba0af50378b7961b3ecdff6fefeb1d7)
2025-02-28 17:15:32 +00:00
Alexandru Croitor 8c1379e5ea CMake: Handle installing files with same name during SBOM generation
It's possible for a project to install a custom file with the same name
into different destination directories, and want to include them in
the SBOM.
Previously this failed at CMake generation time with an error like:

CMake Error: Files to be generated by multiple different commands:
qt_sbom/SPDXRef-PackagedFile-foo-bar.cmake

This happened due to using a non-unique filename for the generated
SBOM building file, as well as the spdx id the file name is based on.

Include a short hash based on the installed relative path of the file
to avoid spdx id clashes, and thus generated file name clashes.

Task-number: QTBUG-122899
Change-Id: I4c2ecd4652708504ef299af9b6f53d680d542382
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 9245d0a0f0761364e7b5b3d1c5c96cba16522820)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 37c60080ddedb339089e7bccaf25e360c7b3ebb8)
2025-02-28 04:57:55 +00:00
Thiago Macieira 4252207e8f 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().

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>
(cherry picked from commit 54ef8bf929d9536f3cf6e1a360f72b1d7328f90f)
2025-02-28 00:10:15 +00:00
Sze Howe Koh cb92b777e3 [Doc] QObject: Sync warnings of isSignalConnected() and receivers()
Extends e75c1a00e3 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.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>
(cherry picked from commit 206a8fec2cb2aeb964282ba0a370f675d69c1f91)
2025-02-28 00:10:15 +00:00
Mårten Nordheim baeda090d3 QMultiHash: fix/update class description documentation
It no longer inherits QHash, so drop the references to this.

And remove an extra 'and'.

Change-Id: I5c19f7793571fe04f93e0ede37d280d215d95dfc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit dc8055c9149c0ceb42b4313fb7af0a5b78fe1c16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1aef8b9057e54de34b7ad413b5df1c023814f3ce)
2025-02-27 20:06:40 +00:00
Alexandru Croitor 4486fe8df2 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.

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>
(cherry picked from commit 5fd8af81adca8f6d5ee074c14f0912c190a1ac60)
2025-02-27 19:20:57 +00:00
Alexandru Croitor 9da3c4e2ea CMake: Extract Qt-specific license concluded handling
Extract the handling of the license concluded expression for Qt
entities into the Qt specific handling file.

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>
(cherry picked from commit 8a1dcd2bb9bcb9e3667199b71910b01c47b8516e)
2025-02-27 19:20:51 +00:00
Alexandru Croitor ff32c71273 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.

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>
(cherry picked from commit 1f8a8da7c2a2618c62679c971101c363a38da476)
2025-02-27 19:20:45 +00:00
Alexandru Croitor 2d38e0346c 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.

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>
(cherry picked from commit 68856adf1d609635b835f58ee22a027df9d34aa5)
2025-02-27 19:20:39 +00:00
Alexandru Croitor 8f71664791 CMake: Remove leftover code after refactoring
The assignment is not used anywhere.

Amends f1ac316191c010b1389f6f3549c9f0b4424b9936

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>
(cherry picked from commit db7e6d6fedf1b2ede9b67c9ba419273f148a4b37)
2025-02-27 19:20:32 +00:00
Alexandru Croitor ede870c39e 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.

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>
(cherry picked from commit 8d8cf0bbfe931159965e6f6175c8728ee61e23a7)
2025-02-27 19:20:25 +00:00
Alexandru Croitor e7b3f576ce 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.

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>
(cherry picked from commit c276fa45dc38e07a2d42cf2ff2656f820a204078)
2025-02-27 19:20:18 +00:00
Alexandru Croitor 02c5023857 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.

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>
(cherry picked from commit 21c5970da48bd1a0616084679aa097f4e12f4d60)
2025-02-27 19:20:11 +00:00
Alexandru Croitor a246d02ecb CMake: Sanitize nested SBOM attribution target names
To avoid issues with characters like "/" which might come from
attribution ids.

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>
(cherry picked from commit 1dc3a9cac28b073c760b8ac7a4420b784e45b1f5)
2025-02-27 19:20:05 +00:00
Alexandru Croitor 4a4d4c6e13 CMake: Remove type restriction on attribution file extra SBOM info
So it can be used in other non-Qt projects.

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>
(cherry picked from commit 59745fc79850a2fe8c1e75d71fecc315bd617970)
2025-02-27 19:19:59 +00:00
Alexandru Croitor baa93a5591 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.

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>
(cherry picked from commit bccb4c8328713849993e935cb517d8821301e5d6)
2025-02-27 19:19:53 +00:00
Marc Mutz d13a416d00 tst_QStringTokenizer: check when the lazy range may be empty
Only when using SkipEmptyParts...

Pick-to: 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>
(cherry picked from commit 0e7f52c8726c3c5b53d7dc9133a82e551fe830a7)
2025-02-27 19:19:50 +00:00
Ahmad Samir 0635892562 QDir: improve mkdir/mkpath API docs
Pick-to: 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>
(cherry picked from commit d47af17a0de8a2f6516f4896d851a600a9f810be)
2025-02-27 06:57:33 +00:00
Rami Potinkara 5f00082844 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.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>
(cherry picked from commit d2f48abeb5702b7ed577d22355b3ff9b1f058b8b)
2025-02-27 01:04:16 +00:00
Cristian Le de0b702d31 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.

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>
(cherry picked from commit 926abdce783542638dcfa59fa1f4218b9cf3a151)
2025-02-26 20:13:33 +00:00
Cristian Le 2830add722 Make `AdditionalTargetInfo.cmake` optional
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>
(cherry picked from commit 1fa408f328268776b7b6b0a659eedf3dd7f11953)
2025-02-26 20:13:27 +00:00
Alexandru Croitor 09fe70a5b6 CMake: Add quotes around QT_DEBUG_OPTIMIZATION_FLAGS compiler flags
To more easily spot white space differences.

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>
(cherry picked from commit 143b016277928447034045c0cf3b951f83ae4357)
2025-02-26 20:13:25 +00:00
Cristian Le 5466c4daeb 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.

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>
(cherry picked from commit 0bd6b909ab5af5b323a0ecb1a5715cea6f138191)
2025-02-26 20:13:20 +00:00
Alexandru Croitor 08a6fae9f9 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 2fb134f3fe

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>
(cherry picked from commit 38835684b3b83b9d9795dd37435fbb5a29050e57)
2025-02-26 20:13:18 +00:00
Eirik Aavitsland cd04bfe905 Update bundled libpng to version 1.6.47
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.47

Pick-to: 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>
(cherry picked from commit 5f3708e1901b7bd4c6c3206f94934b0e3119b9ad)
2025-02-26 16:21:57 +00:00
Giuseppe D'Angelo b901a2a624 Docs: uppercase spelling of utf-8
It should be spelled UTF-8 (official name by the Unicode Consortium).

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>
(cherry picked from commit dbd149375b016ec51432f036977e312df9dc58a7)
2025-02-26 16:21:57 +00:00
Konsta Alajärvi e8a71279c6 Unblacklist tst_qrhi renderToTextureSampleWithSeparateTextureAndSampler
Unblacklist test function by skipping it with Android with Vulkan.

Fixes: QTQAINFRA-6335
Change-Id: I2ee093542f09f68044baa044b697a09af066fcd8
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Lauri Pohjanheimo <lauri.pohjanheimo@qt.io>
(cherry picked from commit fd15b2178a3468bf1fcd04b79467e1400ec6c8d3)
2025-02-26 10:44:08 +00:00
Alexey Edelev 05d247e10e Make PlatformGraphics lookup QUIET
Let's do not litter user's logs with our internals.

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>
(cherry picked from commit 16639502a778930a50beb5208c8596b96805a97b)
2025-02-25 19:17:20 +00:00
Lauri Pohjanheimo 7fcd6c1aef 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
Change-Id: I4a7e64e464ea04409154be2e7b3135ecd88a29fc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3fe904e23199fe73637425a26bb81dbbf069b2f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-25 13:28:02 +00:00
Alexey Edelev 877ba467e1 Skip the work around of disregarded dependencies for interface libraries
Support the old CMake.

Amends 085ed83bb3ae4842b7dba8ff1fbd086477d461bf

Change-Id: Ibcc8f51d0381a4843adcaec9ce58d13a9e69ef8c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-02-25 14:28:02 +01:00
Michael Weghorn edb9c90a97 QWizard: Drop obsolete sentence in QWizard::currentId doc
Commit 2140edaaab 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.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>
(cherry picked from commit 6f559732cf46f95f08de37c11d8b515c6e969c4e)
2025-02-25 09:32:05 +00:00
David Boddie dd25a75cd8 doc: Remove link to missing showShaded() function
Change-Id: I8a70558521a6829e0bd99f03a7aa695681061945
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit c08ca6ff02af9d735b2692b958c1666ea96996bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 73e9605765a69c833371da45fb843dac64a34264)
2025-02-24 09:52:20 +00:00
Alexandru Croitor c1a6c8aa20 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

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>
(cherry picked from commit dbfd84ae4c3139f0e9e3ba01192b8f5570615603)
2025-02-24 09:52:20 +00:00
Alexandru Croitor 78a00a3d4d 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

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>
(cherry picked from commit 2d51fc3c692675209316658214ef26d2fbfc6e97)
2025-02-24 09:52:20 +00:00
Alexandru Croitor 4c8cf8801e 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

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>
(cherry picked from commit a70a4f65fea539bcda1c0d5d9d7ba546c70b5d84)
2025-02-24 09:52:19 +00:00
Eskil Abrahamsen Blomfeldt ca8ee54544 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>
(cherry picked from commit e51d03e334b18cd34fbfb708b9835327658f2075)
2025-02-24 10:52:19 +01:00
Robert Löhning 86fa37fc3b QFontEngine: Escape values too large for QFixed
Change-Id: I9d21d784ca13f31f4237c1517016a69cf5df4ca4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 073fae097ce40bee1532c252a8c696840b5dfc16)
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2025-02-24 10:52:19 +01:00