65025 Commits

Author SHA1 Message Date
Volker Hilsheimer
f1c59a351a JNI API review: use has-a-QJniObject relationship for QtJniTypes types
Don't subclass QJniObject. It's not necessary, and gets us into UB
territory due to QJniObject not having a virtual destructor. Also,
rename the helper class to JObject, as Object is a valid Java class
that one might want to be able to declare explicitly.

Instead, give the declared QtJniTypes types a QJniObject member that
they forward the calls to. That requires some duplication of APIs, but
at the same time makes it unnecessary to explicitly remove the old
QJniObject APIs that we want to ultimately deprecate.

We need to specialize a few more of the conversion routines to handle
such types now, as QJniObject is no longer a base class. To be able to
do that we need to add a base class that we can test for, and that has
the APIs that don't depend on the template parameter.

Since we now need to know about QtJniTypes::JObject(Base) in the
conversion routines that are implemented in qjniobject.h, we have to
move these base types into that header as well. This reduces the
qjnitypes.h header to the macros for declaring types and a few helpers
for native methods, which is perhaps how it should be anyway.

Change-Id: If2052a79a108fdb62ca71c88f4fa04d9f5ea2c4b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a5d14a9f5cfe41784960fe825609d91b9a18c17e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-19 08:02:45 +00:00
Assam Boudjelthia
73521467d2 AndroidTestRunner: make build command program deduction more robust
Currently, if the cmake program path passed to androidtestrunner
contains space, QProcess will get an invalid program path. To fix
that, quote the cmake command passed to androidtestrunner and use
QProcess::splitCommand() to get the program and args list.

Task-number: QTBUG-105524
Change-Id: Icb665033884127972bff205157ff22aa469c135c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a1b1759abfce0972a75072893148fc8ed7fa6bd2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 21:18:06 +00:00
Assam Boudjelthia
65553541af Android:CMake: add a group for Android properties
This allows to have a full list of up-to-date CMake properties
or variables to be shown in the Android docs.

Task-number: QTBUG-115020
Change-Id: I6a75586432fc374f1b4affe0468cd55bad1a868f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a5ce49cbeb7a3614d7ddf299933adc183fee1ce5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 21:18:05 +00:00
Christian Ehrlicher
049b826b39 QPA/Windows: remove unused and outdated documentation
The documentation about QWindowsIntegration is outdated since ages and
not used anywhere so remove it.

Change-Id: I3addb77f2024bfc8239aa57a866e9bdb8afc8381
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
(cherry picked from commit faf040d307dce583b0f1e8b5b2d9e30c48134d8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 20:55:40 +00:00
Joerg Bornemann
5065fb780f CMake: Add deployment hooks for the generic deploy tool
Add a way to run code after qt_deploy_runtime_dependencies has finished
its job.

Motivation: To deploy QtWebEngine-specific assets we must call a
QtWebEngine-specific deployment function that is defined in the
QtWebEngineCore module.

Qt modules (and other code) can now register a deployment hook with
_qt_internal_add_deployment_hook(my_hook). The function my_hook will be
called at the end of _qt_internal_generic_deployqt.

The function my_hook will be called with all arguments that were passed
to _qt_internal_generic_deployqt plus a list of resolved dependencies.
The hook can use this list of dependencies to decide whether to deploy
files.

Pick-to: 6.6 6.5
Task-number: QTBUG-119077
Change-Id: I07ab2f6b3a0ea399b43409b4a0498dbf2f52664f
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 21bf313ce65e248793f36363a510539f6e658771)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 20:55:39 +00:00
Joerg Bornemann
e4697acbc8 CMake: Add LIBEXEC_DIR argument to qt_deploy_runtime_dependencies
[ChangeLog][CMake] The qt_deploy_runtime_dependencies function gained
the LIBEXEC_DIR argument to set the directory for deploying helper
executables on Unix derivatives.

Change-Id: Icf2b0b439a0e635caa4d9bd2f6950bec74f97c3b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit f355f4fe7ea36c6d2d3a67332a183c9fa7e61b7e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 20:55:37 +00:00
Joerg Bornemann
d62b4d84c1 CMake: Add QT_DEPLOY_LIBEXEC_DIR
[ChangeLog][CMake] Added the deployment variable QT_DEPLOY_LIBEXEC_DIR.

This variable can be used in CMake deployment scripts to install helper
binaries of a project. In particular, this directory is going to be used
for deploying the QtWebEngineProcess executable.

Task-number: QTBUG-119077
Change-Id: Ia2502af696c53943ad13e3944c8debf2dfd8daee
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 12b4085f45317b1f88fb95f3c3a5f45dfc8f8848)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 20:55:36 +00:00
Joerg Bornemann
640204df7b CMake: Prepare deployment of projects using QtWebEngine
Store the locations of INSTALL_DATA and INSTALL_LIBEXECS in
.qt/QtDeploySupport.cmake which is generated for every project.

This information will be used to locate the helper binary and resources
of QtWebEngine.

Pick-to: 6.6 6.5
Task-number: QTBUG-119077
Change-Id: I2fb6f9b31fd1dcd872365d020c8ac71db426fdec
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 32940a8ea42cb6d6edea662187ebc9146cbc9e29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 20:55:29 +00:00
Christian Ehrlicher
841c21d548 QPA/Windows: remove unneeded check for outdated MinGW version
Remove an unused ifdef for MinGW < 3 which is no longer needed

Change-Id: Id6a647982c22a1bbf5139e85aace1f37844400a9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 126ae08601b4745dfb9a14bfa06bfa3de70078bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 20:55:27 +00:00
Volker Hilsheimer
6c36e48ed8 Blacklist QEventLoop test on QNX
Both the GUI and core version of that test is flaky on QNX.

Pick-to: 6.6
Task-number: QTBUG-119359
Change-Id: Ied7013e04bdd12270a84ab32d2bd4e45c52136c3
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
(cherry picked from commit 240ea74b25469ca00ef39a0a3a00db12e3d387ed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 20:55:26 +00:00
Alexander Volkov
79aa84aec2 Don't search more generic icons in Applications and MimeTypes contexts
According to the specification
https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html#guidelines
1) "the dash “-” character is used to separate levels of specificity in
   icon names, for all contexts other than MimeTypes"
2) "the “Applications” context should not use this method of falling
   back to more generic icons"

Pick-to: 6.6
Change-Id: Ia3536141158a4b6c1c4f85db8ad890514cf19e84
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e0c435cbfeaf1b82f759910fbf05d13e55d4f95f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 19:46:02 +00:00
Tero Heikkinen
364bffd2c4 Coin: Add native MSVC ARM64 instructions
Task-number: QTQAINFRA-5855
Pick-to: 6.6
Change-Id: I95a3b5f44c2513becb0bdbd5f56c0a5e36e889d9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 8dffb3c5e3cf419d8428b09d433d199e5dbff904)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 19:46:02 +00:00
Kai Köhne
073fc0ed5c Doc: Do not translate company and product names in footer
Pick-to: 6.6
Change-Id: Iccd4ca02f5474763591bf11a3887ccf4e38a32be
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 0bf7d64ebdff44586f9023e811b2b4fd3142ca57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 13:15:04 +00:00
Kai Köhne
3d36e673bc Doc: Remove references to Qt 4 in Qt 5.0 in Qt Core documentation
Pick-to: 6.6
Change-Id: Ide0c1ed441c923753f1e81141460719161662c15
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit a659dcf031e6c4ce112a9ec2e6d8f94f3ce96992)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 12:56:14 +00:00
Michael Weghorn
6d4c847c33 a11y: QComboBox: Reset all model connections when setting model
When setting the model either directly for the combobox
itself or for the combobox's view, disconnect from the model
signals and connect to them anew. Always set the model for the
view first before connecting the combobox's own slots to the model's
signals. Since slots are activated in the order in which they are
connected [1] and both of them are connected to the
QAbstractItemModel::rowsInserted signal, this ensures that the
QAbstractItemViewPrivate::rowsInserted/QListView::rowsInserted
slot will get activated before the QComboBoxPrivate::rowsInserted one.
(QAbstractItemView::setModel connects its slots to the model's signals.)

Activating these slots the other way around is problematic
as described in more detail in
ecef7046245f3adee9366d3543e4ed2a09f65735 and QTBUG-120121.
(macOS accessibility bridge depends on
QAbstractItemViewPrivate::rowsInserted to
update its table representation, which may be necessary
before activating other slots; ATs or platform a11y caches
may depend on correct event order.)

In a quick test, this commit fixes the QTBUG-119526 crash reliably
reproducible after 5093e517b924074ab6e63658c87237be315a17e6
even without the previous fix ecef7046245f3adee9366d3543e4ed2a09f65735
in place. However, leave that one in place, too, as
relying on the order in which the connected slots are called
is quite fragile (s. the discussion in the Gerrit change
for ecef7046245f3adee9366d3543e4ed2a09f65735).

[1] https://doc.qt.io/qt-6/qobject.html#connect

Fixes: QTBUG-120121
Task-number: QTBUG-119526
Pick-to: 6.6 6.5
Change-Id: If75fef661f7fcfc1e30e90ec851a2555cf25a65d
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 7120859fdb34cb7d80a183f1a8327b88d0fa7e10)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 11:12:39 +00:00
Timothée Keller
d2881ae09b Windows QPA: don't override user-removed margins
When calculating margins, added a check to see if the window rect and
the client rect are the same size. If they are, we return early, to
avoid overwriting user-defined specific margins.

Fixes: QTBUG-117704
Pick-to: 6.6 6.5
Change-Id: I9947feab4cb900293fb6be6cf09c56268f38d64a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 03a4164206d64151da7e0b0f850063e501bdea57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-18 08:47:48 +00:00
Alexandru Croitor
01d12a2d98 CMake: Deploy correct arch files when cross-compiling to arm Windows
When cross-compiling a user project from x86_64 to arm64 MSVC Windows
target, during deployment we need to deploy arm libraries.

By default because we use an x86_64 windeployqt, it always deploys
x86_64 libraries.

Make sure to pass the path to the target WoA qtpaths.bat file to
windeployqt, so it deploys arm libraries.

Pick-to: 6.6 6.5
Fixes: QTBUG-119619
Change-Id: Ib3b5498ae906726d1f9e0919333c102898b48ea9
Reviewed-by: 🌴 Alexey Edelev 🌴 <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 571201603acc731330c9af42a3aca9cda41d38fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-17 22:48:20 +00:00
Mårten Nordheim
79d32d5b02 Fix FindWrapResolv on systems that complaing about uninit vars
The compile test would fail on certain systems due to usage of
uninitialized variable.

Amends 4a46ba1209907796f4a14f6feb35ed4d70155d7d

Fixes: QTBUG-120141
Pick-to: 6.6
Change-Id: I4ebbd9dcc820a26c4f8cec0460c5dacbd85c4d4a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 75964763660cb131a0afe7b0bc051fd901939821)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-17 17:57:23 +00:00
Marc Mutz
61566fa52d tst_qxp_function_ref: check that function_ref's are trivially copyable
Mandated by P0792R9 already, but we never checked and P0792R14 has
user-defaulted assignment operators showing up in the synopsis now,
so make sure we don't accidentally break this going forward.

Amends 29b65c98e720056e87334ce88a683969e57efd3d.

Pick-to: 6.6 6.5
Change-Id: Ief9c5ff30895f8bfccec1c24d1777d3dab76c95a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 4271114dc6b6c699efe11dc1a2b8946d2bbbb241)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-17 09:53:26 +00:00
Marc Mutz
672448c712 qxp::function_ref: reuse a constraint for the deduction guide
No functional change, just using the already-existing named constraint
instead of more enable_if fiddling.

Amends 29b65c98e720056e87334ce88a683969e57efd3d.

Pick-to: 6.6 6.5
Change-Id: Idae4962834f14e2a5273099b5611ebcbb2a54447
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 41c41b4ba58ee4a7d5f66d8f03d40b8631ba7547)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-17 09:53:26 +00:00
Marc Mutz
0f675e0f62 qxp::function_ref: simplify the constraint on op=(T) = delete
Drop the remove_cvref_t (T is already decayed by way of take-by-value)
and apply De Morgan's Law.

No functional change, just fewer templates to instantiate.

Amends 29b65c98e720056e87334ce88a683969e57efd3d.

Pick-to: 6.6 6.5
Change-Id: I0c0f8c4a288145d05636fb053cc260a917fcc4c5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0d0cd1fe2c4f2d90a8184ce88383bdf1ff35b338)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-17 09:53:26 +00:00
Christian Ehrlicher
13198306c8 QHeaderView: rename private 'offset' to avoid clash with QAIVP::offset()
QAIVP has a function named 'offset()' which is hidden by QHVP::offset
variable. Therefore rename the QHVP::offset to headerOffset

Pick-to: 6.6 6.5
Change-Id: Iadb18b8f18197925daa72af243483a044c1d94e7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 15884aba8fc697ce3c2b9b5f7dea14093f037f03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-17 07:09:04 +00:00
Christian Ehrlicher
36f01b7f56 QHeaderView: fix calculating dragPosition
The dragPosition was calculated without taking the scroll offset into
account as it's done within QAIV.
Amends 787b4c1506aba7e83d861e178329a18c6ec34322

Pick-to: 6.6 6.5
Fixes: QTBUG-120055
Task-number: QTBUG-113573
Change-Id: I0e20065f797a1a3f7df07583fccfa029b636fead
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 64a283a98894705fe51c9423812bbeb634138850)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-17 07:09:03 +00:00
Christian Ehrlicher
4938b234ad QFileDialog/win: pass only filename to IFileDialog::SetFileName()
When calling QFileDialog::selectFile(), the file is passed as QUrl to
the underlying functions. Then this url was converted back to a local
file and the full path (with wrong path separators on windows) was shown
in the filename edit box in the native dialog. There was already a
comment to use QUrl::fileName() but it did not exist when the code was
written and later it was forgotten.

Pick-to: 6.6
Fixes: QTBUG-47159
Change-Id: I478dfd0e4943277c0ac78ebf4e138257e7ea8662
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 19c701d370512e81d1b934f899b03ae0c2e6953f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-17 07:09:01 +00:00
Volker Hilsheimer
4c864a0e89 Try harder to clean up the file info gatherer without blocking
QFileSystemModel uses a QFileInfoGatherer, which is a QThread, to
populate itself with the data from the file system. Some of the system
calls we make for that might block, e.g. on Windows a disconnected
network can easily result in 10 minutes of timeout.

Destroying the QFileSystemModel destroyed the QFileInfoGatherer class
member instance, and the QFileInfoGatherer destructor, being a QThread,
had to wait on itself to avoid QThread asserting when being destroyed
while still running. This means that shutting down a Qt application that
was using a QFileSystemModel, e.g. through the non-native QFileDialog,
would hang practically indefinitely instead of shutting down.

To fix this, explicitly manage the life-time of the QFileInfoGatherer.
Manage it in QFileSystemModel through a std::unique_ptr instead of as a
direct class member so that we can control its destruction. In the
QFileSystemModel destructor, signal the gather to terminate and wait
one it for one second. If that fails, schedule the gatherer for later
deletion through deleteLater(), and release it from the unique_ptr.

The QFileInfoGatherer instance might then be alive with the
QFileSystemModel destroyed. When it receives the DeferredDelete event,
try again to abort the process and wait on the thread, this time for
5 seconds.

If that also fails, then we have to make a choice. We cannot destroy
the QThread object while it's still running, so we have to either
wait indefinitely, terminate the thread, or accept a memory leak by
ignoring the deferred delete event.

If the QCoreApplication is shutting down, then we terminate the thread.
To make this safe, explicitly control when termination is allowed in the
thread - disallow it while the thread is holding a mutex, allow it while
the thread is performing I/O operations.

If the QCoreApplication is not shutting down, then we connect to the
QThread::finished signal, and delete the object in response to that.
This might or might not happen, in which case we have to accept that
there's a memory leak.

Pick-to: 6.6
Fixes: QTBUG-120062
Change-Id: I1e4243265879d61cf406b4eeb0b11b9d59b006ad
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0786c17bbc556a0f494fc825af47c604a9dc0241)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-16 19:37:28 +00:00
Volker Hilsheimer
0cb01b87c0 macOS a11y: rebuild table model if out-of-bounds cell is requested
While it is the itemview's responsibility to keep the accessibility
bridge updated about changes in the view's structure and size, we
have experienced a number of assertions getting triggered when that
wasn't done correctly.
Instead of an assert (or hard crash in release builds), recreate the
table representation in the accessibility bridge when a cell that is
out-of-bounds for the current representation is requested. Emit a
warning message to inform widget authors, and improve the debug
message with information about the column count as well.

Amends 52c2b82082b535123c0eecafe1ec1e4e4190df2a.

Pick-to: 6.6
Change-Id: I19c20a932153268a5176d7378c485277088f10bf
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c81e31461fd5a5bd2fe959f26b2e6d134b9a71e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-16 19:37:25 +00:00
shjiu
32fa63f650 Fix build error with lambda on GCC 9.2
This patch is specific to the return type of updatePtrSimd function as boolean to avoid the bug of GCC 9.2.

Fixes: QTBUG-112920
Pick-to: 6.6 6.5
Change-Id: I21cb1f6dda34448b2290ab72ec280b6b2a3732c9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b404930e122013e76ba8fe165f3432288c051438)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-16 01:56:36 +00:00
Christian Ehrlicher
0773a3b0e6 QCommonStyle: make sure QPainter::save/restore() is called balanced
tst_qstylesheetstyle revealed an unbalanced call to save/restore within
drawPrimitive(PE_IndicatorSpinUp/Down) due to an early exit. Therefore
add a RAII-helper class to make sure QPainter::restore() is always
called after a QPainter::save().

Change-Id: I1b3851836b36d75357ed8c4532f7d2e44136159e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 531aeeefb545189a0eb2918a04e5b961ea52ed7d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-16 01:56:36 +00:00
Santhosh Kumar
8dcb5814e0 Set correct content size for tool tip label
The tool tip content size uses an incorrect content margin, when it's
constructed. This content margin has been reset to correct value when
tool tip is positioned using placeTip(). But after that, the content
size not been recalculated.

This patch triggers updatesSize() to calculate content size with
updated content margin values.

Fixes: QTBUG-119752
Pick-to: 6.6 6.5
Change-Id: I454c8528505686f2724b897e4002f78f3049149a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e977a629277796880d1557e4841f731d1ef27c06)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-16 01:56:36 +00:00
Alexandru Croitor
88662fa7e4 CMake: Export additional target info props for object libraries
For some reason when building a user project in Release mode, when Qt
was built with -DCMAKE_CONFIGURATION_TYPES=RelWithDebInfo;Debug on
MSVC, will result in linking of Debug object libraries into the user
project.
This does not happen in the same configuration on macOS.
My guess is there is a difference in the logic on which configuration
to choose between the platforms, perhaps based on package lookup order
or something else.

This was observed with qtgrpc's
ProtobufWellKnownTypes_type_registration object library (which is only
built on Windows as an object library).

The issue can be fixed if we explicitly generate per-config imported
location information for object libraries, just like we do for regular
libraries.
That way we'll have uniform build type information for all target
types.

Pick-to: 6.6
Fixes: QTBUG-119708
Change-Id: I9020b7743cea65bbd92cadd5f570b7e38e999bd4
Reviewed-by: 🌴 Alexey Edelev 🌴 <alexey.edelev@qt.io>
(cherry picked from commit 3b71f9dc297f73d140f3c185c67476df5e0266a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-16 01:56:36 +00:00
Alexandru Croitor
93e7486fd6 CMake: Fix non-prefix debug exclusion check for additional info props
The condition was checking if excluded_genex variables is not an empty
string.
But when the EXCLUDE_FROM_ALL property was unset, the value of
excluded_genex would be "excluded_genex-NOTFOUND" which would fail the
condition, and would end up always adding the generated code block.

Instead of checking for an empty string, check if it's a truth-y value.
This ensures not to add the code block when the property is unset.

Amends 7540b4bd5634c9104a99f9b219531b1e3dd7942d

Change-Id: I126c745e2e6eccad34171456c052a14cad9d887d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: 🌴 Alexey Edelev 🌴 <alexey.edelev@qt.io>
(cherry picked from commit cab76abc613b94c70121a1bc3b7f403dbd12af9d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-16 01:56:36 +00:00
Assam Boudjelthia
a111504baa AndroidTestRunner: few minor fixes for loging and printing
* Don't add \n when using qDebug()
* Trim testAppArgs of extra space at the end.
* Don't print get-current-user command by default, that value
is not that useful to be always printed.
* Update outdated bit of the help printout to reflect what the
test runner does.

Change-Id: I998bafc3aef524b368654f7b35a2a8e084d17542
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c697e19c167d1a7b80068ba8e348e33060d7c1d1)
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
2023-12-15 21:59:14 +00:00
Assam Boudjelthia
6724f87555 AndroidTestRunner: replace fprintf() with Qt logging calls
To make the code more uniform.

Change-Id: I84cc9c6169e9eb5a4ba4909b6a7178206eb57c4d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c0b0cdcb61e5e8b5a0770a5c311b9fa38afbdeda)
2023-12-15 21:59:14 +00:00
Volker Hilsheimer
f7e30e4ade JNI API review: refactor repeated if constexpr-chain
Provide class template specializations for each supported JNI type (and
also covering the equivalent C++ types), and implement generic call-
helpers using the type-specific JNI function.

Remove the now unused static-assert helpers for unsupported types.
We'll get compile time errors when the functions are used with
unknown types.

Change-Id: I8ae848bb9de60b536df64318c8a65560d8f70acb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 85c36ef1ac0695b276f9fe583926a17d685982a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 21:59:14 +00:00
Volker Hilsheimer
7a6359c614 JNI API review: minor API and implementation cleanups
- prefix ValidField/SignatureTypes predicates with "If"
- make QJniArray SMF constexpr and noexcept
- remove const from return-by-value QJniArray functions
- rename QJniArray::asContainer to toContainer
- constrain QJniEnvironment::registerNativeMethods to valid class types
- don't home-grow std::forward
- make default QtJniTypes::Object constructor implicit
- don't include copy/move constructors in QtJniTypes::Object variadic
  constructor

Change-Id: Ied02993d32d8b0f3ef1e571b75ada15ede1f8389
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit a936b86ec8720ac3dc63f9eca0f873b4f86827ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 21:59:13 +00:00
Michael Weghorn
10b480f1d8 a11y atspi: Add null checks in table iface methods
Add null checks to cover the cases where
QAccessibleTableInterface::cellAt returns
nullptr (which happens e.g. when called with
invalid indices via AT-SPI) or where the
cell object doesn't implement the
QAccessibleTableCellInterface, which
would previously result in crashes.

Fixes: QTBUG-119167
Pick-to: 6.6
Change-Id: Ieb42617b32ca829af09ae1d54f5de9ec029e3ab2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit d91d53c951144255349e5d246353b598179ce967)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 17:52:39 +00:00
Volker Hilsheimer
1f0c629a48 Move the settingseditor example into tests/manual
The example uses QTreeWidget when it should use a QTreeView with a
dedicated item model, primarily shows how to use item views (and very
little about QSettings), and is generally not useful to show how an
application could or should use QSettings to store settings.

Turn it into a manual test instead; it's useful for that as it supports
ini and plist files, and settings in different scopes.

Fixes: QTBUG-119978
Change-Id: I7ce039f6391c41c679d126d90a251eee60327c39
Reviewed-by: Ed Cooke <ed.cooke@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit bddf27cd5a5412c8282fab43111e7319874ca44e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 17:21:32 +00:00
Krzysztof Sommerfeld
8778981ef9 Enable IPv6 tests for VxWorks
Task-number: QTBUG-115777
Change-Id: I1ec9cda2f9fc72bf539e75fa7144d9b4b97d7369
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 38fa1d55ee25bf78bb391fbc8433e9d2a3b74e6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 17:12:49 +00:00
Krzysztof Sommerfeld
5b110f9949 Recreate posix QSystemSemaphore on release for VxWorks
`QSystemSemaphore` used by `QSharedMemory` class, when failed to acquire
native sem by calling `sem_wait`, will check the reason of failure and
if it is because the semaphore is no longer valid (destroyed by some
other `QSharedMemory` object accessing the same data) will recreate it
and repeat.  However, the same is not done when `QSystemSemaphore` is
calling release.

Add this functionality also for release.

Task-number: QTBUG-115777
Change-Id: Ic5d2438c93db318b993becff930b480fd3177532
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 03ef30d97502e692556924315e149122b9f981ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 17:12:48 +00:00
Esa Törmänen
218eec49a7 Doc: Improve QLineEdit documentation
Edited the text based on MS Style Guide, added a few new sections
under Detailed Desccription and a link to the Line Edits Example
topic.

Task-number: QTBUG-119552
Pick-to: 6.6
Change-Id: Iecaa142628019118e271e392a3e332841a7b5af2
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit f6566dd4c6aafa60c134fa40e2c48c6706724363)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 16:30:47 +00:00
Volker Hilsheimer
7378c709f5 Examples: fix touch handling in painting examples
On macOS, we don't deliver a press event for the first press on the
track pad (Qt::WA_TouchPadAcceptSingleTouchEvents is not set by default,
so Qt doesn't deliver a single-press on the track pad as a touch event -
that makes some sense or at least maintains compatibility). Because of
that, point 0 is never added to the finger-mapping hash.

When point 0 is then released, we didn't check if we found a valid
iterator for that point ID, and the example crashed.

Fix this by checking that we have a valid iterator before dereferencing,
and by handling Stationary events in the same way as pressed (add the
point to the mapping if it's not already there).

Pick-to: 6.6 6.5
Fixes: QTBUG-110266
Change-Id: I32337b801aaabf9b821a97ddc15ad78747b5e6a2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 9d8473cdf63537dee65e9c235249b4e4901baa1a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 16:30:46 +00:00
Christian Ehrlicher
b2cf019b98 Doc: fix links in QString::toLocal8Bit()
\l must not be preceded by \c - qdoc will ignore \l otherwise.
This amends 349bd4db22d057f3fc633f5522c53ad0bfb7bd6f

Pick-to: 6.6
Task-number: QTBUG-111443
Change-Id: Ia1ab7c6bfe88c288ea14ee307c6a39c1c304ee6f
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit cd081991b196e65440138379ea23321397c40b9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 10:34:51 +00:00
Assam Boudjelthia
bf7c813b29 AndroidTestRunner: add new TestInfo struct
This contains test specific variables like pid, sdkversion,
isPackageInstalled and isTestRunnerInterrupted which don't strictly
fall under 'Options'.

Change-Id: I7c4a3422813f464b407d9b2be98c5b4a807c4f1e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4b0f774e3b0b7ccbdec44175c661f1b4a0b60dac)
2023-12-15 10:34:50 +00:00
Alexandru Croitor
e16db6933c CMake: Don't recurse with qt-cmake-standalone-test in-source dirs
When the qt-cmake-standalone-test root project is configured in-source
in the source directory of a test A, where test A ends up being added
via add_subdirectory(A), this causes the SUBDIRECTORIES property of A
to contain itself for some reason.
Recursively iterating over the root project's subdirectories thus
causes an endless recursion.

Make sure to remove the currently processed directory from the
retrieved SUBDIRECTORIES property when the function is called
during qt-cmake-standalone-test configuration.

We limit it just for that script, so that we don't accidentally
increase the configure time when building all standalone tests, and
call list(REMOVE_ITEM) too many times.

Upstream issue filed at
https://gitlab.kitware.com/cmake/cmake/-/issues/25489

In a way, amends d08fa86e63448377dde4297bc94680a9d7daaaeb because it
exposed the issue.
Amends 1c82e92202c8c359872c08095670c121602094b8

Pick-to: 6.6 6.5
Task-number: QTBUG-119998
Change-Id: I6f92a07be105cde74ac4946523967791db7bf301
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 04a327f00a84b0c13cb4a4a6715b2ce86ea9f61a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 10:34:50 +00:00
Christian Ehrlicher
e4d533eb1e QStyleSheetStyle: pass dpr to QIcon::pixmap()
Pass the correct device pixel ratio to QIcon::pixmap() to make sure the
correct pixmap is returned on high-dpi displays.

Fixes: QTBUG-92016
Fixes: QTBUG-94203
Change-Id: I6809ae63b2c99bb60c705f6d78caa2b48f2c7473
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 8f539ac85a19b6b96c3757ba59197a34315cfb01)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 10:34:50 +00:00
Volker Hilsheimer
97dd51e677 QAIV: reset state if removing index while editing or committing
If the commit of data to a model index result in that index getting
filtered out, then the editor will be removed as part of committing the
data, and the index that the editor is associated with becomes invalid.
The subsequent call to closeEditor() will find that the index for the
editor is no longer valid.

This should not warn, and it should also not abort the clean-up process
early. Instead, identify that the editor that we want to closed is
already hidden. In that case, skip the warning and most of the cleanup
process, and proceed directly to the EndEditHint handling further down.

Add a test that simulates the two scenarios where this can happen:
either the committing of data results in the index being filtered out
by the existing filter; or the filter changes while editing, and the
index being edited gets removed. In both cases, we don't want to see a
warning, and the state of the item view should be reset correctly.

Pick-to: 6.6 6.5
Fixes: QTBUG-115765
Change-Id: If247172fdac9a1a9279dae96c078d32553d4ee5d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: 🌴 Alexey Edelev 🌴 <alexey.edelev@qt.io>
(cherry picked from commit 04415264489cd96a4a542a2ae7db1c14558397a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 10:34:50 +00:00
Johannes Grunenberg
bcbeeb7a70 Windows QPA: Omit native virtual key in WM_CHAR
WM_CHAR doesn't send the native virtual key in wParam,
but it sends the generated UTF-16 code unit, so no assumptions
can be made about the pressed key.
lParam still contains the scancode.

Fixes: QTBUG-117903
Pick-to: 6.6 6.5
Change-Id: Iedc5936118936009db8f6b0c1ce6147db2739422
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit d53e42d974c90797d28511470d0b188dcab134fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 10:34:49 +00:00
Allan Sandfeld Jensen
993db3ee9a Copy color table in QImage::transform paint path
A copy without pixel ratio was made, but color table not set.

Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-119902
Change-Id: I328f3faa70d7a1263061cbe51921999393e30801
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 15051e205facddd8bc3f290c65ad854ec1b25091)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 07:38:34 +00:00
Eskil Abrahamsen Blomfeldt
2243b815e0 Fix synthesized bold on Windows
There were a couple of problems with synthesizing boldness on
Windows: For the DirectWrite font database, this was not implemented
at all, so this change adds support for it.

For the default GDI font database, the font engine is correctly created
for a font with synthetic bold, but the function that retrieves the
contours from the font does not apply the transformation. So when
generating the distance fields for Qt Quick, we would get the
unemboldened contours. The fix for this is simply to fall back to
using DirectWrite for fonts that require any synthetization. This will
later become the default anyway.

Pick-to: 6.6 6.5
Fixes: QTBUG-119995
Change-Id: I5b4e3b19d0d71c6599746172da0bee41e8fb3940
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 05de036a8855adbdd882942d2fb61c231b02bf5a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 07:25:30 +00:00
Thiago Macieira
b9268bef71 QBitArray: add mutation operators taking rvalue QBitArrays
Because we may be able to use the other side's storage and apply the
operation in-place. We reuse the storage of the one that can be
detached: even if we have to grow the buffer, QBitArrays are usually
small so there's a good chance it's just to the extra space QArrayData
usually overallocates or a simple, non-moving realloc().

Disassembly with GCC 13 and Clang 17 show the vectorisers did kick in
for all four functions (inverted_inplace included). I think a
hand-rolled version could squeeze a few more cycles, especially in the
tail section, but I don't consider its maintenance cost to be worth it.

Change-Id: I85b3fc2dd45c4693be13fffd1795bfb1b296caa6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 948fa2a427dbcdc2784abdcf87efc914417a0028)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 06:23:48 +00:00