70808 Commits

Author SHA1 Message Date
Michael Weghorn
bd1cb1547f a11y atspi: Report app parent
While the application's a11y object doesn't have a parent
within Qt's a11y hierarchy, the AT-SPI registry/desktop is the
parent of all application objects.

Therefore, report that one instead of using a null path.

With that in place, querying the application parent
via Accerciser's IPython console now gives the expected
result:

    In [16]: acc.role
    Out[16]: <enum ATSPI_ROLE_APPLICATION of type Atspi.Role>
    In [17]: acc.parent
    Out[17]: <Atspi.Accessible object at 0x7fbebc3fc1c0 (AtspiAccessible at 0x139d6410)>
    In [18]: acc.parent.role
    Out[18]: <enum ATSPI_ROLE_DESKTOP_FRAME of type Atspi.Role>

While at it, also add a "m_" prefix for the
AtspiAdaptor::accessibilityRegistry member.

Fixes: QTBUG-132935
Change-Id: I0e174f73c837b233fe4d5788d1c375b404000025
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit befce757faa0b0abd2c1f4ec408c1a0932794b0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 22:47:27 +00:00
Friedemann Kleint
4924480944 Notepad example: Use theme icons
Pick-to: 6.8
Change-Id: Id915ecbf218d419b972ff97637673827facf84a2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ead6f79dc015aa8e7c152fac315d0426967c0c7e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 19:35:30 +00:00
Tim Blechmann
e00b3bfc86 Platform: unix - avoid modifying the environment
Modifying the process environment can cause crashes in application code
that accesses the environment via non-qt functions on worker threads.
When launching a process, we can avoid modifying the environment of the
caller by using QProcess with setEnvironment. The codepaths without
QProcess support is still prone to these issues and could potentially be
improved via execve

Task-number: QTBUG-129222
Pick-to: 6.8
Change-Id: I4e2d93abaa0e392b341041faaae0ffd11e225bcb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 673400679dca23840174c9882cea5b796b52b2f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 17:40:44 +00:00
Giuseppe D'Angelo
8ef6d4ede8 tst_QGestureRecognizer: do not leak the point device
QTest::createTouchDevice() passes ownership of the device to the caller,
so make sure to delete it.

Change-Id: I100d3de9eab8ec9f88ed3e0850ada9d988bd962e
Pick-to: 6.8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 28d0e658e297b5de52fb0cccaede08179c7f4b8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 16:25:58 +00:00
Giuseppe D'Angelo
8232c837b0 QDebug: do not trigger integer overflow when printing a QRect
QRect::width() and height() may overflow: they're only safe to call
when right-left+1 (or bottom-top+1) is representable by an `int`.
Therefore, avoiding calling them from QDebug, which is supposed to
"always work" (otherwise, it's not of great debugging help...).

QRectF does not have this issue as it stores the width directly.

Change-Id: I438dbacae42c17730afb92f05d16e3eebb161255
Pick-to: 6.8 6.5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0f336500a0add3e3a8bb31c5cc605e5e13e23833)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 16:12:57 +00:00
Volker Hilsheimer
abf6c88a86 JNI: Extract size check from fromContainer
Addresses header review comment.

Change-Id: I302ae22da197fa8c317f0a4749d15b07fb5d0078
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b5538a5a0ebf9bd9a155b857c385c764c30eabae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 16:12:56 +00:00
Thierry Bastian
779e5faf1d SQL/PSQL: slight improvement in code
added a details about code paths that cannot happen and added constexpr

Fixes: QTBUG-132303
Change-Id: I98340c5a1f275c00aafb3294cf8e5e8368126b76
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit e574cda7fc3f6be5a81489d8d9cdb859625d4e88)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 15:26:30 +00:00
Aurélien Brooke
d7736416e8 rhi: be more verbose in QRhiTexture::Format enum documentation
Add missing [since], explicit total size and fix spelling.

https://doc.qt.io/qt-6/10-qdoc-commands-tablesandlists.html#value

Change-Id: I6934944ef4be119ae2934b986c7840d4d1eeea67
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 61dbdbeb3141c392657a75476c1cf1474020583a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 11:37:31 +00:00
Kai Köhne
66ed40dfe4 Doc: Fix link to RFC 8259
Fixes qdoc warning
    corelib/doc/src/json.qdoc:22: (qdoc) warning: Can't link to 'RFC 8259'

Amends 65fda988e92e

Change-Id: I62c1cf05366cd13180d21d7b4cbf68c0c0f48e1d
Reviewed-by: Johannes Grunenberg <nerixdev@outlook.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a4d3a82244ab292c7a906fc19052e8b9d00b0f7b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 11:37:31 +00:00
Piotr Wierciński
65a8c2e421 wasm: Update Emscripten to 3.1.70
Change-Id: Id502e6ffa6ee7ef3b000d8e43f112dfb882fe354
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 66b63668212aab585a84929765484393621651ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 11:37:31 +00:00
Thierry Bastian
79f96014d1 SQL/PSQL: Avoid copies of data in QByteArray when binding such a value
Fixes: QTBUG-132303
Change-Id: I84e822078d684850c5c0384338cfa4c01fe5007f
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit f346a6065d36cda4ceacce03962ba58a7cf91019)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 11:37:31 +00:00
Laszlo Agocs
33d74f3f58 rhi: gl: Honor deafultFbo from the QOpenGLContext better
The legacy infrastructure does not map very well to the modern one:
it turns out that, somewhat counterintuitively, targeting a
QRhiSwapChain for a QWindow may still mean rendering into a texture,
when using OpenGL on certain platforms.

For example, the Wayland platform plugin implements client-side
decorations by binding an FBO upon making a context current on a
surface for a (decorated) window, and it also makes
defaultFramebufferObject() on the context return the FBO id.

The expectation is that this is why errors such as
GL_INVALID_OPERATION are encountered in glDrawBuffers on Linux.

The QRhi GL backend's assumption that the QRhiRenderTarget being
a QRhiResource::SwapChainRenderTarget implies that the target
really is the color buffer(s) of a window surface is not in practice
sufficient on these platforms.

The bound FBO was already correct always (whatever defaultFbo reports),
but the code path hit was the wrong one. And there is different code
for MRT support (textures only) and stereo rendering (window surface
only).

Make sure defaultFbo() is queried before taking the decision which path
to hit.

Pick-to: 6.8
Fixes: QTBUG-122819
Fixes: QTBUG-132780
Change-Id: Iaaab57b031f430178ee4611a4f7a02c854010441
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 3869106cc5914fb4a8eda30ae1bd5f68dcee2fda)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 07:30:17 +00:00
Laszlo Agocs
b96994c9eb rhi: vulkan: Simplify frame sync
imageFence seems to have no purpose. And some of the
comments seem to be out of date / misleading.

More importantly, do the command buffer completion wait
before the acquireNextImage. Otherwise frame.imageSem
may have wait operations pending if the queueSubmit
did not get to wait on it yet. The expectation is that
this potential issue is what triggers the recent
validation layer releases' enhanced synchronization
checkers.

Pick-to: 6.8
Fixes: QTBUG-132808
Change-Id: Ib8e3884ccea343f5a839aa2ee17cd358fafeac69
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 24d62ffd720b5bec5d07b07b8d2c9dda7635f3c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 07:30:08 +00:00
Thiago Macieira
c4eacb70fd QFileSystemEngine/Darwin: remove use of clonefile() on Apple systems
Because we called this before opening the target file, we did not check
that the destination file engine is the QFSFileEngine, and therefore we
may have passed a path that referred to a Qt resource path. We still do
that on Windows, but Qt resource paths start with a ':' character and
that is not allowed on Windows, so the Win32 CopyFile() function fails.

Moreover, this function *can* clone directory trees, which we don't want
to happen because it doesn't happen on other OSes. Instead, fall back to
the fcopyfile() call in cloneFile(). It will still do cloning where
permitted.

This was added in commit db0064b767474a89bc72ea4374f477682983c5f4,
before the fcopyfile() in 974b3adf8a099ca95fc2eabfc434038ce73f62c8,
though both were for Qt 5.10.

[ChangeLog][QtCore][QFile] Fixed a bug on Apple systems that would cause
copy() to copy a directory if the QFile pointed to a directory and the
destination was in the same volume. Now copy()'s behavior is the same as
in other OSes: directories are never copied.

[ChangeLog][QtCore][QFile] Fixed a bug on Apple systems that allowed
copy() to create a file with the name that referred to a Qt resource
path, if one tried to copy to that path. Qt resource paths can't be
modified using QFile.

Change-Id: I996368f4c656ff10ff5efffd5b47c6ddde34fd10
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 45886e6a81016c5c9212fffb5c0a83fd2431223e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 05:29:13 +00:00
Eskil Abrahamsen Blomfeldt
8d791bfb30 Port Freetype engine to COLR paint graph renderer
Use the cross-platform renderer code in Freetype as well as
DirectWrite to share as much code as possible.

Change-Id: I643dced6b913138890b39eafc3984cca5ced0aae
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit d58ad990e227fecf5526df1a89736afc0c9268fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 01:34:33 +00:00
Eskil Abrahamsen Blomfeldt
0c4b517e6e DirectWrite: Implement support for COLRv1
This traverses the paint node graph and renders
the emoji through a generic renderer. This renderer
is largely based on the renderer in the FreeType
backend and will be used there as well in a follow-up
patch.

Fixes: QTBUG-113458
Change-Id: I44d17b0be8d85e38589edeb68793bf4ee4491eca
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9f22a51987614ce51b3c12ced420bc4ca5b1ec61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-28 01:34:26 +00:00
Joerg Bornemann
e50ae83c8c CMake: Fix examples built as external projects
Usage of a private module needs a respective find_package call now.

Task-number: QTBUG-87776
Change-Id: I3a00a241c5e8637d28606c1f45a843b491c0a8bc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 483768fb8ed18fe5911d96f990ddbc69858146bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 22:38:51 +00:00
Doris Verria
83226ed3d0 QWindowContainer: Improve docs to mention new change in behavior
Specify that since 6.8 tab focus can transfer in and out of the
embedded window if using a Qt Quick based window.

Pick-to: 6.8
Change-Id: I21d04457ee79497431f889e261f1cb6bd9fd39ee
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 059210b17e50fd7c45af4ca0631ddcf8dd7c67f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 22:38:50 +00:00
Thiago Macieira
bcc0e6124a QLocale: try to survive being created during application shut down
QLocale is very often accessed during global static destructors, so
let's try and survive if the default has already been destroyed. In that
case, we shall fall back to the C locale.

I've placed the call to systemData(), which updates the system locale,
before the initialization of defaultLocalePrivate, as the initialization
of the latter depends on the former.

Task-number: QTBUG-133206
Pick-to: 6.8
Change-Id: I48e29b45f9be4514336cfffdf5affa5631a956a3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Albert Astals Cid <aacid@kde.org>
(cherry picked from commit e0a1f491567f2495443babc5aa36a038260f96c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 22:38:50 +00:00
Eskil Abrahamsen Blomfeldt
4bff9e3582 DirectWrite: Support embedded PNGs in color fonts
This does some refactoring on the color font support in
the DirectWrite backend and introduces support for loading
embedded PNGs from the font.

This gives us support for CBDT and SBIX fonts, which are both
based on embedding image files.

[ChangeLog][Windows] Added support for color font formats with
embedded pixmaps in DirectWrite backend.

Task-number: QTBUG-113458
Change-Id: I695901b62600c37619c80aa915f60de13a4fca3f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 1b85143d217042876209794bf8d0361b7ce8834f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 22:38:50 +00:00
Morteza Jamshidi
34167f6622 Change window activation order if active window is moved
Active window should always be in front of the stack so bring it to the
front of the stack if it's not.

Pick-to: 6.8
Fixes: QTBUG-112758
Change-Id: Iff123d1e95f728f51b786106d83a429c111aa6a8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit e6e210c2406e8d4cfe67543871af5fe14a2bda82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 22:38:50 +00:00
Lucie Gérard
3e0276990d Make module ready for source SBOM checking
This includes:
- turning VERIFY_SOURCE_SBOM ON
- adding exception to the licenseRule.json files
- correcting the licensing given via REUSE.toml files
- renaming license files not located in LICENSES folder.
They need to be named LICENSE. to be ignored by reuse and
excluded from the source SBOM. The name are updated in the
corresponding qt_attribution.json

A lot of files are skipped during the license test,
but all are present in the source SBOM.
This is why  correction are needed before turning the
source SBOM check on.

[ChangeLog][Third-Party Code] Renaming the license files with prefix
LICENSE. to have them ignored by reuse tool.

Task-number: QTBUG-131434
Change-Id: Iab517215bb10a17357d2d2436bba8d3af76e5cd1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 7cb90e15631a9e6f12469a7ca8c070781c4aafc2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 22:38:50 +00:00
Lucie Gérard
01e5801cec Add calling license check on generated source SBOM
The license check is only called if VERIFY_SOURCE_SBOM is set to ON
in the module_config.yaml. This way, a module can turn on the check
only when ready.

The license check is done via a perl script. Since no perl is
available for Windows on ARM64, VERIFY_SOURCE_SBOM is set to OFF
in this case.

Task-number: QTBUG-131434
Change-Id: I183b7726928bbc925940330d39779a4ac2307254
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 153002f7d2904988efdd8abc68adff0f9927943b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 22:38:50 +00:00
Assam Boudjelthia
e60b493c2e Android: update to Gradle 8.12 and AGP 8.8.0
Update to latest versions for Gradle:
* Gradle 8.10 -> 8.12
* Android Gradle Plugin 8.6.0 -> 8.8.0.

[ChangeLog][Third-Party Code] Updated Gradle to 8.12 and AGP to 8.8.0.

Fixes: QTBUG-132852
Task-number: QTBUG-132851
Change-Id: I9445f0cd7347a6ee153a987ea28ab617b9cb6055
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Olli Vuolteenaho <olli.vuolteenaho@qt.io>
(cherry picked from commit 0e4f9ffa55c2b77fbe79e96362bc68a968982b48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 17:44:41 +00:00
Kai Köhne
87dc466e29 Doc: Update external link to freedesktop.org trash specification
Old link gives a 404

Change-Id: I3e528a29a6ed2d0d97c3fcf1cf11c441a2882415
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
(cherry picked from commit ccc99bcf8bd48e6c01e5db7fd094dc064bbd72f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 17:44:40 +00:00
Giuseppe D'Angelo
cbdd2d7353 QRhiVulkan: disable -Wundef when including 3rd party headers
The header is -Wundef-unclean.

Change-Id: I30145f331ee1062961abaed14c7b79b84755abb9
Pick-to: 6.8
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 349737c6a94a4628c262776b0b8a08bf24d46363)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 17:44:38 +00:00
Christian Ehrlicher
0f744e6b2b SQL/PSQL: call deallocatePreparedStmt() unconditionally
deallocatePreparedStmt() knows by itself when to call the psql cleanup
routines or not. No need to have this logic outside this function.

Task-number: QTBUG-132303
Change-Id: Ib1a5ba7b53c156f6a6b93f23a3ec8c851d7398fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Thierry Bastian <thierryb@filewave.com>
(cherry picked from commit 9094ad18b0d909f7490dec3451ec7ef9c312f42a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 17:44:36 +00:00
Joerg Bornemann
7782f2ad14 CMake: Don't enforce find_package(Qt6FooPrivate) for Qt 6.9
Requiring users to do find_package(Qt6FooPrivate) to use private modules
turned out to be a too invasive change for Qt 6.9. We turn off this
behavior and restrict it to the dev branch.

[ChangeLog][CMake] The requirement to do find_package(Qt6FooPrivate) in
user projects was postponed to a later Qt version.

Task-number: QTBUG-87776
Change-Id: Ifbf676288587ae5fabe100bf3bd93b220ddbc5ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-01-27 18:33:03 +01:00
Alexandru Croitor
54cb92d58b CMake: Provide a way to find all available Qt module packages
A project might want to find_package all available (installed) Qt CMake
packages that contain qt modules.

A use case might be a qml app that needs to link to all of Qt, and
support showing qml files that can load any Qt qml module.

Add a new Qt6 COMPONENT called ALL_QT_MODULES.

It can be used like this:
  find_package(Qt6 COMPONENTS ALL_QT_MODULES).

The implementation will find all installed Qt modules by globbing over
all json files installed in $qt/modules dir, and treat the file names
as package names.

It will then tell Qt6 to find_package each of those packages.

Pick-to: 6.8
Change-Id: I89242307438576a0cbb3cdca80a9cb72818b6035
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit c7027880aa746a01362ac12491910479d7fc67e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 16:37:03 +00:00
Alexandru Croitor
31c8031847 CMake: Collect all known qml plugin targets into a directory variable
Just like we do with qt plugins, collect all found qml plugin targets
into two new directory scoped variables:
- QT_ALL_QML_PLUGINS_FOUND_VIA_FIND_PACKAGE
- QT_ALL_QML_PLUGINS_VERSIONED_FOUND_VIA_FIND_PACKAGE

The plugin target names are derived from the Config.cmake file names,
based on the existing assumption that qt_internal_add_plugin always
uses the target name when generating the Config.cmake file.

Pick-to: 6.8
Change-Id: I78c76488e133fb3c0374cbc149425726077f6c31
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit bf83fffd13c176391d353080cd76bc68ae7ea184)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 16:36:57 +00:00
Alexandru Croitor
4661694382 CMake: Move qml plugin auto inclusion code into a separate macro
The code is moved into a macro without any modifications aside from
removing the escaping of variable evaluation and escaping of quotes.

It's kept as a macro similar to __qt_internal_include_plugin_packages,
because there might be calls to find_package() that set variables in
the current scope.

The reason for moving is easier maintenance (no more escaping).

Pick-to: 6.8
Change-Id: Ie6ddc26fe4ff8db0134f3542c2886f8b5d68dc51
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 47006aca44c16c78f00940574170640f19e9fb43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 16:36:51 +00:00
Alexandru Croitor
93f52f7980 CMake: Set versioned variables with found modules, plugins, types
Introduce two new directory-scoped variables containing versioned
(prefixed with Qt6::) target names of qt modules and qt plugins found
as a result of finding Qt packages:
- QT_ALL_MODULES_VERSIONED_FOUND_VIA_FIND_PACKAGE
- QT_ALL_PLUGINS_VERSIONED_FOUND_VIA_FIND_PACKAGE

To be consistent in the naming of the variables going forward,
deprecate the old QT_ALL_PLUGINS_FOUND_BY_FIND_PACKAGE variable
in favor of a new QT_ALL_PLUGINS_FOUND_VIA_FIND_PACKAGE.
The difference is 'BY' vs 'VIA'.

The non-versioned variables are modified not to contain duplicates:
- QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE
- QT_ALL_PLUGINS_FOUND_VIA_FIND_PACKAGE

Also remove duplicates from the variable that collects all found qt
plugin types:
- QT_ALL_PLUGIN_TYPES_FOUND_VIA_FIND_PACKAGE

A follow-up change will collect qml plugin targets.

This information can be useful to find out what Qt targets are
available in a project, for example to know what plugin targets or
types can be linked into another target, or which libraries can be
deployed.

Pick-to: 6.8
Change-Id: I4f158872f4a8f6ef6008f081270604f75b77ad9d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f7b8ff71778bde94741402216269c2de2dda32c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 16:36:45 +00:00
Soheil Armin
74c455c8bb Android: Incorporate QAbstractItemModelTester into QtAIM CI Tests
QAbstractItemModelTester performs non-destructive tests on test models.
It helps with catching the most common errors in the test model.

Task-number: QTBUG-132880
Change-Id: I719f4223d84e66c1d94cbd0380bfdb77b07da7b6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b751a12f7af533049ff46c6a63bd12eb6082415a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-27 08:06:46 +00:00
Soheil Armin
d25e08afc2 Android: Make use of ItemDataRole in QtAIM tests
Previously we were using raw zero-based integer values
for roles in QtAbstractItemModel tests.

Roles starting from 0x0 to 0xFF are reserved for pre-defined roles
defined in Qt::ItemDataRole enum.

This change will change the base role value to Qt::UserRole.
It will later help us to use QAbstractItemModelTester as this
tester class expects certain types from pre-defined role values.

Task-number: QTBUG-132880
Change-Id: Ie19739cd7bf49829fe58f5ad53078942d47a433b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 967d9b8cf200163b25a3c1a3b3d79a107f9073b2)
2025-01-27 08:06:40 +00:00
Tor Arne Vestbø
abbbfa27bd Don't pass along expose events for destroying QWidgets
When closing a popup window on macOS, and the NSView needs display,
for example due to the frame geometry having changed, the system will
ask our NSView to display one last frame, via NSOrderOutAnimationProxyWindow
initWithSnapshotOfWindow.

If this happens during the close() that the QWidget destructor does,
we no longer have a QWidget subclass to handle the corresponding paint
event, so we'll end up flushing an empty frame, using that for the
animation transition instead of the last valid frame of the widget.

Worse, if the top level is using RHI to flush, the texture list
might be stale, as there is currently no plumbing for a widget to
tell QWidgetRepaintManager about it deleting a texture that was
previously picked up and placed in the QPlatformTextureList. When
this happens we end up crashing on dereferencing the stale texture.

To mitigate these issues we now skip the expose event if the widget
is already in ~QWidget. This potentially means the close animation
will use a stale frame, but we can live with that.

Pick-to: 6.8 6.5
Change-Id: Iabe1d97019923ee3a1a86039630095d00c966156
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9509434ecb4a11409d8c2bea9c010b40f8f7894d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-26 21:23:36 +00:00
Tor Arne Vestbø
ccbf28a56c Don't assume QDockWidgetGroupWindow has toolbars
As part of 3d99f90b50ab22ef5ab4433c57f9ee584a0a7cae we added logic
to look up the toolbar for a QMainWindowLayoutSeparatorHelper. In
the case of QDockWidgetGroupWindow the logic was broken, as it was
casting the layout's parentWidget(), the group window, to a QMainWindow,
instead of using the group window's parent.

However for QDockWidgetGroupWindow we shouldn't look for a toolbar
at all, as QDockWidgetGroupWindow can't have a toolbar. Using the
parent main window's toolbar is wrong, as mouse events for that
window will not affect mouse events for the group window, so the
bug in 3d99f90b50ab22ef5ab4433c57f9ee584a0a7cae is not triggered.

Fixes: QTBUG-132952
Pick-to: 6.8 6.5
Change-Id: Ic7845254e05bc358a39f79ec7622029d90173b45
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 81ed068a510421e6204193ec37448a628324543d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-26 21:23:31 +00:00
Timur Pocheptsov
2d819c7027 QTestLib: Add helper function to check for keychain access issues
To be used in network-related tests where we potentially are
using private/public keys and (on macOS) end-up with keychain
access blocking a test with dialogs requesting a permission
to access the keychain.

Task-number: QTBUG-132645
Pick-to: 6.8
Change-Id: Ide74633bf88b0453d5d8f8de56282c8cf8207380
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 13109ba350686cd8ce8e298db5d76d0e7c209bd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-25 11:45:12 +00:00
Alexandru Croitor
940fc15ec1 CMake: Allow skipping some parts of SBOM generation
Makes it easier to debug diffs of SBOMs, due to lower amount of
content in generated files.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I5a1e8a9868cda199de4a7344b86a12f68fec31bf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 3c516ffa8739a6d8729780138f07a6bea7cfea8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-25 11:45:12 +00:00
Alexandru Croitor
fe3b0212ea CMake: Add SUPPLIER as an option to SBOM packages
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I22cae71dcc7582126320e17271a8c55bea1ad393
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 2857d8d5eaaddde3e3cff916d5ad4b3c93a9b760)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-25 11:45:12 +00:00
Marc Mutz
760688cc75 tst_QUuid: fix -Wreturn-type in make_minimal(QUuid::Version)
The code relies on -Wswitch, but lacked the Q_UNREACHABLE_RETURN() at
the end that compiler and code readers need to understand that we don't
accept values other than those enumerated, even though an enum variable
could hold other values, too.

Since the function is constexpr, can't use that macro directly, but
need to copy the usual GCC 8 magic incantation.

Amends 171ff57be1b8fd1c1b33cffbffa389790f239b5c.

Pick-to: 6.8
Change-Id: I6c9dd0e4178211f57da61aa6df70f8036370f158
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 420ca3463ee8adf2d986af5802d8da4bb24ce14d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-25 11:45:12 +00:00
Alexandru Croitor
dcfd35f43b CMake: Add qt exported target name and package name into SBOM
Add them to the PackageComment field of the SBOM.
Can be useful to map back the SPDX Package to the CMake target or
package.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Icbbb90132038c489b55c4ee7a038aea593ce1ff6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0be13fb6994feade6777a17cc405d9b2f32f2aa3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-25 11:45:11 +00:00
Andreas Eliasson
83cd96307f Doc: Fix method docs for QOpenGLTexture::setWrapMode
The current method description seems like a copy-paste left-over.

Fixes: QTBUG-57209
Pick-to: 6.8 6.7 6.5 6.2 5.15
Change-Id: Ife9f9f7bc97d990f5d447208bd39c2d2b6a614fd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 9182f60b455cead33c0f4fd4e452b210e2de0fca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-25 11:45:11 +00:00
Alexandru Croitor
db841d4afe CMake: Add a fake deterministic SBOM generation option
Replaces content like timestamps, version strings and checksums with
constant values to make the SBOM generation deterministic.
This is useful for reproducible builds, to allow cleaner inter-diffs
while developing new SBOM features.

Can be enabled by configuring with
-DQT_SBOM_FAKE_DETERMINISTIC_BUILD=ON

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Id0003bdd23fe57abd70213a2a108885861693242
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit d2dea0bc08036925cb93c226af19aeb896926309)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-25 11:45:11 +00:00
Alexandru Croitor
477972b3e0 CMake: Prepend underscore to qt_internal_sbom_set_default_option_value
Because it's in a Public cmake file.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: If3f92af848193cb824b88e93e17965ffed93cf2b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4be604c55e3cf493f883a7df484940c9a1244a97)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-25 11:45:11 +00:00
Wladimir Leuschner
6a6a1c0fe2 QWindows11Style: Reduce groove size of QSlider
Reduce the groove size of QSlider when using Windows11Style, so that the
minimum selectable value does appear so.

Fixes: QTBUG-133128
Pick-to: 6.8
Change-Id: I3e5a5378e2eace3920c06db8cb1198122c0937b5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit dee731ae981eb4f41f4b00be80f75c7a0a5c0e11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-25 11:45:10 +00:00
Alexandru Croitor
3d4501bea7 CMake: Remove qt executable SBOM generation stale code
We never ended up calling _qt_internal_finalize_sbom for generic Qt
repo executables, and we never passed an SBOM type, so this code never
worked.

Remove it to avoid confusion.
It might be re-added in the future.
This doesn't affect the SBOM generation for Qt tools and apps.

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: Iffde964efe2a6b70e6e0b64ec0803af5e84172fb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f2472c2e6a5b93dfbda166582620c30ea8855edb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-25 11:45:10 +00:00
Alexandru Croitor
69b7c311f3 CMake: Fix SBOM inline comment
Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I53696003b144ad628169a345743e343cdfc022ae
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit ffe972d72c3e577723b3a74eef098e381261c4d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-25 11:45:10 +00:00
Fabian Kosmale
6e35353c83 _qt_internal_process_resource: Properly escape XML
XML requires escaping for certain characters, and we need to consider
this when writing out qrc files (which use XML).

This commit introduces a helper function,
_qt_internal_escape_xml_characters, to take care of the escaping.
It uses regular expressions to process the input strings. We take care
to start with '&', as '&' needs to be escaped, too.

We minimize the amount of escaping we're doing (the exact rules
differing between attributes and text), to avoid unnecessary work that
needs to be done when configuring a project. This is achieved by a
SUBSET option which can be passed to _qt_internal_escape_xml_characters.

Pick-to: 6.8
Task-number: QTBUG-131916
Change-Id: Ic1bd0eedee0343c3d70b6954842e21b3c550b092
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e4fbbdea05540723d4c4429d673d25efa3201d7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-25 11:45:10 +00:00
Alexandru Croitor
7584fe901e CMake: Add a few more internal sbom helper functions
Add a few internal functions to allow
- getting the sbom project supplier
- project supplier url
- project namespace
- computing a project namespace
- computing a project file name
- getting a sanitized spdx id given a hint

Pick-to: 6.8
Task-number: QTBUG-122899
Change-Id: I0dc3df274eaf6882a6af021aabee75501b5083f8
Reviewed-by: Moss Heim <moss.heim@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit dbf44b61c11d63a4e3242a62c3be34ebf1f3f012)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-25 11:45:09 +00:00
Cristian Le
a1a77ea7d1 Forward find_package hints to auto/cmake
If the tests are built and run as standalone or non-prefix build and a
find hint was used, e.g. `Qt6_ROOT`, then this type hint should be
forwarded to the `ctest --build-and-test` otherwise the internal
package would fail when it tries to `find_package`.

Change-Id: If71852dd5124b8deeddd28ba835f1943d96ba2b8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 599ad25a65ddf3b3fb7dcdc7c446da070800e507)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-25 11:45:09 +00:00