Commit Graph

71663 Commits

Author SHA1 Message Date
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 1b1ae34502.

Change-Id: Iea88d466883562b0130639d7c0f2f3b984acdbc2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fb1824a9d6)
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 39e7946cb6)
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 2dd0c4520f)
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 2fb134f3fe

Pick-to: 6.8
Change-Id: I46eb4c3b769ae6b063fe62df05c0cb92f13bda30
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit fdb9a51414)
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 2433d02856)
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 aef789ad97)
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 8b75f4735b)
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 0770171dcd)
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 e84145d6c1)
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 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.8 6.5
Change-Id: I5e7da2323e66a6e8bfd653dfebcba4363023b744
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 71246cbdc6)
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 f9a05c7cae)
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 408959c8c8)
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 be0f1af3f1 ("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 00f3ca950a)
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 4a4c425291)
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 bc06c7c61a)
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 073fae097c 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 f846754663)
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 f7e1123620

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I050decece1c6d9e6e0e06547043f864d6f497ea7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit a28a9e194c)
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 f1ac316191

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I1884f53ee7d30a25b873d85ee04b8c8d1e0532f5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit fd622bc3ae)
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 f1ac316191

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: If5dd77672306c520404b294a6b5bde4f0e6ab8bc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit e7cdf9d438)
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 a55db2cbee)
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 5be7a9773e)
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 358b7a9e74.

Pick-to: 6.8 6.5
Change-Id: I162d72de7097a1257c8a0a01b69c36fc87466114
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 2831ce613f)
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 60af93847e)
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 9d23aebb27.

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 b93575de01)
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 fff217824b.

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 5cd046f154)
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 4308ab70ca)
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 c9c8abb52d)
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 a47dc99079)
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 5971e94baf)
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 9dc8bc80de)
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 442e2f4aeb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-21 00:03:29 +00:00
Tor Arne Vestbø 9fbb8e0090 iOS: Set LD_ENTRY_POINT for generated Xcode project
We normally override the entrypoint to _qt_main_wrapper via the -e flag
to the linker, but if a Swift file is added to the Xcode project, Xcode
does some magic, building the app as a shared library, and wrapping it
with the Swift code into a custom executable. The -e flag will then be
a noop when linking our shared library.

To work around this we set the custom LD_ENTRY_POINT Xcode build setting,
which triggers Xcode to pass -e when linking the wrapper-executable.

This works in practice, but produces a warning on the console that the
entrypoint is not found, which has been reported as FB16519113.

Fixes: QTBUG-133577
Pick-to: 6.8
Change-Id: I9d8310b39ac5a4900693df55c2e5bfa346c0300a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 430ba7c0f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-20 19:11:47 +00:00
Wladimir Leuschner 4488dfcbf6 QWindows11Style: Add horizontal offset for Qt::AlignVCenter Labels
The progressbar label overlaps with the progressbar grove, when
vertically centered aligned. This patch adds a y offset to the
label, in case it is vertically centered to avoid the overlap.

Fixes: QTBUG-128458
Pick-to: 6.8
Change-Id: Iac977f83f09c2e4d12d1e0ed5f0eab3120c07b96
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 564633f9d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-20 17:36:15 +00:00
Eirik Aavitsland 87e53579ea Windows: Fix rounding error in BitmapInfoHeader calculation
A potential rounding error in calculating the padded scanline length
could lead to the biSizeImage field being assigned a too small value.

Fixes: QTBUG-133782
Pick-to: 6.8 6.5
Change-Id: I251212cf2859f7268fc8ad6ca1cbc57f2bb1f1c0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 3d389ee2ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-20 17:01:13 +00:00
Alexandru Croitor 9491249fc6 CMake: Avoid warnings _qt_internal_sbom_replace_qa_placeholders
We should only pass the VERSION option if we have a value to pass.

Fixes warnings like the one below when using CMake 3.31:

CMake Warning (dev) at cmake/QtPublicSbomAttributionHelpers.cmake:511
(cmake_parse_arguments):
  The VERSION keyword was followed by an empty string or no value at
  all.
  Policy CMP0174 is not set, so cmake_parse_arguments() will unset the
  arg_VERSION variable rather than setting it to an empty string.
Call Stack (most recent call first):
  cmake/QtPublicSbomHelpers.cmake:954
  (_qt_internal_sbom_replace_qa_placeholders)

Amends bc3bbb51b7

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I671a9153d72b21b6aed2112bea45f577a5cee4eb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4174f388e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-20 17:01:11 +00:00
Mate Barany 5581c62922 Do not keep the headers and message body in case of temporary redirect
The implementation of GET requests with body (QTBUG-112871) keeps the
body after it has been redirected. However, in case of temporary
redirect (status code 307) this seems to be an incorrect behavior.

Reset the headers and the body in case of temporary redirect.

Pick-to: 6.8
Change-Id: I10be702b017a42cca27a37dfe2249da2f59c0328
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f6a5c7e011)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-20 15:12:31 +00:00
Eskil Abrahamsen Blomfeldt e7562a50b9 Accept multiple fonts with the same family and style name
When the style name is included in the request to
QtFontFoundry::style(), then it will ignore the other properties
and just return the hit that matches it. This is because we want
the style name to take precedence over all other properties when
the user specifies it in a request.

However, we were using the same function to check if a specific
font already exists. If we are registering a font and it is
already in the database, we want it to replace the existing one.
But for fonts such as the variable "Noto Sans Display" there would
actually be multiple styles in the family that were called the
same ("Regular") but had very different properties.

Due to how fonts are populated on GDI, this issue did not occur
there, so the issue is perceived as a regression in Qt 6.8 when
we switched to DirectWrite as the default backend.

We fix this by ignoring the style name when checking if the font
already exists and instead prioritizing the specific properties
it has. If multiple different styles with the same name exists,
they will all be registered.

Note that it will not be possible to differentiate between the fonts
using the style name, same as before, but you will now at least
be able to select the different styles by specifying properties
such as weight.

[ChangeLog][QtGui][Fonts] Fixed an issue with font families where
only the last of multiple sub-families sharing the same name would
be registered.

Pick-to: 6.8
Fixes: QTBUG-131574
Change-Id: I86a04547065c2d9ef88d9a761af95af33eb9b3d6
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 1d6f71779f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-20 13:18:05 +00:00
Eskil Abrahamsen Blomfeldt 333a08c98f Fix divide by zero when opening font on invalid image
If you open a QFont on an invalid image, its dpi will be 0. In
other places we check for this before calculating the point
size, but this was missing in one spot, causing divide by
zero.

This would happen e.g. in the tst_QFontMetrics::same() test.
While it would pass normally, running this with an undefined sanitizer build would warn about the division by zero.

There's nothing useful we can do with the fonts on the invalid
image, so like in the other places, we just leave the point size
as is when this happens.

Pick-to: 6.8 6.5 5.15
Change-Id: I4769e23e2b4dbb92f675cb8a77f8554c90bc2afd
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit c136de2deb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-20 08:27:14 +00:00
Thiago Macieira c1bb08ab26 QVariant: don't use the static CanUseInternalSpace with existing objects
It's possible for the QVariant to have been created by an older or newer
build of the library in question in which the type in question was
relocatable but has ceased to be, or wasn't relocatable but now is.

[ChangeLog][QtCore][QVariant] Fixed a bug where QVariant could misbehave
regarding types that changed from non-relocatable to relocatable (or
vice-versa) and not all uses of it were recompiled. To benefit from this
fix, applications must be recompiled, but they will be safe going
forward.

Pick-to: 6.8
Change-Id: I222806b3804df6272abdfffd45f96312d23be1af
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit eb87b0444a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-19 21:55:14 +00:00
Jani Heikkinen 22f33e1bd2 Revert "Android: update to Gradle 8.12 and AGP 8.8.0"
This reverts commit e60b493c2e.

Reason for revert: temporarily revert it to pass submodule
update round.

Change-Id: I63e8cf78c93d84add4aaaee388b01f2c15cca312
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
2025-02-19 18:52:16 +00:00
Eric Beuque dcf09c0c63 Fix bad signal restoration which can cause infinite loop
This fix the FatalSignalHandler destructor to restore properly the
signal handler which cause an infinite loop when a signal is emitted
like SIGABRT or SIGINT and when we are using two QTest object in same
program.

Fixes: QTBUG-132121
Pick-to: 6.8 6.5
Change-Id: Ie9476e1ff9c0f29c3e35ae6dff565fab4a77ba86
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 50d1a22e5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-19 18:14:09 +00:00
David Boddie 73e9605765 doc: Remove link to missing showShaded() function
Pick-to: 6.8
Change-Id: I8a70558521a6829e0bd99f03a7aa695681061945
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit c08ca6ff02)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-19 17:14:17 +00:00
Wladimir Leuschner 7cab94a4c8 QWindows11Style: Use Highlight color for ItemView with alternating rows
When using alternating rows in ItemViews, the currently selected item is
hard to distinguish from the background colors. This patch uses for
ItemViews with alternating row colors the highlight color for the
selected and hovered item.

Fixes: QTBUG-133118
Pick-to: 6.8
Change-Id: Ib5dbe0f58d5970c41cc9d14cf2188a7e5b1abd1a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit c3d2a4972c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-19 17:14:16 +00:00
Edward Welbourne 320a3b1328 Avoid returning null from find{Next,Prev}InOrder(non-null)
The checkNode(p) call relies on p being non-null, so CodeChecker
grumbled. In any case, we should be returning node_impl if we fall off
the end of the structure (which shouldn't be possible, since we
descended into the three and can't come back out on the way up without
passing through node_impl, for which we check). Include a null-check
in checkNode(), save the nsURI.isNull() check when !p->isElement()
makes it redundant and fix some coding style nits while I'm about it.

Amends commit 8609982791

Coverity-Id: 474724
Coverity-Id: 474725
Coverity-Id: 474726
Change-Id: Id622a91d2e443276756e50729cf155b10f7164a1
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit 82ae262de2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-19 17:04:00 +00:00
Edward Welbourne 05b91b1195 Fix UB in QTextStreamPrivate::putNumber()
Negating a negative value may attempt to negate the minimal value for
the signed type, whose only set bit is its sign; this is UB. So don't
do that. Since the non-decimal branch of the code just prepends
locale.negativeSign(), and we're passing -1 as width parameter to the
QLocalePrivate formatters (so there's no zero-padding, whose size
would be reduced to make space for a sign), we can treat decimal the
same as all other bases. This, furthermore, simplifies the code.

In the process, I noticed (because a test only done for decimal
failed) that if QTextStream::ForceSign is set, this code-path for
negatives would prepend the minus sign before a plus sign supplied by
QLocaleData. Skip the flag to include sign, for negative input, since
we'll be including a negative sign anyway. Remove the QEXPECT_FAIL()
from the test I've added for this in a preparatory commit.

Purge one now-redundant comment and revise some others. Expand on why
we need to hack octal zero to display two zeros. Add a second test row
to keep the lonely zero-row company in the test for that.

Fixes: QTBUG-133269
Pick-to: 6.8 6.5 5.15
Change-Id: I35c9bdf34b812cff578de9b0a2570a60e6145c80
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 44ddb34da0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-19 17:03:58 +00:00
Marc Mutz 4372292136 QBenchmarkPerfEvents: help Coverity understand the code
Coverity thinks that r may be negative and not -1 and warns that the
cast to quint64 may overflow.

Change the check for `== -1` to `< 0` to help Coverity (and other
readers of the code) understand that this cannot happen.

Amends c63420a117.

Pick-to: 6.8 6.5 6.2 5.15
Coverity-Id: 474172
Change-Id: I7615e0ef152e1e6e9cbc6dec1b8ecd4f8879521c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 24a26ed3a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-19 16:45:02 +00:00
Marc Mutz 173eebbd96 tst_QLocale: actually check formattedDataSize() with qint64
... not just int, and not just non-negative values.

Reveals a problem with bytes == numeric_limit<qint64>::min(), says
ubsan (example; all min64 fail):

    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 exclude that from testing, for now.

Pick-to: 6.8 6.5 6.2 5.15
Coverity-Id: 474294
Change-Id: Ia1f8e87c58a9fdc2668b6745956e913384cff4c7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 562cb8e4d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-19 16:44:55 +00:00
Cristian Le aa0e38c607 Fix: Use `_qt_internal_set_source_file_generated`
`SKIP_AUTOGEN` was a bit too zealous.
Hotfix for 6865c21e41

Fixes: QTBUG-133850
Change-Id: I6ec984a7a5d8eefb56e53a0f56c4f4384a56e0ae
Reviewed-by: Nicolas Fella <nicolas.fella@kdab.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 97517b20aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-19 16:44:53 +00:00
Marc Mutz 76783a4487 tst_QCryptographicHashBigData: skip Sha1 tests on ASAN CI builds
The SHA-1 test has started to time out in CI ASAN builds recently, so
skip it there. Keep it on non-CI or non-ASAN builds, though.

Amends c6e092a5f8.

Pick-to: 6.8 6.5 6.2
Change-Id: I8d653c2a8304cfae290befafda570d5c49dd4536
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 929466ba64)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-02-19 14:50:38 +00:00