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>
Amends commit bf8a5ab418a21d802910728ed24a0a7fad230526. Just some
tidying up.
Change-Id: I3d07a7b151241317ab6bfffd3e79a40db4dab441
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
[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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
...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>
`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>
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>
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>
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>
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>
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>
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>