71231 Commits

Author SHA1 Message Date
Eskil Abrahamsen Blomfeldt
bf37860a71 Upgrade Harfbuzz to 10.4.0
[ChangeLog][Third-Party Code] Upgraded Harfbuzz to version
10.4.0.

Fixes: QTBUG-134282
Pick-to: 6.8 6.5 5.15
Change-Id: Ib36df2ae6b0fa4cf667b25d460473d45e8b34350
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ecc8ca605c30ce7268a3d05c2fe6f6f6e337de5d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 550db195afba3a5e4aa12d2bb476cb26c9f89a63)
2025-03-06 02:45:08 +00:00
Giuseppe D'Angelo
3e32c9b55b QThread: disable pthread_clockjoin_np when building under TSAN
TSAN does not support intercepting pthread_clockjoin_np (only join,
tryjoin and timedjoin), and will claim that an application leaks threads.
Disable the clockjoin codepath when building under TSAN.

Unfortunately I can't seem to find a version check for the sanitizers to
apply here and know if and when TSAN will get this support.

Change-Id: If12419e5d600e519bf4315d27f74d74a87dcf792
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 84d6309cf1eaf7632298d1305ce17f5f7497e1c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 02:44:59 +00:00
Volker Hilsheimer
cb8a6a5ea9 Doc: fix documentation warning for QByteArray::fromCFData
\brief tags are not used for member function documentation.
Explicitly set the prototype for qdoc instead, it doesn't seem to
know what to do with the definition in an ObjectiveC file and
produces link warnings.

Pick-to: 6.9.0
Change-Id: I89252e7b84586e987ed6d950d90142e916d8f1df
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 03efe9a21bb7a879ae51e3ad007dd2cdb8c6d981)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-06 02:44:47 +00:00
Cristian Le
0bdad95d0c Make qt_internal_set_warnings_are_errors_flags genex-ed
Fixes: QTBUG-132705
Pick-to: 6.8
Change-Id: I57987f1ae1c6d6adc4a2d0151f365c24605b940e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e3af89f7b4e8daa9cbfcc0d2c7cec7b7478f9406)
2025-03-05 17:47:17 +01:00
Christian Ehrlicher
8b59467d20 QStyleHelper: fix compilation with disabled features
When certain features are disabled, qguiapplication.h does not get
included which results in a compiler error. Therefore add it directly.

Pick-to: 6.9.0 6.8
Fixes: QTBUG-134235
Change-Id: I7836fc52c5037ca15c7ce48617c9f814d71963aa
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 98653cca453fe3d88807d1a314ae17efadd7c958)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-05 01:36:09 +00:00
Christian Ehrlicher
d6802feee0 QDrawUtil: Cleanup qDrawPlainRoundedRect/qDrawPlainRect
Cleanup the drawing code to avoid useless drawings by only calling
drawRect once with the correct parameters. This also removes rendering
artifacts due to e.g. rounding errors with a dpr != 1.

Fixes: QTBUG-132187
Pick-to: 6.8
Change-Id: Ib5eff89c8bdcbd0c86954e78dadaad83346c92ff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 611031e4f069aea6a0312b5c459247094204d5eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-05 01:36:07 +00:00
Thiago Macieira
2125135064 a11y uia: fix build: MinGW has those macros
Don't do proxy checks for the thing you want to test. Whenever possible,
test the thing you want to test.

We can't check for the definition of certain structs, though. Those have
to remain a proxy check.

Pick-to: 6.9.0 6.8
Change-Id: I5003e785706cd66923e4fffd6b11254233d09dc5
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9c4c5dc9f9c4358489d138dc4cf5aa6131b1bd24)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-05 01:24:04 +00:00
Morten Sørvig
a1a872e2d2 wasm: disable text drag for text edits
Disable text drag if asyncify is not enabled.

Fixes: QTBUG-131256
Pick-to: 6.8
Change-Id: I6589f11dda42c2f41db610e7cfece8a3db6573db
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 665acc02cf106071d57d012bb68250c2ea5d0a2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-04 17:50:21 +00:00
Marc Mutz
e2129f6548 QWidget: init data in ctor, not Private::init()
This should fix Coverity's hallucination that QWidget::data is used
uninitialized, or, after 58b9250aea0b1b41c8cbd1033149371a93a5b2c1,
dereferenced while it's still nullptr.

Coverity-Id: 475552
Coverity-Id: 475551
Coverity-Id: 475550
Coverity-Id: 475549
Coverity-Id: 396828
Pick-to: 6.8 6.5
Change-Id: I49705b8bc44082fc68a59c2c98c4e37a6d841b19
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bcd29a9eab00c77bc402b9d4242f097d19c92044)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-04 17:08:33 +00:00
Leena Miettinen
9a0716b728 Doc: Use Qt Design System colors also in help CSS
- Replace colors in offline-dark.css
- Do not use the note and attention icons in offline templates

Task-number: QTBUG-133761
Pick-to: 6.9.0 6.8
Change-Id: I55e81d6c3887764542e23c8f85f4d46e273b3885
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit c770015876390de0cc9c77a3d5b123637204b92c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-04 17:08:33 +00:00
Kai Uwe Broulik
2a1a34307d QCssParser: Add missing palette roles
Qt CSS allows to read palette colors by using "palette(role)" but
the supported roles haven't been updated since at least Qt 5.12,
therefore placeholder-text and accent are not recognized.

An "accent-color" property has been added to *set* the accent
color on an object when it was introduced but it wasn't possible
to *read* the accent color, even though it was documented to work.

For sake of completeness, add tooltip-base and tooltip-text as well.

Also amend the comment in QPalette to mention QCss and add a
static_assert so this doesn't happen again.

Pick-to: 6.9.0 6.8
Change-Id: I59ed09dc91fa18ca0356857c8ddb43946b309035
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 9194366923e409243617c34b640e82b54a2e7e05)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-04 17:08:33 +00:00
David Faure
149be782bb QSortFilterProxyModel: don't call index(row, 0) if there are no columns
This is invalid, e.g. it asserts in
QConcatenateTablesProxyModel::index()

Fixes: QTBUG-134210
Change-Id: I21acad9497d423b0366991296e8dd498d51395ea
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 93694e99c214a5166fc842f92659e42260230dce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-04 12:11:00 +00:00
Christian Ehrlicher
4003ca0d32 QStyleSheetStyle: fix CT_MenuItem with custom font
When a menu has a custom font size set, the size was adjusted to reflect
this *after* the additional widths for icon or checkmark was added.
When the used font is larger, the additional width added for the icon or
checkmark will not be honored then.
Therefore the size with the new font has to be added before adding the
size for the icon/checkmark.

Pick-to: 6.8
Fixes: QTBUG-115356
Change-Id: I33e83022bea9e3a531ac8e1651d8655076d88b4b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5436c4a363aa856180ce2949c2f5eeed451abfa9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-04 07:59:04 +00:00
Christian Ehrlicher
b338217360 QWidget: Don't offset the clip region for windows using effects
When a top-level widget has a graphic effect applied,
QWidgetPrivate::clipToEffectiveMask() must not use the parent widget for
the mask calculation as this prevents the loop below from bailing out in
the first loop (w->isWindow()) and might mess up the clip region when
there is a widget with a mask in the parent chain.

Pick-to: 6.8
Fixes: QTBUG-131893
Change-Id: I5d5777e730bee309db21ad5eb65387d19321ee6c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 49f462b7f873ecba6bb205697338a4f1eef6d307)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-04 07:59:02 +00:00
Christian Ehrlicher
351357c3a0 QCssParser: don't allow negative values for cuts in border-image
The spec does not allow this and qDrawBorderPixmap can not handle it.

Pick-to: 6.8 6.5
Fixes: QTBUG-107904
Change-Id: I5873dec2312865fb96ccccd3cc2292c6b9e1d4f0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 254fc6a9782b29180cd545e18c34bcaf4cc03a7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-04 07:59:00 +00:00
Assam Boudjelthia
b172090299 Android: fix uncompressed libs loading from split APKs
When split APKs, when an AAB is used for example, the native libraries
are kept in a separate APK and not under the main app APK, thus, we
need to use that instead to get the path of the native libs otherwise
the app would crash failing to load Qt libraries.

Amends 0db5b424cdaede8724886e8a1eda1380382d9aaf.

Pick-to: 6.9.0
Fixes: QTBUG-134101
Change-Id: I930ba005aaefc15e4500b7290167892dc2428066
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 75367d1cfe564953d980b0c6917257f8ec0faa93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-04 01:22:25 +00:00
Milian Wolff
0437f1925b 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

Pick-to: 6.8
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>
2025-03-04 01:22:25 +00:00
Milian Wolff
22e66638a6 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.

Pick-to: 6.8
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>
2025-03-04 01:22:25 +00:00
Milian Wolff
9cba61e5eb 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.8 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>
2025-03-04 01:22:25 +00:00
Marc Mutz
5ad97482a9 QWidget: DRY the ctors, use ctor delegation
Don't repeat the body in the two QWidgets ctors, call one from the
other instead.

This will help fighting Coverity's hallucination that QWidget::data is
used uninitialized, or, after 58b9250aea0b1b41c8cbd1033149371a93a5b2c1,
dereferenced while it's still nullptr.

Coverity-Id: 475552
Coverity-Id: 475551
Coverity-Id: 475550
Coverity-Id: 475549
Coverity-Id: 396828
Pick-to: 6.8 6.5
Change-Id: I1f9a8b93871143b420b9c8f247e49d57510a2379
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 66268742861c3eb9b3d97c2758a1babbae850e1f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-04 01:22:24 +00:00
Thiago Macieira
de3cf05b77 QUrl: decode square brackets in fromLocalFile()
QUrl has an intentional deviation from RFC 3986 when it comes to those
characters, matching the behavior of major browsers: we distinguish the
forms '[' and ']' from their encoded forms. However, for local files,
they are definitely identical, because there's no such thing as a
percent-encoded file names.

[ChangeLog][QtCore][QUrl] QUrl::fromLocalFile() will now decode the
square bracket characters '[' and ']' to their percent-encoded forms.
This will be visible in calls to toString(), toEncoded(), or the encoded
form of path(). QUrl's comparison operator will consider the old
(created from an encoded URL string) and new forms to be different.

Pick-to: 6.8
Fixes: QTBUG-134073
Change-Id: I9eae083007103e34f73cfffd59a618069eba0e19
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 5e936b60fc921e21b8153a83113886a1de333b57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-04 01:22:24 +00:00
Christian Ehrlicher
9433e8b68d Style: pass widget to styleHint() where appropriate
QStyle::styleHint() take the QWidget as optional third parameter. Add
this to calls to styleHint() where appropriate.

Task-number: QTBUG-2501
Pick-to: 6.8
Change-Id: I95b85d51ce98540920243b37473b97426eb40ab4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6f813bcb441ee195d88cc9fd39921bc4b5fa0192)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-03 19:10:50 +00:00
Christian Ehrlicher
bea6b0e944 Style: pass widget to styleHint() where appropriate
QStyle::styleHint() take the QWidget as optional third parameter. Add
this to calls to styleHint() where appropriate.

Task-number: QTBUG-2501
Pick-to: 6.8
Change-Id: I62aa251f7dd9d78178ea8aefc1e2882d3ac040be
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5b320c146b2d67bb9bec92d647ec7fb5ae6b601d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-03 19:10:48 +00:00
Thiago Macieira
6deb5098a1 tst_QUrl: improve toNSURL()/toCFURL() tests
This extends the test with a few more rows, and with delimiters that the
Apple APIs seem to encode differently. Rather, it's QUrl that deviates
slightly from the standard: we keep the delimiters unchanged,
regardless, like browsers do.

Task-number: QTBUG-134073
Pick-to: 6.8 6.5
Change-Id: I20a7b66a9959b17597cffffdf3652b9167d00d07
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 31753e722cd441de371be8f1e11b3bf089b187e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-03 17:24:57 +00:00
Alexandru Croitor
ee8cd91279 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.

Pick-to: 6.8
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>
2025-03-03 16:31:28 +00:00
Cristian Le
192d87010a Unit test qt_internal_add_compiler_dependent_flags
Pick-to: 6.8
Change-Id: I12e476e1d7e36492811d2becf58e13923b443caf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e070742ab5e122fbde3ced017709e940a92a6a46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-03 15:34:11 +00:00
Cristian Le
cdb34e0486 Add qt_internal_add_compiler_dependent_flags helper
Helper function that groups together compiler specific options and conditions

Pick-to: 6.8
Change-Id: Ibec52a19852ad528007f50316a52d2f867b5fe37
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 167b38712d2d8157393e0753f11c6c41b1740de5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-03 15:34:05 +00:00
Konsta Alajärvi
9239e7cdef Unblacklist tst_qrhi renderToTextureArray
Try to unblacklist renderToTextureArray test on android

Fixes: QTQAINFRA-6334
Pick-to: 6.8
Change-Id: I59c914b66645dc30e7f1a34f9aefc7fb66e95a67
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit a34b5d60e010a0dfd451b1d6fff6798bdedc61b4)
2025-03-03 11:45:55 +00:00
Christian Strømme
a234b472d7 visionOS: Change how the initial immersion style is set
Set the initial style to be automatic, that's the default. With this
change we also get rid of the warnings shown on application startup
complaining about the application not defining an initial immersion
style:
"Since your app does not define an initial immersion style in its
Application Scene Manifest, the default immersion style will be
applied. This does not match the immersion style defined at runtime
'full'. To make sure your app's state matches its runtime behavior
define an initial immersion style."

Change-Id: I1b8bba5f919b72d4f2507a19a30de49e8bfcd708
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 08146377db8ce782bac5b9561338ba20f7101ac5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-02 16:15:11 +00:00
Axel Spoerl
8633c8e446 tst_QScroller::overshoot(): improve diagnostic output, blacklist on mac
Test is flaky on macOS.
Use QCOMPARE_LT instead of QVERIFY(a < b).
Blacklist on macOS.

Task-number: QTBUG-134105
Pick-to: 6.8
Change-Id: I8f1274ad67bd9ead392ecd0f9c9b7a01dc3edb1e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 7c7731a8229a44050c02d33c7111e4d522909c1d)
2025-03-02 17:15:04 +01:00
Thomas Moerschell
ce7cf1a8b1 QScroller: Fix no overshoot behavior
Correct previously mixed up parameters to pushSegment(). stopProgress
can be set to 1 so stopPos is the only terminating condition.

Pick-to: 6.8
Change-Id: If590555ed08170800b67063aa10e853411180aa3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 84e09e060bedd37d8de7cded7e430371e335c029)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-02 17:15:02 +01:00
Marc Mutz
bcdd7c260b Long live \constraints!
We have divergence in the way we document function, operator and
constructor constraints. About half use \note, while the other
doesn't. Some say "if and only if" while others say just "participates
only if".

So add a qdoc macro, \constraints, to semantically mark up these
constraints. It expands to a section titled `Constraints`, and
uses a predefined sentence (prefix) for constraints.

Documentation for constraints is moved to the end of the comment
blocks to separate them from the rest of the text.

Apply them to all the standard-ish constraint documentation blocks
(grepped for "participate"). I didn't look for other, one-off, ways
documentation authors may have documented constraints, but I'm also
not aware of any.

Re-wrap lines only if the result fits into a single line.

As a drive-by, drop additional "if"s, as in "only if X and -if- Y" to
make the texts work with the `Constraints` section.

Fixes: QTBUG-106871
Pick-to: 6.8 6.5
Change-Id: I18c2f9f734474017264e49165389f8c9c7f34030
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b7a67b46e66f161def5bf879f19c66d3fcec1d8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-02 07:10:48 +00:00
Andreas Eliasson
f87929371a Doc: Improve deprecation description for QApplication::fontMetrics()
Add a link to QFontMetrics, which provides more information about the
differences between QFontMetrics and QFontMetricsF and why the latter
is the preferred choice.

Fixes: QTBUG-127528
Pick-to: 6.8 6.5 6.2
Change-Id: Ib5713a9d39bf312a6eae6b8b1a6d1dc1d47e25be
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit bdf453afd7613d3e88099defb759444537527195)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-02 07:10:47 +00:00
Vladislav Tarakanov
593f69a861 QCupsPrintEnginePrivate: Use "true" for "landscape" option
CUPS treats the "landscape" option as a boolean value
(IPP_TAG_BOOLEAN). In this case, all values ​​other than "true", "on" and
"yes" are considered as false. As a result, using an empty string as the
value for the "landscape" option results in the print area still being
portrait.

Currently, the problem with printing landscape images (png, jpeg, etc.)
in Qt programs (e.g. Okular, Gwenview) occurs on Fedora 41 and other
distributions using cups-filters v2.0+.

The patch adds passing the value "true" instead of an empty string for
the "landscape" option, as CUPS expects for changing the orientation.

Pick-to: 6.8
Change-Id: Ib7ad1e2debcfff10e673757c97ef5614fb59a6ca
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit a77173486aaf9d2e4107f6e1120ac2316ae1c96f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-02 07:10:47 +00:00
Nicholas Bennett
f5de04d9c4 Docs: Create \Q4A macro for "Qt for Android" and replace instances
"Android" is trademarked and needs to be referenced in a certain way.
The following steps were taken:
-Created qdoc macro.
-Updated "Qt Android" and "Qt for Android" to use \Q4A in qdoc files.

The macro will need to be adopted in all documentation projects.

Task-number: QAA-2836
Pick-to: 6.8 6.5
Change-Id: I4b52247a4ed52047242a06404e6d3aa19de9c16c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9c6c6d7d388bee01ea4e5ea102d3b0ed359c3f00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-02 07:10:47 +00:00
Eskil Abrahamsen Blomfeldt
1a4e2e869f Update Harfbuzz to version 10.3.0
[ChangeLog][Third-Party Code] Upgraded Harfbuzz to version
10.3.0.

Pick-to: 6.8 6.5 5.15
Change-Id: I3a4daaa9c0747c4f4717ac8f0f9e7baf9a9a449e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 82a3357d007837b1d54dcf6dd6309363649d186f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-02 07:10:47 +00:00
Thiago Macieira
0777144b45 QColorDialogOptions: delete QSettings code and stop saving globally
[ChangeLog][QtGui][QColorDialogOptions] The class no longer
automatically saves settings such as the custom colors to a global
QSettings("QtProject") shared by all applications and no longer restores
custom colors from there. Applications that wish to retain the custom
color settings should use customColors() and setCustomColor() with their
own settings files.

Task-number: QTBUG-133805
Change-Id: I49cd7312054f41ca4cdbfffdcb60d6ea242393fc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9a753fa656a9bcae4193ceb38cfaf6e21641ddc2)
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2025-03-02 00:46:01 -03:00
Milian Wolff
cc6074c543 Add maybe_unused in benchmark to guard against nodiscard in the future
Requested by Marc Mutz when adding the utc() benchmark.

Pick-to: 6.8 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>
2025-03-01 23:45:17 +00:00
Milian Wolff
c4618d6020 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.8 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>
2025-03-01 23:45:17 +00:00
Marc Mutz
8e2c6a5904 tst_QByteArray: check replace() doesn't replace the terminating \0
It doesn't.

Pick-to: 6.8 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)
2025-03-01 21:02:09 +01:00
Marc Mutz
c653cf1171 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.8 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>
2025-03-01 20:02:02 +00:00
Alexandru Croitor
dcb72b5315 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.

Pick-to: 6.8
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>
2025-03-01 18:26:19 +00:00
Alexandru Croitor
2769ef7174 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.

Pick-to: 6.8
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>
2025-03-01 18:26:16 +00:00
Giuseppe D'Angelo
35c18eba64 QColorTransferGeneric: fix the BT.2100 PQ EOTF
The PQ EOTF formula for BT.2100 [1][2] was incorrect. Fix it; while at
it, rename the variables to match the symbols used in the original
formula.

The inverse EOTF was correct, but also rename the variables there (for
the same reason).

[1] https://www.itu.int/rec/R-REC-BT.2100-2-201807-I/en
[2] https://en.wikipedia.org/wiki/Perceptual_quantizer#Technical_details

Change-Id: I6ce3a609824bee82053a16b3ff3cfc7cb396ce8f
Pick-to: 6.8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a7ff4679facb9a44dff8b63a7e461ababa6aedfb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-03-01 11:57:55 +00:00
Ulf Hermann
b9169c1210 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.8 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>
2025-02-28 23:15:07 +00:00
Eirik Aavitsland
8159f4626b 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.

Pick-to: 6.8
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>
2025-02-28 20:05:00 +00:00
Laszlo Agocs
e71708a6e5 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
Pick-to: 6.8
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>
2025-02-28 12:12:05 +00:00
Marc Mutz
d561d864eb 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.8 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>
2025-02-28 10:50:03 +00:00
Jani Heikkinen
b0e9665e7d Revert "Revert "Android: update to Gradle 8.12 and AGP 8.8.0""
This reverts commit 22f33e1bd2c43e0223cd52b94e6ecead56a2e1b5.

Reason for revert: Needed provisioning changes are now in

Change-Id: Ibc1d1833942394efec0c24dc7e7a3e6ada5b8eea
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2025-02-28 10:04:46 +00:00
Alexandru Croitor
37c60080dd 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.

Pick-to: 6.8
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>
2025-02-27 19:19:48 +00:00