Commit Graph

68990 Commits (44ae4e183ee5de88c65db0f841fe0d44dcfc70bd)

Author SHA1 Message Date
Laszlo Agocs 44ae4e183e rhi: Add size param for internal buffer update used by Quick
Because reusing larger buffers for smaller data is very much a thing
in Qt Quick, depending on the scene. It happens rarely for uniform
buffers, for which this feature was originally invented, but when
vertex/index buffers switch over to being Dynamic, this same code
path is hit, and for those, recycling older QRhiBuffers for newer,
smaller data is common.

Change-Id: I41856adf6b8bb5486d05e186d3007f262e7dc987
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 28469b4dfc039601b898a1cdef873d458fbc19eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-22 08:17:27 +00:00
Thiago Macieira ffd8d3e6b9 QtDBus: disallow sending method calls without destinations on a bus
QtDBus has allowed this because the bus would stop the message and
return it to us as an UnknownMethod. But it makes no sense to send it,
so let's block it early.

For practical purposes, this allows the tst_qdbusmarshall test to
continue working regardless of which daemon is running the bus. The
message it was checking against only came from dbus-daemon; for users of
systems now running dbus-broker (like my openSUSE Tumbleweed) the
message was different and the test was failing.

Change-Id: Ia134ca414080cf243974fffd913fdad09d80cc60
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit d19db44d3f8a0ca0c69c6861e2a871de5ae7d106)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-22 07:17:08 +00:00
Thiago Macieira 7955c58bca QDBusUtil::isValidBusName: implement "contains at least two such elements"
It was in our docs but we didn't implement it. This failure allowed
QDBusMessagePrivate::toDBusMessage() to proceed in calling libdbus-1
methods, which had the validation and might crash the application.

Pick-to: 6.5 6.2
Fixes: QTBUG-130304
Change-Id: Ibb5d210c03672a363016fffd7b1a2b55c02119bd
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit f42f5b56140342238c325a014fbe8e179eff4348)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-22 07:17:01 +00:00
Allan Sandfeld Jensen db412baf62 Add optimized text rendering path for the ARGB32 A8 non-clipped case
Change-Id: If3e7a4c5f6f6c33cdf9dd8b6c7c858b004576ad5
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 7447b9d350ec0111461a5defacee7634a7470674)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-22 06:59:31 +00:00
Tor Arne Vestbø 8b9c25998f macOS: Release main thread transaction block as soon as we're done with it
Since 9122d826d2 we're presenting drawables
on the main thread, even those produced on the Qt Quick render thread, if
we are part of a displayLayer call, as we're then presenting the Metal
layer within a Core Animation transaction.

We do this by assigning a block to the layer, that we then call on the
main thread in displayLayer. This block retains the drawable, so when
we're done calling the block we need to dispose of the block as soon
as possible, to avoid stalls due to running out of drawables.

To improve on this we add a local auto-release pool around the clearing
of the main thread transaction block. In the case of displayLayer we
need to take care to also include the referencing of the transaction
block in the auto-release pool, as that makes a separate auto-released
copy of the block (and hence also the drawable).

Task-number: QTBUG-129839
Change-Id: I7663862c63977adab7b1f22a136416c8bc910c6e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 72e4cb96700cd93213d5c3ecb14cd92f4c069c65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-21 14:14:01 +00:00
Alexandru Croitor 5a67e61a0e coin: Use dynamic current branch for qtqa license checking
Coin can now dynamically refer to the current branch of the repo being
integrated in the module instructions.

Change the license checking instructions to use the current branch
of the qtqa repo, rather than the dev branch.

This makes the behavior consistent with what everyone expects, instead
of using a hardcoded qtqa branch for all stable branches.

Amends 2a0e89981a52633c497f62bad0c7d26c466493cb

Task-number: COIN-573
Task-number: QTQAINFRA-3935
Task-number: QTQAINFRA-3878
Task-number: QTQAINFRA-4975
Change-Id: I6575c2868f3a7170570803f620feb5723fbbe6df
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 6c6a63cc8f49918d1059910644bcfaa4554b12f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-21 14:13:56 +00:00
Alexandru Croitor 4a0d8b2bf8 CMake: Fix linking of qtsvg static plugins in standalone tests build
Our QtPluginConfig.cmake.in files have code to skip loading plugins
unless the repo is found in the QT_REPO_DEPENDENCIES variable
or when building standalone parts.

The problem is that QT_INTERNAL_BUILD_STANDALONE_PARTS is only
assigned a value after all the find_package calls have executed,
which is too late for the qtsvg standalone tests, because the svg icon
config file would already be loaded and skipped.

This code path checked for QT_BUILD_STANDALONE_TESTS, before the
introduction of the QT_INTERNAL_BUILD_STANDALONE_PARTS variable.

QT_BUILD_STANDALONE_TESTS is set by the qt-internal-configure-tests
script, so it is always available.

Restore the previous check for QT_BUILD_STANDALONE_TESTS, while
keeping the new variable as well.

This fixes the tst_qicon_svg test to pass in a static standalone tests
build.

Amends 62905163bf
Restores behavior of be1ee03a0f

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I19f620a39fe530bf7f96498cfad1c90621983eb6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit c0e07cc3e2817d158d05e69e1254471ff6b074e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-21 14:04:07 +00:00
Alexandru Croitor 152153cb11 CMake: When available add the repo configure line to the SBOM
When Qt is configured using the configure script, rather than directly
via CMake, we can obtain the full list of configure arguments passed
from the config.opt file.

Add the configure line to the repo project SBOM package comment field
when it is available.

Task-number: QTBUG-122899
Change-Id: I0c5554dcda2f71ec4ba034b14c82a99757dc790c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b6ee361bc7540db36c334fea0b9d355fbed9a2a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-21 08:37:27 +00:00
Alexandru Croitor 189be8f628 CMake: Allow adding content to the SBOM repo project comment
Task-number: QTBUG-122899
Change-Id: I810814afa69ddf6dc89e834f525b62d87c3aa109
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 89daa851afbce9b5c44a807883eb9b6d5ca8aab9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-21 08:37:25 +00:00
Alexandru Croitor f60bc34be7 coin: Always pass the SBOM python interpreter to configure
The Qt default has changed to always generate an SBOM for all
platforms in the CI, so we always want to pass the location of the
python interpreter meant for SBOM processing to configure.

Task-number: QTBUG-122899
Change-Id: I1042c97b9133ca37e42eb3efd1689ec1f9f9ab31
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 1f8236236b86aac1a62c405ee8f186cd43e5ff17)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-21 08:37:24 +00:00
Alexandru Croitor 4bf5a5037e coin: Remove unused QT_INTERNAL_NO_SBOM_FIND_PYTHON_FRAMEWORK var
It was removed in a previous change and does nothing now.

Task-number: QTBUG-122899
Change-Id: I7a84c243c08a65e445cbd657eb281b37e68f1893
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 3acc310f9e90ff3ecd4135a184e8f4b7b366a75d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-21 08:37:22 +00:00
Alexandru Croitor 57caaff5fc CMake: Change SBOM generation to be enabled by default (mostly)
Previously SBOM generation was opt-in.

This patch changes the generation of the plain-text tag:value SBOM
to be enabled by default, except for:
- developer builds
- no-prefix builds
- standalone tests or examples
- cmake build tests

The JSON SBOM generation and the verification steps have also been
changed to be enabled by default, but only if the Python dependencies
can be found. If the dependencies are not found, the build will
skip the generation and verification steps.

Four new configure options have been added to control these aspects:
-(no-)sbom-json: Allows explicitly enabling or disabling JSON SBOM
  generation

-(no-)sbom-json-required: Fails the build if JSON SBOM generation
  Python dependencies are not found

-(no-)sbom-verify: Allows explicitly enabling or disabling SBOM
  verification

-(no-)sbom-verify-required: Fails the build if SBOM verification
  Python dependencies are not found

There are corresponding CMake variables for each of the configure
options, see the cmake mapping document.

[ChangeLog][Build Systems] SBOM generation is now enabled by default,
when building Qt, except for developer builds and no-prefix builds.
JSON SBOM generation is enabled by default if the required Python
dependencies are available.

Task-number: QTBUG-122899
Change-Id: I6dbe1869f8342154a89ff2ab84ac53c9ef1b2eb7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 96c5e55c111d957bd7b5294d2c2eb1d919cce871)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-21 08:37:20 +00:00
Alexandru Croitor 446d8414ef CMake: Split SBOM verification and NTIA compliance into separate ops
This will allow us to run only the first, but not the second, if the
second won't have it's dependencies met.

Task-number: QTBUG-122899
Change-Id: I141b4bd3b76a71495c760a118bdf1397ee7e16b5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f15b3c864ee47177d4f13cf7a047f245c11c4d00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-21 08:37:19 +00:00
Alexandru Croitor c69ff63ab3 CMake: Rework SBOM python dependency lookup and handling
Introduce a bunch of helper functions to split out the finding of a
specific python interpreter, a specific python dependency within a
given python interpreter, and the handling of dependencies for each of
the possible SBOM operations: GENERATE_JSON, VERIFY_SBOM, and
RUN_NTIA.

In a future change this will allow us to conditionally enable certain
operations, depending on which dependencies are available, without
failing the build outright.

One behavior change is better logging of what goes wrong if a
dependency is missing.

Another is the double look up of python on macOS, to account for the
system framework python not having the required dependencies.
These was previously an internal opt in, but now it is done
automatically.

Task-number: QTBUG-122899
Change-Id: I3054f2649c0092dc5f2d3e299065f0f62dc6c5fb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 29a435faf84fbe9a80a3054c2dcce4d691b46e20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-21 08:37:17 +00:00
Alexandru Croitor 8113dc73f0 CMake: Fix DESTDIR handling in SBOM checksum verification
The DESTDIR env var needs to be evaluated at install time, not
configure time, so the $ENV{} needs to be escaped in the generated
script.

Also improve the error message a bit, to say which path exactly it
expected to read.

This fixes SBOM generation for the debian package builds.

Task-number: QTBUG-122899
Change-Id: I6869f0054601dcb35ae7ad7b55f808df4dc12311
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 08d5d9e9da8a4815be7dd2c952cb45a6597cc077)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-21 08:37:15 +00:00
Alexandru Croitor d81f226fd4 CMake: Check for target existence before recording system lib spdx id
Otherwise the spdx id recording function might fail when trying to
retrieve the spdx id from the non-existent target.

Task-number: QTBUG-122899
Change-Id: I1f6b3d7bc88ff4aa28de1468cd86152747cc3bdb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4e120f265cc5d96399b01402ed53568abecde3d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-21 08:37:13 +00:00
Alexandru Croitor 5a9f324a46 CMake: Guard some MSVC flags not understood by clang-cl frontend
Due to various reasons, Qt WebEngine needs to be built with clang-cl,
while qtbase and other dependencies with MSVC.

clang-cl does not understand all MSVC-style options, which are
recorded and propagated through the PlatformCommonInternal target
which is configured in qtbase using MSVC.

Guard the flags that are not understood by clang-cl with a genex
condition that checks that the compiler is not clang (which implies
clang-cl, because afaik it's not possible to use gcc frontend of clang
against an MSVC-built qtbase).

Change-Id: Ibf2c96399a8322ce13814c9c6afa5b57fd8885be
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Zhao Yuhang <2546789017@qq.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 515ad07a12c4bf190545ae38eff588f7b979d68e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-21 08:36:04 +00:00
Ahmad Samir 1487d7edb3 QThreadPool: handle negative expiryTimeouts
When setting/getting the expiryTimeout.

Negative values mean "never expire", so use duration::max(), which
QDeadlineTimer interprets as QDeadline::Forever.

Amends (and partially reverts) c57027199996d0f0d2ac8ebc4505c78afa54ab5a

Task-number: QTBUG-129898
Change-Id: I8f141cd3fc3c2ff4d21ba2d9663619bc507aeca4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4678d96d874c21b69f4942e3bfdc5fc97128cf4e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-20 21:49:34 +00:00
Mårten Nordheim ad883b78ac Http2: Always return an error on error
Instead of returning a nullptr in a potential OOM case.

Change-Id: Ib438eaa7550d193cb1207a5d3e48a78b882fa56e
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit 238f656d613fc100a8d17ccc980843b39c0056eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-20 20:16:58 +00:00
David Faure f60bef8768 Tika mimetypes: make SVG magic more tolerant to doctype and comments
Detected by qthttpserver's unittests

Change-Id: I6d60ec232ceb5474f24f22ad822e55a9f2444fae
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit c612a82bbaa0411ca54fbabd2ca1760f0c5e0645)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-20 11:05:04 +00:00
David Faure eb9fd6dbd4 QTreeView: make autoExpand feature usable, it should never auto-collapse
The code would toggle between expanded and collapsed every time the
mouse moves over the item (after the autoExpandDelay), which was unusable.
As reporters point out (and I fully agree), collapsing the item under
the mouse is never wanted.

I attempted an auto-collapse when moving out of the current subtree,
but that was not usable either: when moving the mouse down, the auto-collapsing
of a previous sibling means that the item we're targeting has suddenly jumped
up, it's a frustrating experience trying to aim for a moving target.

The only behavior that is usable is the most simple one: auto expand,
never auto collapse.

Fixes: QTBUG-2553
Change-Id: I2c56dd668b2df4ec23bbbe829da6e8cdd049f376
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 195a35dbfb2453ae37d9541c82745c5795fe8b9c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-20 02:13:24 +00:00
Marc Mutz 456702e7e0 [doc] Fix qHash(QPixmapCache::Key) overload's absent docs
The \fn was missing in front of the signature line, and the scope
wasn't correct, either (Key:: missing). Add both.

Also remove the unneeded default argument (qdoc figures those out by
itself).

Amends 7fa3267fda.

Change-Id: I7732760945ff23c0d83e06a75b3db8213ca020e5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 095340fc1173537ee286f9a37b799ccf2e602508)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 10:09:37 +00:00
Axel Spoerl 90ed68910f Improve logging in QWindowPrivate::forwardToPopup()
Debugging output printed the return value of event->isAccepted() without
information what the value represents.

Add it.

Pick-to: 6.8.0
Change-Id: Ifbef69fed5d4aadd732c234c2ac74495560e65b6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 5d028371bd8d775703739db51936cbd582626580)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 10:09:37 +00:00
Tasuku Suzuki 16410ae7be QPainterPath: reset .nospace() in QDebug operator<<(...)
Change-Id: Ic06f376fe01db6d7340fa0e7071b01e00aa8caf9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fb00ecd0a7925f95fa32a7772e9c70149468ee2d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 10:09:37 +00:00
Ahmad Samir ff4252b0b6 QAbstractFileEngine: remove beginEntryList(QDir::Filters)
It was kept so as not to break compilation of user code (overriding a
function that doesn't exist in the base class). But as Marcus Tillmanns
pointed out in a qtcreator code review, it can't work because
QDirListing calls the virutal
engine->beginEntryList(QDirListing::IteratorFlags).

Removing beginEntryList(QDir::Filters) and getting a compile-timer error
is better than the code failing silently in user code (all sub-classes
of QAbstractFileEngine in qtbase have been already ported).

QDir::entryList() isn't affected because it calls
QAbstractFileEngine::entryList() which has an overload that works with
QDir::Filters.

Change-Id: I3cb18402f602ac78a6b29be57e59febb2b9db7c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4fecfcc867f8215defaa40b50f0340654a36b4c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 10:09:37 +00:00
Axel Spoerl 5abc6e9ccb QWindowsWindow: Refactor corrections related to task bar on top / left
33874a9424cd03c21ca9986a39c383b3689f03d2 corrected a size-contrained
window's position when maximized. Restoring such a window's size
moved the window downwards as well, if the task bar was on top. With
the task bar on the left, such maximizing the window caused parts of it
to be off screen to the right. These bugs affect only Windows 10,
because Windows 11 only allows the task bar to be at the bottom.

Factor out all corrections to QWindowsWindow::correctWindowPlacement().
Correct placement when restoring size of a maximized, size-constrained
window.
Correct width of a height-constrained, maximized window.
Correct height of a width-constrained, maximized window.

Change-Id: I9a1e0cf4708e8c579595fdbdc7f16b927be53b05
Done-with: Johannes Grunenberg <nerixdev@outlook.de>
Fixes: QTBUG-129405
Fixes: QTBUG-129679
Task-number: QTBUG-123752
Pick-to: 6.5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 06fcb3dfe69e175f94d112ecef45b091598f5ae5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 10:09:36 +00:00
Christian Ehrlicher 18b01267a6 QMenu: fix PM_SubMenuOverlap in rtl mode
The submenu in rtl mode was not placed correctly due to the missing
handling of PM_SubMenuOverlap.

Pick-to: 6.5
Task-number: QTBUG-129716
Change-Id: I0a0d6a9007b4427a95a92b81a3450d65b944189c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 87c6d142d25bec937c0a521830fcb9e06d921114)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 10:09:36 +00:00
Tim Blechmann cc331ef757 TestLib: enable watchdog during _data and init/cleanupTestCase
The watchdog is not enabled when running initTestCase and friends. We
therefore miss some deadlocks in these methods.

Task-number: QTBUG-128510
Change-Id: I119a1ee04c45df00b62f9d5990075e4bf8814142
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 9154bb8f19815acc64b69b85a8c0e5ab8b96ec49)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:50:32 +00:00
Mårten Nordheim 701263379a QFreeList: return timer IDs with the serial included
When a timer gets unregistered there is a chance that a new timer is
registered again immediately and gets the same ID.
On Windows this is a problem because there may be WM_TIMER messages
remaining in the native event loop that have not been processed.
This may result in unexpected timeouts for newly started timers.

By not masking away the serial/generation from the ID we generate
we will no longer return the same ID that was just freed.

While QFreeList mostly was prepared to be used in this way, one function
was not, and the tests were written with the assumption that the serial
was masked out. So this patch also addresses that.

Fixes: QTBUG-124496
Pick-to: 6.7 6.5
Change-Id: If6784815bfa41e497cbc4e00bef51da3ded5f255
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
(cherry picked from commit 21e9875d62414306fde9738ab255e55f22d1c8ed)
2024-10-19 06:50:26 +00:00
Tinja Paavoseppä d8570cb1a8 QtQuick for Android: Do not terminate Qt during configuration change
In Android the default behavior is that when a configuration change,
e.g. an orientation change, happens, the Activity is destroyed and
a new one is created with the new configuration.

In regular Qt for Android, this is not a problem as the QtActivity
overrides this behavior and swicthes the configuration without
recreating the Activity. However in QtQuick for Android i.e.
when adding a QtQuickView to an otherwise regular Android app,
we cannot rely on that being the case. Currently, if for example
the orientation is changed with an Activity that has a QtQuickView
in it and the default behavior is used, it will crash, as the
destruction of the Activity will terminate the Qt runtime, and
whne creating it anew the runtime is not properly restarted.

This patch does not fix the underlying issue of not restaring the
Qt runtime properly, but it adds a check so we don't terminate
it when the reason for the Activity destruction is a configuration
change, as in those cases it will anyway be recreated immediately,
meaning a full termination is too heavyhanded anyway.

Task-number: QTBUG-123711
Change-Id: Ia44ab8f55855aa5d54c5fb25e3cca90a9c0feaaa
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit aef9fff1d7a0de98cb446a634fdf2812e45f19c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:50:24 +00:00
Morten Sørvig 626d19b2a0 wasm: disable network examples
http and rsslisting compile and can work, the rest are
don't build and are probably too low level.

Change-Id: I031494178d0cace10951c3eb5495fbbf0f73d717
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit d211b2ba7cec6ad5d98f0e2d82af8b350a38242b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:50:22 +00:00
Paul Wicking 72a340570b Doc: Wrap code snippet in \code \endcode
Fixes: QTBUG-129999
Change-Id: I0f7b25630a1e6f97453806ad778e90f610de0fa9
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
(cherry picked from commit 9b11c3736e9ff23b0febce80c3f488099f1229fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:49:58 +00:00
Andreas Eliasson 308181e875 Doc: Fix link in note for QRhi::nextResourceUpdateBatch()
The correct link should be QRhiResourceUpdateBatch::release(), not
QRhiResourceUpdateBatch::destroy().

Fixes: QTBUG-127111
Pick-to: 6.7
Change-Id: Iec370f5f4b2c9cc74f8ff96b8d5a027be79e8817
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 93136f7c55e545598a10e617f4951094bdbca9ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:49:56 +00:00
Alexey Edelev e388c1caeb Add _qt_internal_execute_proccess_in_qt_env macro
The macro sets the Qt related PATHs and attempts to call
execute_proccess command in resulting environment. This command should
be used to reproduce the _qt_internal_generate_tool_command_wrapper
behavior for execute_process. Since we may control the environment
during the CMake execution, there is no need to use a proxy batch
script to configure it.

The use of tool command wrapper in execute_process has a potential
issue related to the invalid command line processing. cmd.exe is
unable to parse command line correctly if the first argument is batch
script containing spaces and the follow arguments contain spaces as
well. execute_process internals use API that has exact same behavior.

Task-number: QTBUG-128420
Pick-to: 6.7 6.5
Change-Id: I2339c85ed611da89176629878db550b7b7976367
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b68b3e773c68b577c55db76ca5c211e919ae8136)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:49:55 +00:00
Alexey Edelev 6c1f4c6c56 Guard the QDateTimeEdit usage with the respective feature check
QDateTimeEdit and the respective header are available only when the
'datetimeedit' feature is enabled.

Amends bfe8ac4ebff7a1e8114068f2f46e73c588735690

Fixes: QTBUG-129481
Pick-to: 6.7
Change-Id: Ia9595bb17b47fd7221742665f1242a5f85ed6c0d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 00bcf5a867d0414cd894e46d085feef94aa317b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:49:53 +00:00
Alexandru Croitor 7f45fdefd6 CMake: Add a way to skip configuring the doc targets
Can be useful for non-Makefile and Ninja generators, even if they
are unsupported for building Qt.

Change-Id: I02a622c89f725c3ae5b51ea345a530eaa5529976
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 08d1d113f140b1b4be5a387696a8a35934905d64)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:49:28 +00:00
Tor Arne Vestbø 11c8b80f4b macOS: Avoid creating 0x0 size IOSurface in backing-store
During screen attach/detach, we may end up in a situation where the
window has a 0x0 size, and we end up painting to the window, in which
case we were trying to create an IOSurface of size 0x0. This resulted
in the creation failing, triggering an assert.

We now guard the surface creation with a check for the backing store
size being non-empty, and for empty sizes we fall back to a plain
null-QImage for our paint device.

Fixes: QTBUG-128731
Pick-to: 6.5 6.2
Invaluable-research-by: Viktor Arvidsson
Change-Id: I06ea582c87fb0d359387ef9495451801612701c9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 58caa18d2ff1a67e16f960f5bd6b804cdaec4063)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:49:27 +00:00
Timur Pocheptsov dc885e39c9 QFileDialog: disconnect nativeEnterDirectory in dtor
QIOSFileDialog emits directoryEntered from its hide/setVisible
after QFileDialog is a QDialog already (in the process of destruction).
This results in an ssert: "ASSERT failure in QFileDialog: "Called object is
not of the correct type (class destructor may have already run)"",

Fixes: QTBUG-130133
Change-Id: I8471a8434f7ea854a91b989bb3a6f3b962143ea8
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 2083daf79bc53a65a821e1cd3463638ac0c65f2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:49:25 +00:00
Christian Ehrlicher 993fa70777 Windows11Style: add two helper functions to avoid code duplication
Add and use the two helper functions
 - buttonFillBrush() returning the correct fill brush for a button
 - buttonLabelPen() returning the correct pen for a button

Change-Id: I6ee0dbe2490ad5c875b75d13b48371b5e798c290
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 436abff5cce198bb90c90e92104922373a3f99cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:49:13 +00:00
Thiago Macieira 70daae20b1 QThread: use load/store operations with explicit ordering
The implicit load is an acquire, which isn't necessary in any of these
cases, including the two liens changing the store: they were creating a
temporary QAtomicPointer, which introduced the loadAcquire().

I've left the qCDebug() lines alone.

Pick-to: 6.5
Change-Id: If45e068eaaf3cd4d2c81fffd1459a779b4eb4110
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 6806391600b5398d4fdb3c4d2d5e442289522756)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-18 16:10:08 +00:00
Tor Arne Vestbø 34740b9363 qwsi: Teach handleContextMenuEvent about synchronous delivery
Which also lets it return the acceptance state of the event.

At the moment the acceptance state of QContextMenuEvent is a bit
of a mess, so the QWSI acceptance state can't be trusted, but
this opens up the door to using it at a later point.

Task-number: QTBUG-67331
Change-Id: I75b586f90e25122bc9e25880d3787740b025c892
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit bbc3a7d7ba683c71de4662a1eeac0b7d3dfa6b11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-18 12:27:34 +00:00
Tor Arne Vestbø 85ec8df827 macOS: Reflect QWindow's color space after creation
If an explicit color space has been set, we assume that we can apply
that to the CAMetalLayer or IOSurface we use when blitting our content.

If not we want to reflect the NSWindow's color space, which will in turn
reflect the NSScreen color space.

Task-number: QTBUG-129499
Change-Id: Idc465af39dafc80be0edd014abc55eb501ae1f89
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a3a691c5a359ad1c3f76248c270273ec13fe96fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-18 12:27:32 +00:00
Tor Arne Vestbø bb80366b1c iOS: Don't intersect window maximized/fullscreen size with nil UIWindow
When making a QWindow maximized or fullscreen we intersect its final
geometry with that of its UIWindow, as in the case of split-view or
floating windows on iOS the UIWindow size will be smaller than the
corresponding UIScreen.

However, after 76ebf51bc0 we no longer
track UIWindows via UIScreen, and instead manage them as part of the
UIWindowScene. Unfortunately the default scene that iOS manages is
created and connected after returning from didFinishLaunching, which
means that during main() there is no UIWindow. Attempts at manually
connecting this session before main via activateSceneSessionForRequest
were not successful, as we don't support multiple window scenes (yet).

Intersecting the window geometry to this non-existent window during
setWindowState() would result in an initial 0x0 size for windows.
Which would normally be okey, because once we have a UIWindow we re-
apply the window state, resulting in new QWindow geometry.

However the initial 0x0 size can in some rare scenarios trigger
QWidgets into setting the Qt::WA_OutsideWSRange attribute on the
top level widget, and due to a possible bug in QWidgetWindow, this
attribute is not reset once the QWidgetWindow receives an updated
resize event.

As a workaround for the widget issue, and to restore the semantics
of receiving an initial valid size of the window, we skip the logic
of intersecting the geometry with the UIWindow if we don't have one
yet.

Note the for visionOS and iOS applications running on macOS we
rely solely on the UIWindow for geometry, which means that this
issue still exists in those environments as long as the underlying
widget issue is not fixed.

Fixes: QTBUG-129472
Change-Id: Id81c356446f6e69f8a1eda59272ac04f02cc005f
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit b78baf634c6c2b8165432bf1e22a96abb2016f42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-18 12:27:31 +00:00
Even Oscar Andersen 2bd01602dc wasm: Fix tooltip visible
Fixes a problem where tooltips only worked for the first instance
activated.

(cherry picked from commit d69348ed4d659f9408ce74f3b08ee7e9104dde00)
Fixes: QTBUG-129234
Change-Id: I45619b1ca8001b74b148b98a8795000630dcacf7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-10-18 06:07:13 +00:00
Christian Ehrlicher 9e22cd089e SQL/PostgreSQL: fix parsing timestamptz return values
When setting the timezone explicitly to something different to the
localtime (e.g. UTC), the strings returned for timestamptz columns
contain a '+xx' annotation which resulted in a parser error.

Fixes: QTBUG-129983
Change-Id: I4f5e45860e88a5c44b2f1409dae667984ac90913
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 00edd47762df96614a38f1362c2131e539e43abd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-18 05:10:08 +00:00
Ahmad Samir 55a8050d1e QDirIterator: don't crash with next() after hasNext() returned false
The typical use-case is calling hasNext() first before using next, but
the API docs say that calling next() even when hasNext() is false,
should just return an empty string.

[ChangeLog][QtCore][QDirIterator] Fixed a crash that happened if you
called next() after hasNext() had already returned false. Ideally you
should never call next() without first calling hasNext() as that could
lead to unexpected results (for example, infinite loops).

Fixes: QTBUG-130142
Change-Id: If0a8b1fe7dbd13b45793409a7a241e53c7257f24
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c7691842f743f568a073582c8f0cacd6ee188f98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-18 01:52:28 +00:00
Thiago Macieira e25150ca29 QFactoryLoader: fix the ability to load symlinks to plugins
Amends commit 7cf39bd785, which changed to
use QDirListing but used FilesOnly. As documented, that does not include
symlinks to files.

I'm updating a few other uses of FilesOnly where they were ported from
QDir::Files and it would be reasonable to expect that symlink to files
would be included. That's why I've left QNetworkDiskCache alone.

Fixes: QTBUG-130109
Change-Id: I1fa195b42fd5e00be157fffd6c861f6ddb1eeed1
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 56fa23911c3a0681de39601489d51805e208dc03)
2024-10-17 17:01:41 -07:00
Tor Arne Vestbø 5baa0d759b iOS: Don't intersect window maximized/fullscreen size with nil UIWindow
When making a QWindow maximized or fullscreen we intersect its final
geometry with that of its UIWindow, as in the case of split-view or
floating windows on iOS the UIWindow size will be smaller than the
corresponding UIScreen.

However, after 76ebf51bc0 we no longer
track UIWindows via UIScreen, and instead manage them as part of the
UIWindowScene. Unfortunately the default scene that iOS manages is
created and connected after returning from didFinishLaunching, which
means that during main() there is no UIWindow. Attempts at manually
connecting this session before main via activateSceneSessionForRequest
were not successful, as we don't support multiple window scenes (yet).

Intersecting the window geometry to this non-existent window during
setWindowState() would result in an initial 0x0 size for windows.
Which would normally be okey, because once we have a UIWindow we re-
apply the window state, resulting in new QWindow geometry.

However the initial 0x0 size can in some rare scenarios trigger
QWidgets into setting the Qt::WA_OutsideWSRange attribute on the
top level widget, and due to a possible bug in QWidgetWindow, this
attribute is not reset once the QWidgetWindow receives an updated
resize event.

As a workaround for the widget issue, and to restore the semantics
of receiving an initial valid size of the window, we skip the logic
of intersecting the geometry with the UIWindow if we don't have one
yet.

Note the for visionOS and iOS applications running on macOS we
rely solely on the UIWindow for geometry, which means that this
issue still exists in those environments as long as the underlying
widget issue is not fixed.

Fixes: QTBUG-129472
Change-Id: Id81c356446f6e69f8a1eda59272ac04f02cc005f
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit b78baf634c6c2b8165432bf1e22a96abb2016f42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-17 23:40:16 +00:00
Tor Arne Vestbø e3594963f3 macOS: Reflect QWindow's color space after creation
If an explicit color space has been set, we assume that we can apply
that to the CAMetalLayer or IOSurface we use when blitting our content.

If not we want to reflect the NSWindow's color space, which will in turn
reflect the NSScreen color space.

Task-number: QTBUG-129499
Change-Id: Idc465af39dafc80be0edd014abc55eb501ae1f89
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a3a691c5a359ad1c3f76248c270273ec13fe96fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-17 23:40:16 +00:00
Tor Arne Vestbø 787b221308 qwsi: Teach handleContextMenuEvent about synchronous delivery
Which also lets it return the acceptance state of the event.

At the moment the acceptance state of QContextMenuEvent is a bit
of a mess, so the QWSI acceptance state can't be trusted, but
this opens up the door to using it at a later point.

Task-number: QTBUG-67331
Change-Id: I75b586f90e25122bc9e25880d3787740b025c892
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit bbc3a7d7ba683c71de4662a1eeac0b7d3dfa6b11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-17 23:40:16 +00:00