71897 Commits

Author SHA1 Message Date
Alexandru Croitor
35f2704d20 CMake: Improve atmoicfptr error message on failure
Remove the obsolete reference to the atomicfptr directory in the error
message.

With the improved error reporting of the parent change, the build
system will now dump the output of the atomicfptr test in case of
failure, which should provide more information about what goes wrong.

Pick-to: 6.8
Fixes: QTBUG-133687
Change-Id: Iaffc992f90c06425113cc2ef721d87d31e97bbc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 86d843be47d04ca2d5c2ab1f052cd2a822a2979c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 88c7f0250ae26270116a7a54ed86860856d99ca8)
2025-06-04 22:25:50 +00:00
Alexandru Croitor
fe450e7752 CMake: Fix capturing of x86intrin compile test output
TEST_x86intrin_OUTPUT is not set anymore since we lazily evaluate
compile tests after 605913f9d7a60461939c1a8fb8dac05054cade2d .

Use the new qt_configure_add_report_entry
COMPILE_TESTS_TO_SHOW_ON_ERROR option to dump the test values in case
of an error.

Amends 9e9099865a0881ac5bb6035237e0a0c86962c45f

Pick-to: 6.8
Task-number: QTBUG-122596
Change-Id: I48d1c57145ad5d9418631025927581c4eb5ec93c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5220685a11afcc02ae92e7fdd17c9efc72975e83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2ee633a17af572ec54265f922c342fc759ecac56)
2025-06-04 22:25:44 +00:00
Christian Ehrlicher
4b36d09aab SQL/MySQL: add option MYSQL_OPT_SSL_VERIFY_SERVER_CERT
Add option MYSQL_OPT_SSL_VERIFY_SERVER_CERT to disable ssl for MySQL
5.7.x and MariaDB. This is needed as MariaDB does not support the
SSL_MODE options but defaults to ssl nowadays.
Also enhance the documentation for MYSQL_OPT_TLS_VERSION and
MYSQL_OPT_SSL_MODE by providing the needed MySQL/MariaDB versions for
those options.

Pick-to: 6.8
Fixes: QTBUG-136550
Change-Id: If570cf8e92d0df7c9e2c4d0e009857eaf33f4f2d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a66dbb19e6915d8bb560ac2bbfe64eb6850f7bbb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b01b4b1e409bf9f9c170f73ec5d4bc91e8e34039)
2025-06-04 22:25:43 +00:00
Eirik Aavitsland
7de9b172a2 Doc: Explicitly advise adding svg, if any, before other files to QIcon
Adding in the wrong order yields a QIcon that does not provide the
expected or desired behavior.

Fixes: QTBUG-135652
Pick-to: 6.8
Change-Id: Ie1f6e50ee82ddaae8857b076c383ede20ab872df
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 472306523a9706ccf363c349edecccaadacfe5b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fe7a4b7bf85d1a47b8b22d7a0c60130f4e602802)
2025-06-04 22:25:42 +00:00
Edward Welbourne
ab961b4523 Fix typo in qlocale_tools_p.h unicodeForDigit() comment
Got the name of the numeric tokenizer helper wrong, making the
cross-reference comment misleading.

Pick-to: 6.8
Change-Id: I88b850975aa77b6175e8d95afa2960e589c42d8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 65365e9bb796c9921441bdb20655cf8224ee1b8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e359fc7ec5689501240f5d14773ef8c1b07f32c3)
2025-06-04 22:25:41 +00:00
Edward Welbourne
fc87d35926 Update QJsonValue(qint64) docs to reflect full precision
Amends commit 35adb74ddd915831789f0175423660f8e898942e (from 5.15) to
reflect the improved precision of 64-bit int when stored as a JSON
value.

Task-number: QTBUG-28560
Pick-to: 6.8 6.5
Change-Id: I07915bc190dd7696e58356143e8857f91e888c67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9be6e51a501dfbee1c058616b9e81b1731640e3e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ad55e57c6e4c52e58dea87373de00e71588a49c0)
2025-06-04 22:25:40 +00:00
Thiago Macieira
777019525e QFileSystemEngine::tempPath: simplify handling of fallbacks
If the environment variable is empty, we have a couple of fallbacks, one
for Apple Darwin systems and one for everyone else. A non-absolute path
in the environment or the Apple API makes no sense, but this code
retains this defensive measure for them; for _PATH_TMP from <paths.h>,
we assume it is absolute.

Change-Id: I3e486f73276a3ae288d1fffdbfe20a74271f73f2
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit ae973dc2de5ce3b5a7d18018691479013d91053d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 17f5cdd39ed8a6e9cf25e99003478adfef572485)
2025-06-04 22:25:39 +00:00
Nils Petter Skålerud
e7216042c4 QScreen, iOS: Make grabWindow() use UIGraphicsImageRenderer
Currently the QIOSScreen::grabWindow implementaton relies on
UIGraphicsBeginImageContextWithOptions to do a screenshot. This API
is deprecated and produces a few warnings logs that we can't silence
even when we handle the errors. The current approach also has a memory
leak when taking screenshots in rapid succession (i.e 60 FPS).

This patch modifies grabWindow() to use UIGraphicsImageRenderer, which
replaces the deprecated API. This no longer produces warning logs when
errors are handled. This API can be used in the future to let us take
HDR screenshots once Qt has support for this. This patch solves the
mentioned memory leak.

Pick-to: 6.8
Change-Id: Ifbc8503482886246ce9611d0b7a19462fc830ecd
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
(cherry picked from commit cb09be1512e5f932af1744773a7638f23ebd57f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3f42b65818f502f73814fd1f04081dfed44d4018)
2025-06-04 22:25:38 +00:00
Alexandru Croitor
d5b3018c1b CMake: Improve compile test error reporting in configure summary
Starting with 605913f9d7a60461939c1a8fb8dac05054cade2d we run
configure.cmake compile tests lazily during feature evaluation.

This means that qt_config_compile_test() calls will no longer set
TEST_foo_OUTPUT variables in the scope of configure.cmake files and
thus the build output of compile tests is no longer available for
configure summary error reports.

Instead of setting the output variable in the caller scope, save the
output in a global property.

Then, when we add error reports that mention compile tests either in
CONDITION or in a newly introduced COMPILE_TESTS_TO_SHOW_ON_ERROR
option, dump those outputs in the error report.

We continue to set the output in the parent scope, in case if
qt_run_config_compile_test is called manually.

Amends 3334a77ecfb792fba0144e99887f11cd0fa2506d
Amends 605913f9d7a60461939c1a8fb8dac05054cade2d

Pick-to: 6.8
Fixes: QTBUG-137198
Change-Id: Idc0470556a053123286983c44063e17b7eb9949d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit a20a40095a0d699ea07981845a190b90dc4830e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c39a3edb50c4d00adc7df7c90c8400bc715eb04f)
2025-06-04 22:25:36 +00:00
Marc Mutz
af0dfa4cd7 Explain what "junk" means in tst_QDataStream::status_QBitArray_data()
It means the data contains bits outside the [0, size()[ range.

Found while debugging why these data rows fail in the 5.15 cherry-pick
of 78f8dfc5427457783ceef7d85885cddbec035ebe.

Amends the start of the public history.

Pick-to: 6.8 6.5 5.15
Change-Id: Ic21d15da25944d4897357dd27e2986d448b5ee60
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit c485c07c6d7e29eae5e633adb9429e293f63b63b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8ff03d14cc70f4f480618e78916213b8d8a3e2cb)
2025-06-04 22:25:36 +00:00
Christian Ehrlicher
96f9151e4a QStyleSheetStyle: avoid creating QString
Don't create a QString when comparing the strings from
knownPseudoElements - a QLatin1StringView is enough.

Change-Id: I69e207bac0fb3d3df12ae9d4bebc9cd30cde30de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 15c2ec5344fb8a1e5d4a8e93d410c54563fb86b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fe777849c95ca66bdfe29e65016669e349909e49)
2025-06-04 22:25:34 +00:00
Christian Ehrlicher
9d3390eb5d SQLite: Update SQLite to v3.50.0
[ChangeLog][Third-Party Code] Updated SQLite to v3.50.0

Pick-to: 6.8 6.5 5.15
Change-Id: I20eef45bbb93ae3a50cdd7ffecaa53eec18823f7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit cc6d78325b021c7b03ffb1aa90083261831f58f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 728daaf384e98c743a02f450b2a351413c7e73c5)
2025-06-04 22:25:34 +00:00
Lars Schmertmann
90c6413d24 Android: Bump androix dependency to 1.16.0
The Android target API level was bumped to 35 in
997a1fae98d35cd0d4d16f37ab68afe2729ff551 so we can
bumb the version of the androidx dependency too.

Pick-to: 6.8
Change-Id: I30d561cc0b74645c939e7d3dd595926b6013caf9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 36b5854af53650132738cd950a220b45669ae5bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5ded95d6590e79f4a665194a9ed1224fab2ecb58)
2025-06-04 22:25:31 +00:00
Toni Saario
9dcc6bf3d1 Coin: Sign cross-compiled Windows binaries
Pick-to: 6.8
Task-number: QTBUG-137228
Change-Id: Idda7bfd97ac74a87987dcd4c31440b0c2f193c14
Reviewed-by: Simo Fält <simo.falt@qt.io>
(cherry picked from commit 3056da6711933d035be14394d6ea9fe72c1aabe9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a66e8de68c14edbc60e8e742c3692339a9f23e7e)
2025-06-04 22:25:30 +00:00
Thiago Macieira
81bc95704d QFileSystemEngine::tempPath: bypass QDir and go straight to QFSEngine
Temporary paths coming from the environment must be real filesystem
things, never a Qt file engine, so we don't need to create QDir with its
QDirPrivate, in order to call QFileSystemEngine.

The replacing of canonicalPath() with QFSE::absoluteName() is fine
because canonicalizing *after* cleanPath() is the wrong thing. For
example, if you had:

  $ ln -s $HOME/tmp /tmp/symlink
  $ TMPDIR=/tmp/symlink/..
then
  cleanPath($TMPDIR) = /tmp
  absolute($TMPDIR) = /tmp    # QFSE::absoluteName calls cleanPath
  canonical($TMPDIR) = $HOME
  canonical(cleanPath($TMPDIR)) = /tmp

The lack of canonicalization now only affects when the final path is a
symlink. Doing so bought us little security if it is a symlink and it
could change, because the result is not cached and could change from
call to call. That changing is probably worse than any attack, because
you could end up with

  QDir::tempPath() != QDir::tempPath()

[ChangeLog][QtCore][QDir] tempPath() may now return a non-canonical
path. This means going up from it (cdUp()) may result in different paths
from string manipulation (adding "/..").

Change-Id: Iddf6f46edf6f3b6c3222fffd1e1e5479f0be92a9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7bd7df5aa170c240061144a9210a13b62949935c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c617cc95934ae3c0896082d61a88487b34cf96be)
2025-06-04 22:25:28 +00:00
Alexandru Croitor
e54bd7213a CMake: Improve error reporting for failed linker no undefined flag
Capture the output of the check_cxx_source_compiles calls in
qt_internal_add_link_flags_no_undefined like we do for
qt_config_compile_test.

Amends 3334a77ecfb792fba0144e99887f11cd0fa2506d

Pick-to: 6.8
Task-number: QTBUG-137198
Change-Id: Ic7dd4eae0ac1af0f8293f2ce285d2987e4e26249
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 7542aaea604907ff69ed03f650421403388b5463)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit f35f45642c96581ebeed06e0dba7451fec36fe26)
2025-06-04 22:25:27 +00:00
Matthias Rauter
cf793190c7 Mark three files in corelib/mimetype as critical
* qmimeprovider.cpp parses file names to identify the Mimetype,
* qmimemagicrule.cpp parses the file to identify its Mimetype.
* qmimeglobpattern.cpp implements a pattern matching algorithm, i.e.
glob parser.

All involve parsing of data that might come from untrusted sources.

QUIP: 23
Task-number: QTBUG-135191
Pick-to: 6.8
Change-Id: I97d4cd8d635f05613d5a979c61038cef9c759989
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 7d163200f9d6f47bce941969869c54369fc26056)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 924b8dd5847664313610d4016c49537538cb28ab)
2025-06-04 11:49:47 +00:00
Michael Weghorn
8e3d160e3f a11y atspi: Support Application iface "AtspiVersion" property
As the AT-SPI XML spec for the Application interface says,
this should currently always be "2.1" [1]:

    <!--
        AtspiVersion: You should return "2.1" here.

        This was intended to be the version of the atspi interfaces
        that the application supports, but atspi will probably move to
        using versioned interface names instead.  Just return "2.1" here.
    -->
    <property name="AtspiVersion" type="s" access="read"/>

This makes the expected value show up in Accerciser with
pending merge request [2] in place instead of triggering a fallback
path in Accerciser handling the null case for Qt applications.

[1] 2d83e3a6df/xml/Application.xml (L19-26)
[2] https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/95

Change-Id: I0d849d5d6d160c48fd4fc2d443e4fde43cde5606
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6cca30bb11c5d612c73e12e2dfcf1d473b17b6d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a276ce620857aab15f60db17868abe86986f338b)
2025-06-04 05:21:10 +00:00
Marc Mutz
1db01fc2d9 QGtk3PortalInterface: normalize SLOT argument
Non-normalized signatures passed to SIGNAL or SLOT macros require a
normalization step before the actual connection can be made, which
takes extra time and extra memory.

Also, a normalized signature is generally smaller than a
non-normalized one, so we save even in executable code size.

Amends d0b4e8a601bc2f81ddb23c124acc99defa26c02f.

Superseded by 2fe9eed3fdd5e7a7a3ebd16f5f683dc84a1eab4c, which,
however, wasn't picked to 6.9 and 6.8, so this patch only targets
those branches.

Task-number: QTBUG-116197
Pick-to: 6.8
Change-Id: Ic937639b1e1583261e0def4d583e53ce03f4a7b9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-06-03 12:24:44 +00:00
Eskil Abrahamsen Blomfeldt
2fa78ca313 DirectWrite: Avoid infinite recursion with broken font data
If a font has an em square size of 0 it is not going to be useful.
However, if one was encountered we returned a default value to
avoid division by zero. The default implementation called ascent(),
which would depend on the em square size again and we would get an
infinite recursion for these fonts.

To avoid this, we simply return a default value of 16 in the case
of a broken font. (The Apple spec gives the range 64 .. 16384 for
the em square and the Microsoft spec says 16 .. 16384, so we use
the smallest of the two.)

Fixes: QTBUG-137277
Pick-to: 6.8 6.5
Change-Id: I63779e44c10c7021486787d1e1e818f4c6e47835
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ab7a80a9557e12735f4e3c3fe76ccc72feba2fc8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9237cdf98fc6f20471aaeec27eef2f5100e9b82f)
2025-06-03 07:15:39 +00:00
Olli Vuolteenaho
e92a7fc932 Android: Don't reparse same paths in QML to Java codegen
appImports can have the same directory added multiple times - first if
it's found in the xxx_conf.rsp file and secondly for the inner qmldir
scanner. This is because the xxx_conf.rsp file can have both the
qmlModule directory and the parent of that directory as importPaths. For
example like this (the paths are truncated to save characters):

-importPath
.../build/qt_generated/qtquickview/qmlModule
-importPath
.../build/qt_generated/qtquickview

In this case when the "inner qmldir" finder processes the later path,
it would go to ./qmlModule, find the qmldir and add another
.../build/qt_generated/qtquickview/qmlModule to appImports. Also, if
there were other qmldir files somewhere under qmlModule those would
also get added twice, which would increase generation time yet again.

This commits solves the issue by removing duplicates from appImports.

Amends 7ed88eb565d40b195aa868e67777872ef07a5ea2.

Pick-to: 6.8
Fixes: QTBUG-137316
Change-Id: I641065479aec0f3d9ae1a8727a03bf62eb169ad6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3bf9047a342ed2699339c29f84f4d60e39353102)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 44913432ce1193ec5b08f6882939a377b38cc73a)
2025-06-03 07:15:39 +00:00
Tim Blechmann
501434a464 Cocoa: QNSView - fix memory leak of QNSViewMenuHelper
QNSViewMenuHelper is leaked, as dealloc did not nil it to decrement the
reference count.

Pick-to: 6.8 6.5
Fixes: QTBUG-131655
Fixes: QTBUG-137161
Change-Id: I783c400d1300046118ad3e12816e84709cc9d793
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c8ebe2e5cd71250d4515e09c29a3045b0cbe49a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 46c82ac228befdd47d659631f4c32503f7d8008e)
2025-06-03 04:16:24 +00:00
Marc Mutz
6c0c327e68 QXdgDesktopPortalTheme: normalize SLOT argument
Non-normalized signatures passed to SIGNAL or SLOT macros require a
normalization step before the actual connection can be made, which
takes extra time and extra memory.

Also, a normalized signature is generally smaller than a
non-normalized one, so we save even in executable code size.

Amends a833d5682ac44571e13568336f2bd3ec7deb1d6d.

Task-number: QTBUG-116197
Pick-to: 6.8
Change-Id: I942f5ac262f05ca4486b2ed2a22654d1a12a3ef0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 71842cfb89da0bed1efd6cf7a567550d9e8119f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 19:57:20 +00:00
Lorn Potter
18552d0c62 wasm: Make sure native fetch is destroyed before reply is canceled, closed
finished signal was being sent before native fetch was destroyed
which, in some instances, was causing a crash.

Fixes: QTBUG-136710
Change-Id: I2134431cbf9af0511d888dc5db3f589f5259c88a
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
(cherry picked from commit f5d888b44a5d418a601d8d7920dc5826617f9e90)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 19:57:18 +00:00
Marc Mutz
8d81da76be tst_QScopedPointer: add a test for reset/delete ordering
We have implementation divergence with libc++'s ~unique_ptr()
behavior, so make sure QScopedPointer behaves the same way as
unique_ptr is spec'ed, even though to check it, one has to rely
on UB, at least according to LLVM devs (I don't think the test
as written invokes UB).

Code's a bit duplicated. I tried making the struct a template,
but it's just too much of a fuss (needs a variable template,
which we can't use in Qt 5), so I decided to use cut'n'paste.

Task-number: QTBUG-137069
Pick-to: 6.8 6.5 5.15
Change-Id: I8b55718eaf3c6ad9a4d89d4fc9d64f0c41bb21fa
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 82015992c853b50dac167da26b8b858ac4794c66)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 19:57:17 +00:00
Christian Ehrlicher
8f6a286fff QStyleSheetstyle: misc cleanup of QStyleSheetBorderImageData
Remove unused member 'image' from QStyleSheetBorderImageData and replace
c array with std::array<>.

Change-Id: I149ef72e443027a6b6d30f25e8c7b1adf4138fc5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d34754ea81ffa8a25909ba56c2684da04fe722f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 19:57:15 +00:00
Bartlomiej Moskal
066d99bb2b Android: Fix text update issues with fullscreen virtual keyboard
In commit 1f6d7cbb341bd79826d3f6d69e1f1a427ebb8f1b, we introduced
support for the full-screen software keyboard.

However, this revealed issues with text not updating correctly in the
view, particularly with composing text.

This commit addresses the problem by adding calls of [0]restartInput()
in three methods: setComposingText, deleteSurroundingText and
setSelection.

These calls help synchronize the editable state with the input method
and ensure the displayed text remains consistent and up-to-date.

There is one more issue that needs to be solved: QTBUG-136229

[0]https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#restartInput(android.view.View)

Pick-to: 6.8
Fixes: QTBUG-135376
Fixes: QTBUG-128745
Fixes: QTBUG-130058
Change-Id: I3f905dd02cb3bfe5046b01164412f328160b7a8b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit ab98013efc16766bb7a538f86b0b9de8db6634ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 19:57:14 +00:00
Marc Mutz
7872575437 QMetaObject: extract helpers from indexOf*() methods
This makes the different functions more similar to each other, thus
facilitating adding a warning about non-normalized arguments to them
in the next step.

Task-number: QTBUG-135572
Pick-to: 6.8 6.5
Change-Id: Ia2b82928e9a24fb9d43b43933b9a9c5308fa2835
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e4f86012360b20938be8f34e6966a577dae6c049)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 19:57:12 +00:00
Mitch Curtis
c200352648 QtFlagHandlingHelpers.cmake: account for GCC when producing error
This changes the error message I get when configuring with
-DFEATURE_sanitize_thread=ON from:

    CMake Error at cmake/QtFlagHandlingHelpers.cmake:183 (message):
      Platform linker doesn't support erroring upon encountering undefined
      symbols.  Target:"Core".
    Call Stack (most recent call first):
      cmake/QtModuleHelpers.cmake:898 (qt_internal_add_link_flags_no_undefined)
      src/corelib/CMakeLists.txt:30 (qt_internal_add_module)

  to:

      ERROR: detected a std::atomic implementation that fails for function pointers. Please apply the patch corresponding to your Standard Library vendor, found in qtbase/config.tests/atomicfptr

    CMake Error at cmake/QtBuildInformation.cmake:240 (message):
      Check the configuration messages for an error that has occurred.
    Call Stack (most recent call first):
      cmake/QtBuildInformation.cmake:59 (qt_configure_print_summary)
      cmake/QtBuildRepoHelpers.cmake:393 (qt_print_feature_summary)
      cmake/QtBaseHelpers.cmake:287 (qt_build_repo_end)
      CMakeLists.txt:36 (qt_internal_qtbase_build_repo)

Pick-to: 6.8
Change-Id: If6243362521802d8b1348ae53d744c33add814f1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c29868830c5e1fc208f8055157dc0fcdb8f1e13d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 19:57:11 +00:00
Matthias Rauter
1e51b8ac7b Add TEST_ALL_COMPARISON to tst_qstringview
While porting some of these tests to QUtf8StringView, Thiago suggested
to add the comparison tests from qcomparisontesthelper_p.h.

Pick-to: 6.8
Change-Id: Id8f2c1c5690f7219ac000eebb637f48acbc5662d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1ecbad8da9828dc561268d0fce8c24239f0a7f2d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 19:57:09 +00:00
Bartlomiej Moskal
4019fca886 Android: Avoid lazy initialization of QAndroidPlatformServices
In commit ff51ea5418d131248b07e327513b41dad1231f37, lazy initialization
was introduced for QPlatformServices, including
QAndroidPlatformServices. However, this approach causes a regression.
When QAndroidPlatformServices is lazily initialized, the intent listener
registration is delayed. As a result, handling custom URL schemes is
affected - especially those coming from external applications.

To address this issue, this commit removes lazy initialization for
QAndroidPlatformServices.

Fixes: QTBUG-135489
Pick-to: 6.8 6.5
Change-Id: I24becdf4ac573e7a2ca101cfbc27560d1eb4adef
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 393c294e102bcd733141539552fda2f148e8b51b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 19:57:08 +00:00
Morteza Jamshidi
c3e0c0099f Use WS_EX_NOACTIVATE to prevent window from getting focused
On top of handling ActivateWindowEvent,MouseActivateWindowEvent and
PointerActivateWindowEvent events and returning MA_NOACTIVATE we can
also set the window extended style to prevent windows from stealing
focus in special cases.
Also on top all those mentioned events, when the window is requested
to get keyboard focus, it should check if the window accepts focus
or not. If it does not, then it should inform the underlying system
that the window does not accept the focusIn event.
[ChangeLog][Windows] Windows with flag Qt::WindowDoesNotAcceptFocus
no longer have a taskbar entry.

Fixes: QTBUG-131714
Change-Id: I79f767b1622449ba05b41f8b80bf390d8cecfff8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Zhao Yuhang <2546789017@qq.com>
(cherry picked from commit c2bdf7636eb46e56760f3e2f6d457c8f14627576)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 19:57:06 +00:00
Thiago Macieira
2a613662a3 QAbstractEventDispatcher: prevent too late unregistering of timers
Timers can't unregister when the dispatcher object is no longer of a
dispatcher type. It's too late even at ~QAbstractEventDispatcher,
because unregisterTimer() is a pure virtual. To prevent their attempting
to unregister, we set the thread's dispatcher to nullptr if it is this
object.

This has been a latent bug, so it's worth fixing. This started happening
for me with an un-pushed change that changed the order of how
QCoreApplication and QGuiApplication destroy the main thread event
dispatcher (namely, in their destructors, not waiting for ~QObject to
deleteChildren()).

Drive-by relax the store in QThread::setEventDispatcher().

Fixes: QTBUG-137130
Pick-to: 6.8
Change-Id: I8845736c38a931af62e3fffdfd3554874df89e8e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c8d3d7a7af73d97e0415b99df8d8378edb3117f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 19:57:04 +00:00
Eskil Abrahamsen Blomfeldt
3915684fb8 dwrite: Support additional font names for system fonts
Fonts have multiple name fields that users may expect to be able to
use for referring to them. In particular, on Windows it has become
common to use a legacy font family name which contains the sub-family
of the specific font, because of backwards-compatibility reasons.

This is not technically the family of the font, but native
applications will typically list them as such anyway, and Qt would
also do this prior to Qt 6.8 because the GDI backend prioritizes
these.

When we moved to DirectWrite as the new default, these legacy names
for system fonts disappeared from the families list, which is
perceived as a regression.

Now, there was already an implementation for getting the legacy names
for fonts for application fonts, but this had not been implemented
for system fonts when populating the font database.

We rectify this by sharing the code which gets the additional font
names and also calling this when populating system fonts.

[ChangeLog][Windows] Fixed an issue where legacy names such as
'Arial Narrow' would no longer be listed as separate font families.

Fixes: QTBUG-135817
Pick-to: 6.8
Change-Id: I2e1b42b7be926e3b5af7bb2aab3ebe5a1fbe29de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6854ea63365ae419a04a470eb17e5f7662f00931)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 19:57:03 +00:00
Marc Mutz
938d5fd6d2 Mark QUrl* classes as security-critical
These classes, too, are usually in the first line of defense, handling
tainted data before anything else had the chance to verify it.

Amends 8df072fc8006510c9b743e8ffedaaf51a876883a.

QUIP: 23
Task-number: QTBUG-135187
Pick-to: 6.8
Change-Id: I21dbea39078a583f0bbf7737bd7151893fb98d17
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit dc45850c1e64565af5bcd8446389fd558131e58b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 19:57:00 +00:00
Thiago Macieira
25d1dfcd49 QLocale: remove WhiteSpacesAllowed mode from qt_asciiToDouble()
It's no longer used. It was used by QByteArray{,View}::toDouble() but
that caused an all-space string to be considered a valid conversion. Now
that those functions do the trimming themselves, we don't need this
mode.

Change-Id: I2c24d3011fd7969bcc92fffd802a5d78ca28c157
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7838a57d2937070bb1a83122491f25b2b396553b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 15:03:15 +00:00
Thiago Macieira
4e785f1da5 QByteArray: make toDouble() reject space-only strings
This does not affect leading and trailing spaces, which remain allowed.
This is only about a string containing only spaces, which used to be
rejected prior to Qt 5.9 and are rejected with QString (unit tests added
to confirm).

Drive-by indent one QString test row, which I've also reordered so null
comes before empty.

[ChangeLog][QtCore][QByteArray & QByteArrayView] Fixed an old regression
that caused toDouble() and toFloat() to return ok = true for a string
containing only whitespaces.

Pick-to: 6.8
Fixes: QTBUG-137038
Change-Id: Ia6f7714c5e289317de60fffd0f8aa6d2198a91ef
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 61b17127ae50516323d64523e6cfdf524ae8e974)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 15:03:14 +00:00
Frédéric Lefebvre
1efb21ba00 Fix flaky tst_QMdiArea::currentSubWindow()
tst_QMdiArea::currentSubWindow() is flaky and fails when the
dummyTopLevel window is not marked as active before verification.

Verify that the dummyTopLevel is active, before checking what is the
active topLevel window.

Fix the flakiness of tst_QMdiArea::currentSubWindow() on Ubuntu 24.

Pick-to: 6.8 6.5
Change-Id: If5b85713d0bfec40e2722c471f7c3ba5ac73171c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 6c7f61f0817754b0abcf0a93ce5cf26fd5251cb4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 14:57:19 +00:00
Frédéric Lefebvre
29d030b246 Fix flaky tst_QFocusEvent::checkReason_ActiveWindow on openSUSE
tst_QFocusEvent::CheckReason_ActiveWindow is flaky on openSUSE where
the childFocusWidgetOne is unable to receive focus after d has been
hidden.

This is due to some asynchronicity when setActive is being called
while d is already active.

Remove the call to activateWindow on d as it is already active by
calling show.

Pick-to: 6.8 6.5
Change-Id: Id01c6704122df42982d65d28ddb94d184d00d9aa
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4db3961ee140867e14f8e1d20173e85060bc6c50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 14:57:18 +00:00
Thiago Macieira
c76d1a9753 tst_QTimer: delete XPASSing flaky test
This is fixed in Qt 6.10/dev, by one of many changes affecting the event
loop and threading, so it's not obvious which one. It's been flaky on
6.9 for the GUI Glib event loop and has been XPASS'ing.

    1133: ********* Start testing of tst_QGuiTimer *********
    XPASS  : tst_QGuiTimer::crossThreadSingleShotDestruction(1s) 'deadTimerDestroyed' returned TRUE unexpectedly. ()
       Loc: [/home/qt/work/qt/qtbase/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp(1328)]

Pick-to: 6.8
Change-Id: Ibbe5373a1f36eaab9830fffdac20c042682c583e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-06-01 07:18:07 -03:00
Thiago Macieira
5bfbc3f173 QThread/Unix: fix silly mistake: static was missing after refactoring
Amends commit 6763e25cbc16cf8c54ab9b1ef97030aab9bb0eec, which refactored
        static struct Cleanup {

to move the body if said cleaning up closer to the rest of the clean up
code in QThreadDataDestroyer::EarlyMainThread. But it accidentally
forgot the static keyword. As a result, we attempted to clean up before
::currentThreadData was set yet, resulting in a no-op and no clean up.

Task-number: QTBUG-135044
Task-number: QTBUG-134080
Task-number: QTBUG-133861
Task-number: QTBUG-132697
Task-number: QTBUG-102984
Task-number: QTBUG-132381
Pick-to: 6.8
Change-Id: Ibe40567bba8dea205401fffdb71f7e6a3be130e4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b5e47fa433f218a47db98a370fbad97c70455e85)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 08325952eeb3a5cc9410a1b45e3445e97af51941)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-06-01 10:17:51 +00:00
Joerg Bornemann
8e9b6f32c0 Revert "CMake: Make generated pkgconfig files relocatable"
This reverts commit 731d9a13956ef40e3f563f5ff5ff5c250b8d6d94.

Reason for revert: ${pcfiledir} cannot be used, because this
leads to wrong prefix values if PKG_CONFIG_SYSROOT_DIR is set.

See the comments of the associated task for instances of this
problem in other projects.

Pick-to: 6.8
Task-number: QTBUG-136210
Change-Id: I2a60946828f07866b931dacfe0ef81346f1aac9d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 286e3093731cd82d4fa6b4d39fadeff21b71f9dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-05-30 09:46:45 +00:00
Alexandru Croitor
be9a94cb5e CMake: Stop spamming CMP0156 debug messages
We set the CMP0156 policy to NEW for Apple platforms for each created
Qt target, but the debug message is generic, so we should only show it
once.

Amends c20d7bcb86361d0c9f8af3807dcad9db1a3a5ca0

Pick-to: 6.8
Task-number: QTBUG-135978
Change-Id: I332bd357999647df1d5f715d154fb568911889b1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 674a6dc5f66fce1cbe77a593e1fc942290d3f9b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-05-30 09:46:40 +00:00
Alexandru Croitor
af623abc58 CMake: Skip sbom file checksum checks for excluded test targets
If a developer configured Qt with
 -DQT_GENERATE_SBOM=ON
 -DQT_BUILD_TESTS=ON
 -DQT_BUILD_TESTS_BY_DEFAULT=OFF

The would get the following error upon installation of qtmultimedia:

CMake Error at
qt_sbom/SPDXRef-PackagedFile-qt-plugin-MockMultimediaPlugin.cmake:5
  (message):
  Cannot find 'plugins/multimedia/libmockmultimediaplugin.a' to
  compute its checksum.

This happens because QT_BUILD_TESTS_BY_DEFAULT == ON sets the
EXCLUDE_FROM_ALL directory property on the tests directory, which
means all plugins created under tests/ subdir are not installed by
default, and the SBOM code could not read the installed files to check
the checksums.

In such a case, set a QT_INTERNAL_TEST_TARGETS_EXCLUDE_FROM_ALL
directory-scoped variable in the tests/ subdir, and use that as a
marker for the sbom code to know it should skip the checksum check.

Pick-to: 6.8
Fixes: QTBUG-137168
Change-Id: I970c3bc5732cc648549e5099fa1d50b3b39cb26f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d2ed84514d935aea412b6944866aeb41aa97ea89)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-05-30 09:46:22 +00:00
Dheerendra Purohit
7837ffc57c QNetworkRequest: fix minor typo referencing non-existent method
Replaced incorrect setTimeout() with setTransferTimeout()

Pick-to: 6.8
Fixes: QTBUG-111993
Change-Id: I1eef02cda1be00d6ab99769f4a9b4406ac92d389
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit d446df75990d4ec03ff8b29a11a515f3f982e995)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-05-30 09:36:50 +00:00
Tor Arne Vestbø
fe148dc641 Use QObjCWeakPointer to track QMacKeyValueObserver observed object
Otherwise we might run the risk that the observed object dies before
we try to do removeObserver.

Change-Id: I2b54ff32728fc40fd47be2d14070fc43640f81bf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b6ffbebbbe75c53f8dd9a7afd97032f7f4fd8f5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-05-30 09:20:28 +00:00
Tor Arne Vestbø
2a967f5c99 Use __weak for implementation of QObjCWeakPointer
By moving the implementation to qcore_mac.mm, and using a union
for the object pointer, we can build qcore_mac.mm with -fobjc-weak
to take advantage of the automatic weak-tracking. This allows us
to drop the manual handling via ObjC associated objects, while
also allowing non-Objective-C code to use QObjCWeakPointer.

In particular we want to use it for QMacKeyValueObserver, which
today runs the risk of removing the observation on an object that
is long gone.

Change-Id: I5d605e5ac82b39223b246d6758d0da88a1702357
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1c98b3fe403aaa7b57813070f3bd690af7bd4e43)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-05-30 09:20:26 +00:00
Assam Boudjelthia
82c2b7f7ed Android: avoid no impl found for updateNativeActivity() at startup
It seems that try/catch and ignoring the exception is not enough
to silence the error message about no implementation found for the
native method updateNativeActivity() when it's invoked at the start
before the libraries are loaded. To fix that we can call it only
if m_stateDetails.isStarted assuming that it would mean the libraries
were loaded since the app has been started.

Pick-to: 6.8
Change-Id: Ic23ce16439000090e2661b2e6956bcd9954bf33f
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 054dfb50a0c6b2bc9e2c227579eb6782e65e2134)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-05-28 20:29:28 +00:00
Assam Boudjelthia
1d014381f2 Android: consider DecorView insets at app startup
Set the initial safe area margins based on the decor view as a
workaround since setOnApplyWindowInsetsListener() is not being called
reliably at startups. This way we can get the app's initial insets at
startup, then after that rely on each window reporting its insets.

And apply this initial inset only for top level windows that match
the screen size, i.e. we assume edge-to-edge is enable in that case.

Task-number: QTBUG-135808
Fixes: QTBUG-135283
Fixes: QTBUG-135227
Change-Id: Ic5771809c94302b927ccc67ccc07c73ccc73b91d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e96a4b84e136d065054600c07bf5fae17f3049ce)
2025-05-28 20:29:25 +00:00
Ivan Solovev
3a3c536c31 QtConcurrent: mark as security-significant
The QtConcurrent module applies user-provided map-, filter-, and reduce-
functions (or their combinations) to user-provided data.
It does not make any assumptions about the provided functions and
data, apart from input/return type validation. It also does not parse
the provided data and does not have any way to sanitize it.

Mark all the source and header files in the module with the default
security-significant score to confirm that the code was reviewed.

QUIP: 23
Fixes: QTBUG-135179
Pick-to: 6.8
Change-Id: I2c1b315b837111627c2f0ce6e2ade704415972e2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit ca50d727785544237eb9f2d9d9a1d1d465772f2f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-05-28 19:03:52 +00:00