71055 Commits

Author SHA1 Message Date
Thiago Macieira
8a720c162d QFile: use unbuffered mode for the file-copy data pumps
There's no need to have the QIODevice layer buffer the data and thus
allocate memory. In the case of QFile::copy(), it also improves the
error message output.

Previously:
"Cannot create /tmp/tmp/f for output: No space left on device"

Now:
"Failure to write block: No space left on device"

Pick-to: 6.9
Change-Id: I537a2a79ead9d1d9ac2efffdd650702a4424bac6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-01-24 16:26:34 -08:00
Thiago Macieira
c15bfcd5c0 QCoreApplication: clean up after {win,mac} removal from Bootstrap
Amends commit bf8a5ab418a21d802910728ed24a0a7fad230526. Just some
tidying up.

Change-Id: I3d07a7b151241317ab6bfffd3e79a40db4dab441
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-01-24 16:26:33 -08:00
Thiago Macieira
d7007090bb Bootstrap: depopulate qcore_mac.mm to remove QOperatingSystemVersion
We don't need anything that the class provided, but we needed it because
everything is in a large .mm source file.

I've also removed portions of qcore_mac.mm that aren't needed for
bootstrapped tools, like telling whether dark mode is in effect (the
bootstrapped tools aren't GUI). I've also had to remove the check for
running under Rosetta, which hopefully is going to affect no one:
running moc & cmake_automoc_parser under Rosetta is going to be mighty
slow. Just use a native set of tools instead.

Change-Id: I4c0c716a5b57833abf63fffdf0c66b9ebaccffdb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-01-24 16:26:33 -08:00
Wladimir Leuschner
b717945812 QWindows11Style: Default PE_IndicatorRadioButton to selected/unselected
In case there is no valid QStyleOption::styleObject, default the
PE_IndicatorRadioButton to the selected and unselected appearances.

Fixes: QTBUG-132906
Pick-to: 6.9 6.8
Change-Id: I5e9c13cb3384321e025e5af08ee3dab81feb07fe
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2025-01-24 22:00:52 +01:00
Wladimir Leuschner
dee731ae98 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.9 6.8
Change-Id: I3e5a5378e2eace3920c06db8cb1198122c0937b5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2025-01-24 19:59:38 +01:00
Alexandru Croitor
dbf44b61c1 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 6.9
Task-number: QTBUG-122899
Change-Id: I0dc3df274eaf6882a6af021aabee75501b5083f8
Reviewed-by: Moss Heim <moss.heim@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-01-24 19:36:09 +01:00
Alexandru Croitor
f2472c2e6a 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 6.9
Task-number: QTBUG-122899
Change-Id: Iffde964efe2a6b70e6e0b64ec0803af5e84172fb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-01-24 19:36:08 +01:00
Alexandru Croitor
ffe972d72c CMake: Fix SBOM inline comment
Pick-to: 6.8 6.9
Task-number: QTBUG-122899
Change-Id: I53696003b144ad628169a345743e343cdfc022ae
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-01-24 19:36:08 +01:00
Alexandru Croitor
0be13fb699 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 6.9
Task-number: QTBUG-122899
Change-Id: Icbbb90132038c489b55c4ee7a038aea593ce1ff6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-01-24 19:36:08 +01:00
Alexandru Croitor
d2dea0bc08 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 6.9
Task-number: QTBUG-122899
Change-Id: Id0003bdd23fe57abd70213a2a108885861693242
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-01-24 19:36:08 +01:00
Alexandru Croitor
3c516ffa87 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 6.9
Task-number: QTBUG-122899
Change-Id: I5a1e8a9868cda199de4a7344b86a12f68fec31bf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-01-24 19:36:08 +01:00
Alexandru Croitor
2857d8d5ea CMake: Add SUPPLIER as an option to SBOM packages
Pick-to: 6.8 6.9
Task-number: QTBUG-122899
Change-Id: I22cae71dcc7582126320e17271a8c55bea1ad393
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-01-24 19:36:07 +01:00
Alexandru Croitor
4be604c55e CMake: Prepend underscore to qt_internal_sbom_set_default_option_value
Because it's in a Public cmake file.

Pick-to: 6.8 6.9
Task-number: QTBUG-122899
Change-Id: If3f92af848193cb824b88e93e17965ffed93cf2b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-01-24 19:36:07 +01:00
Aurélien Brooke
ff68e05bc3 rhi: vulkan: fix the pWaitDstStageMask parameter of vkQueueSubmit
It expects one mask per wait semaphore, where only one was given,
leading to an out-of-bound read.

Amends 202dd3cb39ab4408c44a8588b8d6fb9a1cc3a184.

Fixes: QTBUG-132356
Pick-to: 6.9
Change-Id: I6f7d33eb4568d1577e09411f7be751c8dc520429
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2025-01-24 19:36:07 +01:00
Aurélien Brooke
6f9e40ad39 rhi: remove unnecessary float casts
Since 5bb4baae0379d5903f547f0399be9620f5ab06a0 QColor functions already
return floats.

Change-Id: I8e5261397c5807123fb4b3288f229c23c2324995
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2025-01-24 19:36:07 +01:00
David Redondo
cd1686e55f QOpenGlContext: Always unset current context in doneCurrent()
Otherwise when no other context is made current until thread exit, the
QGuiGLThreadContext destructor will try to call doneCurrent() on an
already deleted context.

Pick-to: 6.9 6.8
Change-Id: If55dd69a72b8ab4012780a449f6a02729dd0ed43
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2025-01-24 19:36:07 +01:00
Assam Boudjelthia
48dbc72c44 AndroidTestRunner: print failed build output when no --verbose is used
This helps with better debugging where in most cases the tests are run
without --verbose, but if there's a build error, it won't be clear what
went wrong, and only re-running with --verbose would give such details,
which is just annoying to deal with.

Pick-to: 6.9
Change-Id: Icb8bcb8e5ba297d48b9e166c93523f25a21937b2
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2025-01-24 20:36:06 +02:00
Assam Boudjelthia
256fd95a71 AndroidTestRunner: don't automatically print logcat unless its a crash
Print logcats only if it's explicitly requested with the respective
argument or if there was a crash, i.e. where we can't get the test's
exit code. Otherweise, in case of normal failure, we don't really need
to pollute the output.

Pick-to: 6.9
Change-Id: Ic4e6db5d9fd6786bd28204a3ec87f63a7ec9764a
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2025-01-24 20:36:06 +02:00
Cristian Le
599ad25a65 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`.

Pick-to: 6.9
Change-Id: If71852dd5124b8deeddd28ba835f1943d96ba2b8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-01-24 18:53:35 +01:00
Felix Lionardo
70b1db9c0e QNX desktop support
Adds functionality to communicate with a desktop manager. This feature
is only enabled if "desktop" is added to the QT_QPA_PLATFORM environment
variable (e.g., "QT_QPA_PLATFORM=qnx:no-fullscreen:desktop").

Pick-to: 6.9 6.8
Change-Id: If98e0dda43692abce47f2d8f5f340bd7276ec901
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2025-01-24 12:53:34 -05:00
Felix Lionardo
d0e64a36d2 Disable incremental updates for raster windows on QNX
Incremental updates don't always work
due to a misinterpretation of the rectangles passed in by the upper
layers.

Pick-to: 6.9 6.8
Change-Id: Id30c97f80904209726b3aaf37c52b2e14ee2f187
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2025-01-24 12:53:34 -05:00
Joerg Bornemann
ad7b94e163 CMake: Only load Qt6FooPrivate automatically when building Qt
[ChangeLog][CMake] CMake packages of public Qt modules don't provide the
targets of their private counterparts anymore. User projects must now
call find_package(Qt6 COMPONENTS FooPrivate) to make use of the
Qt6::FooPrivate target. User projects that rely on the old behavior can
set the CMake variable QT_FIND_PRIVATE_MODULES to ON.

For user projects, the warning message we know from QMake is displayed.
The warning can be disabled by setting the CMake variable
QT_NO_PRIVATE_MODULE_WARNING to ON.

Within Qt itself, find_package(Qt6Foo) will still
find_package(Qt6FooPrivate).

For static Qt builds, we need to wrap usage of private Qt modules in
$<BUILD_INTERFACE> or $<BUILD_LOCAL_INTERFACE> (if CMake's version is >=
3.26). Static builds with CMake < 3.26 will always load the private
modules if the Qt6FooConfig.cmake from Qt's build tree is loaded. This
is the case in non-prefix builds and (in the future) when building
examples as external project.

This amends commit fbbf4ace0188b9718b6d7808021c0b887fd52d9f.

Pick-to: 6.9
Task-number: QTBUG-87776
Change-Id: I78e95248f2b3fa73c3005c61df2fe4f71ad8eeb8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-01-24 18:53:34 +01:00
Morteza Jamshidi
cf9c94e851 Show window without activating if WindowDoesNotAcceptFocus flag is set
Added an extra condition to only show the window (without activation)
if Qt::WindowDoesNotAcceptFocus flag is set. (Mostly from qml)

Fixes: QTBUG-130912
Change-Id: I6b7a9cd03d726315b8531600c6a8b33436a3348b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-01-24 18:53:34 +01:00
Timur Pocheptsov
13109ba350 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.9 6.8
Change-Id: Ide74633bf88b0453d5d8f8de56282c8cf8207380
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-01-24 12:27:16 +00:00
Fabian Kosmale
e4fbbdea05 _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 6.9
Task-number: QTBUG-131916
Change-Id: Ic1bd0eedee0343c3d70b6954842e21b3c550b092
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-01-24 12:30:37 +01:00
Marc Mutz
420ca3463e 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.9 6.8
Change-Id: I6c9dd0e4178211f57da61aa6df70f8036370f158
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-01-24 10:44:47 +00:00
Andreas Eliasson
9182f60b45 Doc: Fix method docs for QOpenGLTexture::setWrapMode
The current method description seems like a copy-paste left-over.

Fixes: QTBUG-57209
Pick-to: 6.9 6.8 6.7 6.5 6.2 5.15
Change-Id: Ife9f9f7bc97d990f5d447208bd39c2d2b6a614fd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2025-01-24 11:44:47 +01:00
Christian Ehrlicher
ed18ad9543 Windows11Style: fix drawing rounded corners in itemviews
When drawing an itemview item, the rounded corners (for current and
hovered item) were not properly drawn - the rounded corners of the
windows11 style were sometimes also visible where they should not be.
Fix it by using a clip rect and move the rounded corners out of the clip
rect on the appropriate places.

Pick-to: 6.9
Task-nubmer: QTBUG-131585
Change-Id: I4eccc1e65768306a5511cda6e18db8f56fe1eff6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-01-24 05:15:11 +00:00
Thiago Macieira
39564261b2 QThread/Linux: disable the filling in of the trivial cpuset variable
We don't need it and it just makes the code slower with a large array.

Change-Id: I06dfa436309bfd249c06fffddb4cec658cf356a9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2025-01-23 18:09:38 -08:00
Mate Barany
918566aedd Update CLDR to v46.1
[ChangeLog][Third-Party Code] Updated CLDR data, used by QLocale, to
v46.1.

Task-number: QTBUG-132851
Pick-to: 6.9 6.8
Change-Id: Id08d9337e11234d0ca428c7e435808be1b044f7c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2025-01-24 02:45:39 +01:00
Marc Mutz
a01b14f1de QTemporaryFile: add private API for an overwriting rename()
In many situations, it is desireable that QTemporaryFile::rename()
overwrites an existing file, such as when emulating QSaveFile because
one would like more control over the temp file (such as passing it to
a different process). The public API of QTemporaryFile did not allow
it, making the typical Unix mktemp + mv algorithm to avoid symlink
attacks unimplementable with public Qt API.

QSaveFile is not a 100% replacement, because it always follows
symlinks and places the temporary file beside the physical target
file, keeping the symlink intact, instead of placing the tmp file
beside the symlink and clobbering it, if the target happens to be one.

Extract Method QTemporaryFilePrivate::rename() and add a bool
overwrite parameter that causes the existing
QTemporaryFileEngine::renameOverwrite() to be called in lieu of
QTemporaryFileEngine::rename(). The non-atomic path via
QFile::rename() is not affected.

This makes the functionality available as private API, in case we need
it in older branches.

Task-number: QTBUG-132646
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: I0d5ca96c0a1a557854582e1a565a3db0d8af2a95
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-01-23 22:42:17 +00:00
Felix Lionardo
2dfbfd5f9a Add libfsnotify to the core library for QNX 8
QNX 8 moved the inotify API implementation to a separate library,
libfsnotify. Added qt_config_compile_test to verify inotify in libfsnotify

Pick-to: 6.9 6.8
Change-Id: I5906d8fd0f146dc9db8d9ae2d8c0053bff21b840
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-01-23 17:14:56 -05:00
Jøger Hansegård
604b6d60d0 Use 0/nullptr to indicate invalid Windows event handle in QLocalServer
The CreateEvent function returns NULL/nullptr if it failed, not
INVALID_HANDLE_VALUE(-1).

Change-Id: I7fb94061f4e14c014bf63acb53d3eee8f295eb66
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-01-23 22:05:07 +01:00
Alexandru Croitor
0b7ff3d0a7 CMake: Add an option to pass --showinternal to qdoc
This adds an SHOW_INTERNAL option to qt_internal_add_docs that
passes the --showinternal option to qdoc.

The option can also be set for all calls by setting either the CMake
variable QT_QDOC_SHOW_INTERNAL or the environment variable.

Pick-to: 6.8 6.9
Fixes: QTBUG-118176
Change-Id: If72c4072e10bc5f12b0431a5f8abea6ee1e2bd69
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-01-23 20:06:16 +01:00
Alexandru Croitor
948b2f601d CMake: Add various option to pass extra args to qdoc execution
Calls to qt_internal_add_docs now accept the following options:
- QDOC_EXTRA_ARGS: Extra arguments to pass to qdoc
- QDOC_PREPARE_EXTRA_ARGS: Extra arguments to pass to qdoc prepare
  phase
- QDOC_GENERATE_EXTRA_ARGS: Extra arguments to pass to qdoc generate
  phase

In addition, the following cmake and environment variables can be set
to pass extra arguments to qdoc for all targets:
- QT_QDOC_EXTRA_ARGS
- QT_QDOC_PREPARE_EXTRA_ARGS
- QT_QDOC_GENERATE_EXTRA_ARGS

The cmake variables can also be set at directory-scope, before the
call to qt_internal_add_docs.

Pick-to: 6.8 6.9
Task-number: QTBUG-118176
Change-Id: I0e28f3b863d5ca4efd0256432130af1c9c965f9d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-01-23 20:06:16 +01:00
Alexandru Croitor
2fd16b2acb CMake: Clean up and document qt_internal_add_docs
Change the option handling code to be similar to our other internal
functions.
Break too long lines.
Add a doc comment.
Add a message(DEBUG) for the case when qt_internal_add_docs is still
called with one argument.
Rename doc_project variable to qdoc_conf_path.

Pick-to: 6.8 6.9
Task-number: QTBUG-118176
Change-Id: I73167f1e72e2abcdb90722ecd6ee00f7636b8a5d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-01-23 20:06:16 +01:00
Thierry Bastian
ca09bc8d7a Add support for PostgreSQL prepared statements with pgBouncer
Since 2023, pgBouncer supports prepared statements but only when
prepared/executed/removed at the protocol level.
So to support this, You need to call the appropriate functions
from libpq.
it does not change the behavior otherwise. You can note that to free
statements, libpq only has the function in v17.
Prior versions of postgresql will still use DEALLOCATE.

Fixes: QTBUG-132303
Pick-to: 6.9
Change-Id: I2456820bbea318e1715ae46617bf4d137815ca54
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2025-01-23 18:32:49 +01:00
Matti Paaso
acbbdee804 Fix Axivion analysis nightly fails
Axivion analysis for qt5 is currently ran only for linux and
qtactiveqt started to fail because it now uploads aftifacts also
for linux and is not skipped anymore. Adding condition to prevent
running Axvion analysis for qtactiveqt.

Task-number: QTQAINFRA-6752
Change-Id: I2ce141a1b7c6de387493651c4429edac65e49506
Reviewed-by: Toni Saario <toni.saario@qt.io>
2025-01-23 18:33:14 +02:00
Joerg Bornemann
ed7bc398d8 CMake: Remove transitory code from _qt_internal_find_qt_dependencies
...that tried to load Qt6Foo instead of Qt6FooPrivate. This might now
load the wrong package, since we've split CMake packages of public and
private Qt modules.

Enough time has passed, and we can assume that all
Qt6*Dependencies.cmake files have the _qt_package_name property set by
now.

Pick-to: 6.9
Task-number: QTBUG-87776
Change-Id: Icf18872dd49b1e3a82b7327027f7d6e48b656b70
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2025-01-23 15:25:49 +01:00
Cristian Le
6a4df2ac24 Make user tools symlinks relative
Fixes: QTBUG-132724
Pick-to: 6.8 6.9
Change-Id: I0f1d95ef6b66c81e2d12730eae3d5c0452a3a7a1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-01-23 15:25:48 +01:00
Cristian Le
a996442236 Export INSTALL_PUBLICBINDIR to QtBuildInternalsExtra.cmake
`INSTALL_PUBLICBINDIR` is only exported if it was defined by the user
when building QtBase. The conditional check aligns with the one used in
`qt_internal_generate_user_facing_tools_info`

Fixes: QTBUG-107016
Pick-to: 6.8 6.9
Change-Id: Id5c38555e1d22cb3c16d85261cb052c695b4de03
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-01-23 15:25:48 +01:00
Cristian Le
1192f2c877 Use _qt_internal_relative_path
Pick-to: 6.8 6.9
Change-Id: I1c4248bbf7e06536503224cbfceb57f41de019bc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-01-23 15:25:48 +01:00
Cristian Le
334acc2eb3 Add _qt_internal_relative_path
This is a compatibility function for `cmake_path(RELATIVE_PATH)`.
For CMake<3.20 it uses `file(RELATIVE_PATH)` instead

Pick-to: 6.8 6.9
Change-Id: Ibf9ca221c1753bd99dcc1820bffaea28f9bfe5af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-01-23 15:25:48 +01:00
Liang Qi
225f8e069b QDesktopUnixServices: avoid to call virtual function in constructor
This amends 1969b1a90a79dad049694bd1540f8627d5f26875 .

Pick-to: 6.9 6.8 6.5
Change-Id: I1be4e229d531f8a91e1ad3133a5b62784d18bb41
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-01-23 14:54:48 +01:00
Giuseppe D'Angelo
517dcbf42e QOpenGLEngineSharedShaders: disable copy/moves
The class manages resources via raw pointers, and as such it's certainly
not copiable. Explicitly disallow such copies. (It might be made
movable, but no-one needs to move it, so I'm disabling moves as well.)

This fixes warnings in QMetaType, which would otherwise pick up
copy/moves as the class is also marked as a Q_GADGET.

Change-Id: I983765b35304c8ab9ad42d31bcb729cfc9bfa2ac
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2025-01-23 14:14:24 +01:00
Laszlo Agocs
20b07bfa30 Drop a limitation for R8/RG8 formats for Mesa in hasOpenGLFeature
The mentioned version is from 2015.

Pick-to: 6.9
Change-Id: I330bd8ec08ab815a85d3e4e5afc44f314ade2ef6
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2025-01-23 14:14:23 +01:00
Laszlo Agocs
3c338def89 rhi: vulkan: Support initializing without a Vulkan instance given
Problem is, this has potential issues down the line. For example,
if one pops up a QQuickWindow afterwards, also with Vulkan, and
wants to do things like enabling the debug layer (QSG_RHI_DEBUG_LAYER
and similar), that will not work since the instance is already up.

In absence of better solutions, drop a warning as well and keep this
undocumented for now.

On the plus side, this allows applications to implement things like
enumerating adapters with Vulkan and then launching a QQuickWindow
with the selected adapter. With other APIs (D3D) this is a breeze,
but is impossible here due to the very unfortunate concept of Vulkan
instances, and handles such as a VkPhysicalDevice being tied to the
instance.

An application has no way of knowing what VkInstance Qt Quick will
create/use, unless the developer does the extra boilerplate to
provide their own, which is an overkill in this case. So offer some
way to make this work, even if there are some pitfalls.

Pick-to: 6.9
Change-Id: I1fc11f90cd1bf3fdac945ed5a7221f596368d30e
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2025-01-23 09:59:16 +01:00
Laszlo Agocs
4f5b1c75a9 QVulkanDefaultInstance: warn if setting flags has no effect
Pick-to: 6.9
Change-Id: Ib939e56f0e8bc3e04725fb3660d30a8d3e13fad3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
2025-01-23 09:59:13 +01:00
Laszlo Agocs
2b451c81a3 rhi: Introduce a way to enumerate adapters/physical devices
Requesting a given "adapter" (or whatever the native equivalent of that
is, e.g. a VkPhysicalDevice with Vulkan) has already been possible
either via the index-based environment-variables (QT_D3D_ADAPTER_INDEX
and QT_VK_PHYSICAL_DEVICE_INDEX), or by passing in a VkPhysicalDevice in
QRhiVulkanNativeHandles or an adapter LUID in QD3D1xNativeHandles to
create(). (the latter is what QQuickGraphicsDevice's fromAdapter() or
fromPhysicalDevice() builds on, and is one of the enablers for the
OpenXR integration in Qt Quick 3D for instance)

There was however no way to enumerate the adapters via QRhi APIs, in
order to implement something such as "iterate through the available
adapters and choose one from the list", without resorting directly to
DXGI or Vulkan. This is what enumerateAdapters() enables now.

Implemented for D3D11, D3D12, and Vulkan. There are no plans to
implement it for others for now. (meaning the resulting list is always
empty then)

For symmetry, it is also possible to get a single QRhiAdapter based on a
provided native adapter identity (i.e, LUID or VkPhysicalDevice),
although in practice that is just a heavier way to achieve the same that
was already possible by passing those native handles directly to
create() instead of going through a QRhiAdapter.

[ChangeLog][RHI] Introduced enumerateAdapters() in QRhi to provide a
an abstraction for enumerating adapters (physical devices) with
Direct 3D and Vulkan.

Fixes: QTBUG-129932
Change-Id: I072553afe594cbad6ebfa1ffe849a782c4c181db
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
2025-01-23 09:59:08 +01:00
Konsta Alajärvi
d8f75f34c9 Unblacklist tst_qrhi threeDimTexture()
Unblacklist tst_qrhi threeDimTexture() test function, by skipping
it with Android OpenGLES.

Fixes: QTQAINFRA-6333
Change-Id: I795dd73fc7b35ab065f206030458088d829be9c8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-01-23 08:44:56 +00:00