67858 Commits

Author SHA1 Message Date
Volker Hilsheimer
9cb2200d4f JNI: pre-declare JNI classes for standard Java types
This avoids that we or users have to declare e.g. String or Uri in
several places in Qt. This also prevents problems where multiple
declarations (possibly from different headers) cause build errors.

As a drive-by, remove some unnecessary type declarations (e.g.
UriType, which had the same class string as Uri).

To ease the submodule update process, define a preprocessor symbol
that submodules can use to conditionally declare the type locally.
Once the dependency update is through, the symbol can be removed
and submodules can use the declaration from qjnitypes.h.

Change-Id: I7d96edf644a54246302b5c5cb478e66fa615e73e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 457a1c973d68e705f9cf72ac72b19fc26cdb2917)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:06 +00:00
Volker Hilsheimer
1adc8648c1 JNI: Allow list of namespace to be passed into Q_DECLARE_JNI_CLASS
Make the macro variadic. For N > 2 arguments, interpret the first
N-2 arguments as nested namespaces that are declared as inline
namespaces. We can then construct the signature string from those
namespaces, so

Q_DECLARE_JNI_CLASS(String, "java/lang/String")

is equivalent to

Q_DECLARE_JNI_CLASS(java, lang, String)

except that with the second overload, the C++ type will be in the
QtJniTypes::java::lang namespace. Since both the java and the lang
namespaces are made inline, QtJniTypes::String still works.

This helps with avoiding conflicts, as there might be Java classes
in different packages, but with the same name.

Change-Id: I0355239e7fc3c91cb26e041f19c4e0853d3678ac
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 2b1312bc954b72f59d0c1d7b1192e2f029016012)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:30:04 +00:00
Alexandru Croitor
7e831c3b66 coin: CMake: Add instructions to generate JSON and verify the SBOM
If the VerifySBOM feature is enabled, pass additional options to
CMake configuration:
- runs syntactic verification of the SBOM
- so it converts the generated SBOM files into JSON files (and
  installs them). This does additional useful validations.
- runs the NTIA SBOM verifier
- shows some of the content in the SBOM in a more user-friendly table
  format via the sbom2doc python app
- runs sbomaudit to show things like packages without a license
  expression, doesn't exit with errors if issues are found.

To ensure the tables are wide enough in the log on the CI, we set
an explicit value for COLUMNS env var, which is used by sbom2doc
to determine the table size.

To ensure the sbom2doc and sbomaudit python applications are found,
we supply additional locations where they can be found, via the
env vars that coin python provisioning sets.

We also make sure to pass the found application paths when executing
the python apps, because they might not be in PATH by default.

Task-number: QTBUG-122899
Change-Id: I0baef8b9c949209b15ab304e1e840b4dcdf5a61c
Reviewed-by: Toni Saario <toni.saario@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 83ff34d1c626759224a95f39bca8337a8390ed52)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:29:55 +00:00
Tor Arne Vestbø
a9d3a0b47c macOS: Don't use full screen geometry for popups
The fullscren geometry when an application is in full screen includes
the area above the menu bar. Unfortunately, when clicking on areas of
a Qt popup that overlays the menu bare area we get a callback for
NSMenuDidBeginTrackingNotification, and as a result we close all
popups. As macOS for some reason treats the menu bar area as special
and tracks clicks there even if another window is on top, we should
not put our popups there.

This also matches the geometry of windows shown full screen, which
does not overlap the menu bar area either when using the native APIs
to make a window fullscreen (which we do).

This change does not affect the original issue (QTBUG-39403), as the
QScreen::availableGeometry() nowadays does not exclude the area of
the Dock when in fullscreen mode.

Pick-to: 6.7 6.5
Task-number: QTBUG-39403
Fixes: QTBUG-123298
Change-Id: I5890d7fc7a9b95a98b8fd2b9ce58ed9789e7f36e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7f63b0fabb3f2ae67596cc061f202ddd77ddf56b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:28:57 +00:00
Marc Mutz
44a94e03dd tst_QSharedPointer: check QWeakPointer vs. virtual bases
This fell out of my tracking of a failure of the new QPointer
conversion feature, and it would be a waste to throw it away unused.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Ie255b4a6432b4763071e5712d92e9ccd57927052
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 0e40a3f6645a684458cbb09bef1353df2eec5e0b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:05:31 +00:00
Topi Reinio
3b1d3db793 Doc: Qt Core: Increase warning limit to 2
Technically the Qt Core documentation builds without warnings, but
testing in CI two warnings are observed:

  warning: Already generated qtcore-attribution-extra-cmake-modules.html
           for this project
  warning: Already generated qtcore-attribution-kwin.html
           for this project

These pages come from a qtattributionsscanner-generated source file,
codeattributions.qdoc.

The warnings do not affect the generated output. Increase the
documentation warning limit temporarily to let integrations pass.

Task-number: QTBUG-126546
Change-Id: Ic8641c69b2818c72af72cdc23161314caf376c27
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit cec470561df663a7ea8f0a0ab65fb80b50cacb12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 19:05:30 +00:00
Morten Sørvig
72dad27a25 wasm: refactor cmake finalizers
Avoid duplication and move finalizer code to a new
function "_qt_internal_finalize_wasm_app", which can
be called from the add_executable functions.

Change-Id: I4859a3999725ebf61a496d78665b6a259dfeb0f5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 2116c62256bbf1bc3d516430509a93177572d86f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 12:51:33 +00:00
Morten Sørvig
c4106cee7c wasm: set embind option in executable finalizer
This prevents setting it more than once, which will
on recent Emscripten versions cause 'duplicate symbol'
linker errors.

Change-Id: Ie6c2ede0569271cf3a02fc993b14bbf27f69ff57
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 320cb68ce5c0c718c6434adfefa6c7460e3cb08a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 12:51:30 +00:00
Morten Sørvig
74f8f0102e wasm: remove DEMANGLE_SUPPORT
This linker option is now deprecated (and not needed,
since stack traces always contain demangled symbols).

Change-Id: If42c692c006b214fa3df418c09680aaa07ea2bbd
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit a8b7da59cba56b535393f50cd7432a412021d8d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 12:51:27 +00:00
Rym Bouabid
d06924baef qlibrary_unix.cpp: Make adding 'lib' prefix possible even when the file name starts with 'lib'
Loading QLibrary("library_manager") and QLibrary("lib_example") is not
possible if their binaries are called liblibrary_manager.so and
liblib_examplep.so.

Remove this prefix check: if (!prefixes.at(prefix).isEmpty() &&
			      name.startsWith(prefixes.at(prefix))
,in order to allow calling dlopen() with "lib" prefix added to the name
even if the name starts with "lib".

The drawback of removing the check is that extra dlopen() calls will
take place in other cases such as: "libexample.so". In this case we
will have two extra calls of dlopen() taking "liblibexample.so" and
"liblibexample".

Fixes: QTBUG-23470
Pick-to: 6.7 6.5 6.2
Change-Id: I2c0b1b81edf8253443388aa67d24f4cd64d4123d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2f11edad9e87311a977cb6edbd908a9fdd86a567)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 09:43:43 +00:00
Mate Barany
7a41956df0 Use fully qualified signal arguments in QDnsLookup
Detected by an Axivion scan.

Task-number: QTBUG-125026
Change-Id: I426ee40d5bfd6c473a90e76d207817596f7aab0f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ecd38b85dc80f899b685d3c6c031dcabb3c63211)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 09:43:37 +00:00
Mate Barany
766244e033 Use fully qualified signal arguments in QNetworkInformation
Also in QNetworkInformationBackend.

Task-number: QTBUG-125026
Change-Id: I3cc722a9e6db284a393bfddf0dfa4ebbcb6b4d07
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d9d384b94fba0e15ed7f564309b0fbc48e5f4d7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 09:43:33 +00:00
Volker Hilsheimer
7225d11156 JNI: don't inherit declared types from JObject
JObjectBase has a protected destructor, but JObject doesn't, so
inheriting from it might result in UB. Declare the Type as an alias to
JObject<TypeTag> instead. Specialize the traits for the TypeTag, and
add a partial specialization of the traits for JObject<T>.

Adjust the return type of the named constructors of JObject.

Change-Id: Ibe74c3cd3b3a2a81779117dd2d228684c365a845
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 691f6b5b0c9dc69f8d019abc53747e7a6bbf6ef8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 06:54:34 +00:00
Sami Varanka
6b2cbb3fd6 Include horizontal scrollbar's size in sizehint
Amends 8c18a245b0245de20c064cd53d03498088bd57df

Pick-to: 6.7 6.5
Fixes: QTBUG-123886
Change-Id: I1ae2e29ce12610e10a8c0640458a3812a926c4cc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0fa6660352df18134757a9c3f9dd329053e31cab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 06:54:30 +00:00
Marc Mutz
ada5f8b646 tst_QSpan: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature, and greatly simplifiying the
source code.

Change-Id: I0731d7291048e6bbed19666d1b6672e5cccaf27a
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 157fcdf5afbe4e6b421713947ccdb4ee35116ee4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-20 01:55:26 +00:00
Marc Mutz
9a86dba130 tst_QRegularExpression: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Change-Id: I530814c0858565b46f462d5c66038a37140c0617
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7885d5cb220cee04f892ecdba46a1fc3dc65eeae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 23:32:05 +00:00
Marc Mutz
7e021ab891 tst_QAbstractProxyModel: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

This not only helps with the sourceModelBinding() test with its manual
currentTestFailed() calls, but also the old verifySubSetOf() helper
function that's there from Qt 4 times.

Use Ye Olde Scope Guard Trick™ to replace the qDebug() messages
recording where failures occurred.

Change-Id: I4d1460bde5315dfcc3b261b6e09c7293bbd9ff89
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 32fc8b936d1d036ba5b70ec1cac7681e1c9359c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 23:31:58 +00:00
Marc Mutz
a9ebd2d64e tst_QAnyStringView: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Change-Id: Ied115f33990040b92f49b319c36d20f7510e6eac
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 757e3d77ac186988a3fe8bed9706c5792caa2666)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 23:31:51 +00:00
Marc Mutz
df055c0256 tst_QCborValue: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Change-Id: I1415e6af94eab3bb47d3f8d319f84554faa52d45
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit c8e33fc4fd1151edb3df4815f5fbae03eb1ea353)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 23:31:45 +00:00
Marc Mutz
5ba8e27800 tst_QCborStreamWriter: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Change-Id: Ie197dc94fb9dfebd5f730c7ca4ef5ce0ed07e9f3
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit eec0a30e5e0c64a8f373b59290b8e6c0bc88c17c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 23:31:29 +00:00
Volker Hilsheimer
9b6087b0dd Accessibility: remove compatibility alias for AnnouncementPoliteness
It was only needed to support a smooth submodule update.

Change-Id: I7546b8565bd3f2cb2c5141fc6ea36d1c76f11c48
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 5ee8ca2e94336e28374308e768f541c58b7725a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 14:14:37 +00:00
Łukasz Matysiak
8f66370ecf Handle VxWorks in QFileSelector
QFileSelector tests fail, because VxWorks is not properly categorized.
Even though it is not a unix-like system, it does provide a
compatibility layer that enables some unix utilities.
It has also been treated as unix on the Qt 5 customer branch.

Solve the issue by assigning VxWorks to the unix category in
QFileSelector and its tests

Task-number: QTBUG-115777
Pick-to: 6.7
Change-Id: Icab80764b66b121995f51ddf149de55dc8c9eb55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit da5de2926ac9573b13d0d743e43e685cbdb2abaa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 14:02:58 +00:00
Łukasz Matysiak
56ec3aa56a Handle VxWorks in QSysInfo
Right now VxWorks is not recognized as a known platform in QSysInfo.
This leads to issues with classes that depend on it to properly handle
the OS specific functionality (like QFileSelector).
Solve the issue by adding vxworks-specific implementation of
kernelVersion, productType and productVersion.

Task-number: QTBUG-115777
Pick-to: 6.7
Change-Id: Ib544d19f604f3f2d1f088f6160dd210cd6743717
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 65b5debe3a22ff47cf77dd25cf1ec85582ca0f6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 14:02:51 +00:00
Toni Saario
9e5759cd2a Coin: Add a way to disable test upload
The use case is where blocking test building is wanted but they cannot
be uploaded due to being static or they would simply be unused.

Pick-to: 6.7
Change-Id: I32ad20fea2ec032fb1f1a9b86025b34f192e0ed2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6a0c94b62d948d3da0da241cf1e6c15188069169)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 13:14:45 +00:00
Alexandru Croitor
27ecdc611c CMake: Mark wasm platform plugin as GPL3 in SBOM
Task-number: QTBUG-122899
Change-Id: I107f4432bf484ea0fb57908db936ab5fda6bd39e
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 877ba5504cb4ed5a9bd0c130ea7547de6425c525)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-06-19 10:15:40 +02:00
Alexandru Croitor
596d07f647 CMake: Correctly annotate the Entrypoint (winmain) SBOM license ID
According to the documentation, it should be:
 LicenseRef-Qt-Commercial OR BSD-3-Clause

Task-number: QTBUG-122899
Change-Id: I8c614926c9f2811d5dd926ffcb89c59f4f25b47b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d78ee6933089fa9b131eb08b8b376f8c9c396f2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:40 +00:00
Alexandru Croitor
aea52288d6 CMake: Improve license handling for SBOMs
Add a NO_ATTRIBUTION_LICENSE_ID option to allow to skip including
license references from qt_attribution.json files.

Add a QT_LICENSE_ID option that can take an "id" value and return one
of the common license expressions we use throughout Qt repositories:
- GPL3 with exception for tools / apps
- GFDL for documentation
- GPL3 only modules
etc.

Add a QT_SBOM_DEFAULT_QT_LICENSE_ID_LIBRARIES variable that can be set
at directory scope (or root repo scope) to use a specific license id
for all qt modules / plugins created within that repo, e.g. the
Commercial + GPL3 variant. These can be opted out, to fallback to the
"default" license by passing NO_DEFAULT_QT_LICENSE_ID_LIBRARIES.

Add a similar variable  QT_SBOM_DEFAULT_QT_LICENSE_ID_EXECUTABLES
for tools / apps, including a NO_DEFAULT_QT_LICENSE_ID_EXECUTABLES
option.

Modify the logic for setting licenses for qt targets:
- use whatever is set in QT_SBOM_DEFAULT_QT_LICENSE_EXECUTABLES
  for tools and apps
- or use the 'GPL3 with exception' variant for tools and apps
- use whatever is set in QT_SBOM_DEFAULT_QT_LICENSE_LIBARRIES for
  modules ands plugins
- or use the default Commercial + LGPL3 + GPL variant for
  modules and plugins

Amends 37a5e001277db9e1392a242171ab2b88cb6c3049

Task-number: QTBUG-122899
Change-Id: I3a8abac62b9f4b342f91ef139064884f02aa935e
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit fe90ba704168d47cf88d0c6512380b525f38f5d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:40 +00:00
Alexandru Croitor
9be3d7a7a0 CMake: Allow specifying most SBOM options to qt_internal_add_foo
Previously, only a very short subset of options related to attribution
files could be specified to qt_internal_add_module /
qt_internal_extend_target.

It is more convenient to allow specifying most (safe) options, instead
of calling another function.

Unsafe are considered paths like INSTALL_PATH and derivatives, TYPE
which is too generic, and some other ones like LIBRARIES which would
be duplicated, and causes warnings in cmake_parse_arguments if
duplicated.

Change the code to allow specifying most SBOM options and forwarding
them to _qt_internal_extend_sbom.

Task-number: QTBUG-122899
Change-Id: I6eb723e165edf59973d83c66eace43acdce237de
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 81162cc8b6931c8659dc722be97eb788e344812a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:39 +00:00
Alexandru Croitor
ba08a2fb17 CMake: Fix assigning per-directory variable license in SBOM
The value should be taken from the QT_SBOM_LICENSE_EXPRESSION
variable. The '_qt_internal_sbom_get_default_qt_license_id' was a copy
paste error.

Amends 37a5e001277db9e1392a242171ab2b88cb6c3049

Task-number: QTBUG-122899
Change-Id: I4bcfaaf06af8903af7081130ba3c8285a53d8f4f
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 8f04225c5af2a5cb31d2452342b4ec35a10bf77b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:39 +00:00
Alexandru Croitor
9c04794cd8 CMake: Fix _qt_internal_forward_function_args to evaluate its args
We were comparing the variable name of single and multi arg options,
rather than the value.

This accidentally worked when the variables were set, but forwarding
empty values if the variables were not set.

Explicitly evaluate the variable values to compare them against the
empty string.

Amends 96abceb64e5dc0570ca7c3419f401cfafe946ba0

Change-Id: I1a701c681f5af5e665601972687024ce734aa014
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 6f475a05a1a035b07ed66f93aa92d0e8b2396047)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:39 +00:00
Mårten Nordheim
eb208a6bb5 compressEvents: simplify TimerEvent compression
While better in some benchmarks, it turns out to be less efficient to
first find an event to the receiver, and then checking the event-ptr
and -type in other benchmarks, compared to just iterating the list and
checking these values.

Partially reverts 3e6b42ae9dbf4f90ba890d78a4c49f9936f4976b

Fixes: QTBUG-126394
Pick-to: 6.7
Change-Id: I748bda3d31350aea6e87db9bd57359ab17cf5d67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: YAMAMOTO Atsushi - Signal Slot <atsushi.yamamoto@signal-slot.co.jp>
(cherry picked from commit b039d2251a14281947a43e226bae6c6fbae7312a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:39 +00:00
Morten Sørvig
e7cf150caa wasm: move MODULARIZE to EXPORT_NAME finalizer
This avoids a "must set EXPORT_NAME when using MODULARIZE
with pthreads" error when linking libQtGui.so.

Both settings only apply for the final executable since
they affect how the wasm module is loaded from JS;
setting them together here makes sense.

Change-Id: Ibebeeee38203486675c43b416cb674e8ece9c147
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 9768d8e1ba21adace1f590420791e6924a9fad8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 08:15:39 +00:00
Christian Ehrlicher
7a67ed7705 QIcon::addFile() delay-load icons when a proper size is given
Delay-load the icon within QPixmapEngine::addFile() when a proper size
is given - this speeds up QIcon creation and also allows to let
QIcon::actualSize() return the correct size of an QIcon instead the
given one. This is especially useful e.g. when a 32x32 icon has a
smaller width or height and it should be centered during painting.
Also add an optimization for multi-image formats to check for the
correct size without decoding the image.

Task-number: QTBUG-59621
Change-Id: I7ed930ae3f65a8b3a272f70bcc2958980f9f02f2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 94a3a492f52398eb1c08ea910fbd007b31228525)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 05:30:05 +00:00
Ahmad Samir
3640aa18d9 QFSFileEngine: remove redundant entryList() override
It just called QAbstractFileEngine::entryList().

Change-Id: Iae154c8aba8c48488f525cc3543bb24467e85088
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b9c486ed8cd6120a1c60e39325cecd497f26265d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 05:30:05 +00:00
Ahmad Samir
8b84c45762 QFileSystemIterator: add constructor that takes QFileSystemEntry only
This is in preparation to adding constructors that take
QDirListing::IteratorFlags, I would have had to add an init() private
method to deduplicate the code, so instead add a constructor that can be
delegated to.

Task-number: QTBUG-125859
Change-Id: Idbc76fcba50f9d0016e4ddba03b2f532a33231bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c203c41109e41d03de8145a541ff5c8fbe976492)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 05:30:04 +00:00
Volker Hilsheimer
38f08eec14 QTableView: optimize selection when spans are present
If a span is selected, we used to assume that rows and columns might be
moved, and made a selection with a range for each cell in the span. This
resulted in very large selection models.

We already had optimized the case that we didn't have any moved rows or
columns, skipping the mapping for the respective (or, usually, both)
directions and just making a single range. Apply that same optimization
for the case where a span exists and intersects with the selection area.

Avoid code duplication by only updating the top/left/bottom/right values
depending on the configuration of the table, and then create the
selection based on those.

Adapt the test case; we now get a single range, even when a span is
present, and the range includes all cells included in the span. Add a
debug streaming operator in the test case, as there is none implemented
in QTableWidgetSelectionRange, to ease debugging. That operator can
become a hidden friend of QTableWidgetSelectionRange in a follow-up
commit.

Pick-to: 6.7 6.5
Fixes: QTBUG-119076
Change-Id: If699463944ca2abaed8f93a2cd3ea30f33b79145
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 57d209c4fdea4766f24479a1f20c2975d34a1a0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 02:40:18 +00:00
Volker Hilsheimer
208ad426b4 Fix indentation in QTableView's selection handling code
Makes the follow up patch clean to review.

Pick-to: 6.7 6.5
Task-number: QTBUG-119076
Change-Id: I38c2b02876af93ce668ade7bce97b32a9ec2cef0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 71d0ea7d042d61e8d42e9cf2700c439d4337345b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 02:40:13 +00:00
Thiago Macieira
e3b0d2f93c QLibrary/Unix: fix mojibake of dlerror()
Amends a6a56814702612d8981f594a6158d70a7928cb99 where I replaced a
function that correctly did QString::fromLocal8Bit() with
QLatin1StringView.

Pick-to: 6.7
Change-Id: Ic0adfa808d28487a8303fffd17d9ec0817eda3e8
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 0a1a8355f313ac951e3e615f47aca40f421fc4bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-19 00:57:44 +00:00
Volker Hilsheimer
63aece5ae7 Clean up QAccessible based on header review comments
Fix the change of the InvalidEvent value to be the same as in Qt 6.7,
where AcceleratorChanged was the last valid event.
Add trailing comma and Q_ENUM. Remove superfluous inline, make
QAccessibleAnnouncementEvent constructor explicit, declare destructor as
override.

Amends 010952a55ee9ca9731f8ad15f2773d0bae645840 and
9ec1de2528b871099d416d15592fcc5ef9242a64 based on header review.

Change-Id: I96f00871acd2bb340ac7fc762a7fca8ac2f61dc9
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 902dfd08a03b86cb65bfb5da55faad671f7dad20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 21:12:25 +00:00
Volker Hilsheimer
5cb79f8850 QAccessible: rename AnnouncementPriority to AnnouncementPoliteness
Better name given the value names, as discussed during header review.
Keep AnnouncementPriority as an alias until dependencies are updated.

Change-Id: I7b60c429fb60fc30378a9560da12abb87499225f
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit bb305e63ff856a8c6f9649a27a5eabfb31df8aa7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 21:12:18 +00:00
Volker Hilsheimer
b2f8a7b6a8 JNI: make it safe to iterate over or convert an invalid QJniArray
This is expected behavior for default-constructed containers.

Also add the missing isEmpty() member function to QJniArrayBase.

Change-Id: I23111f6906ef5476567272cb23746fec962afa35
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit e5516191b25d70ee9d6e87246d932fa559ef0b59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 21:12:12 +00:00
Juha Vuolle
78784065a8 Accept QASV for multipart 'name' field
And adjust the encoding of 'name' parameter to  always
use UTF-8 / ASCII. This aligns with how other frameworks
behave. Also amended docs to recommend ASCII for 'name'.

Found in API review.

Change-Id: I54d1148bf95dece54b75c76914c49985da05e0b2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6b23a3c5e4316c5f889ea5e9bbfd785b78716268)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 17:08:34 +00:00
Juha Vuolle
b5dde79bc4 Adjust multipart 'filename' parameter encoding
The RFCs around these encodings are loose and allow
several ways for dealing with non-ASCII characters.
The encoding introduced in this commit should be
interoperable and aligns with other frameworks
(checked Curl, JS FormData, Postman, and Python
requests).

This consists of several adjustments:

1. Enclose the filename attribute in double quotes
2. If filename contains only ASCII characters, use them as-is
3. If filename contains characters beyond ASCII:
3.1. Encode them directly as raw UTF-8 to filename=
3.2. Set an additional filename*= parameter with
     percent encoded UTF-8. This is a legacy encoding
     for compatibility.

Task-number: QTBUG-125985
Change-Id: I5a6ad5388e4bb69e142caa7f6de7127526f441ad
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8c8a0c06d4f77ba8a707ec0a101b423543bf30f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 17:08:31 +00:00
Mate Barany
0a57b0e542 Refactor test cases in tst_qformdatabuilder
Hide the construction details of QFormDataPartBuilder, change
the verification to be QString based instead of QByteArray based,
and use raw string literals (where useful) for readability.

Task-number: QTBUG-114647
Change-Id: I16fb6c943cf6fd7385e78bbffe3b2780ab0a6ac8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit cb8abb718da4e18232de525ef1bb611f3a5dd929)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 17:08:21 +00:00
Tor Arne Vestbø
b14c1c1824 tst_QPlugin: Be specific when looking for plugins
The pattern "*debug*" also matches libinvalidplugin_debug.dylib
on macOS. As the CMake target for the plugins include the 'plugin'
part, let's look for that as well when finding matching plugins.

Change-Id: Icf3177d42c104829890a8c404a6b9782bf190bb4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 087ace615a6399f6bf7a020bce07365689bd4784)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 09:28:46 +00:00
Marc Mutz
34ac282a1e tst_QProcess: silence -Wunused-result
We can't do anything about a failed write at these code locations. In
particular, we can't QVERIFY() their success, so suppress the warning
with the idiomatic cast to void.

Amends 13a1995e9dc987d1560b38d16b76442261b4aa8d,
bd32c7d7055b436b8c33486a5b5ce1c29db77fd4 and
c5221f6be00c16187e0abf008b33c230fea56c29.

Pick-to: 6.7
Change-Id: Ia7ef57f01eeb8608079a12724c0b4f03a59081c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 97f31a68795e1d492f98a9942cce5228cbe64cf8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:23 +00:00
Marc Mutz
beabc63598 tst_QGlobal: fix -Wmaybe-uninitialized
GCC 14 doesn't understand that neither q_check_ptr() nor
qCompare<int*> dereference the pointer.

Since the missing initialization isn't part of the test (except,
maybe, to provoke this warning if the implementation indeed changed to
dereference the pointer), fix by initializing the int, like we do for
the string a few lines below.

Amends the start of the public history.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I6033e026f041b03821b776daa8e65586b8054136
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8e914e07fbac8b40e51d0e6da764fa13a6af8181)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:17 +00:00
Marc Mutz
2ec36e7ebe tst_QEventDispatcher: port to QTEST_THROW_ON_FAIL
Dogfooding the new QtTest 6.8 feature.

Change-Id: I4ded1fabac25fb283eb26b5eef341892b4459e96
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7a93e815d2489b97510a1ab7aaf6a140e2e2c587)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:13 +00:00
Marc Mutz
161996d1da tst_QDir: fix -Wunused-result
We've been ignoring the result of symlink(2) and GCC 14 complained.

Fix by QCOMPARE()ing to 0, ie. verifying sucesss.

Amends 23d08ce2edab09562ad283dac5d46c09efec63ca.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: If58267e3883c77cd62aa72a42410c837b32d9c0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c880a3867a85c0efdc6773ad6b446a318198585a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:11 +00:00
Marc Mutz
f3007e8624 tst_moc: fix 'inline function used but never defined' GCC warning
GCC doesn't have a specific warning flag for this warning, so we can't
add a GCC case to the existing Clang suppression in the header.

Hovever, the issue can be fixed by including the moc file into
tst_moc.cpp, so that the compiler sees the definition of the inline
signal provided by the said moc file. This means we can also drop the
Clang warning suppressions.

To prevent duplicate definition linker errors, remove the header file
from JSON_FILES, and the forced separate compilation that entails.

I'm pretty sure that some cmake magic could preserve the JSON test
coverage, but a) the file doesn't emit anything special in its json
(certainly nothing about the inline'ness of the signals) and b) the
presence of mySlot() and mySignal() as slot and signal on these
classes is already tested by singleFunctionKeywordSignalAndSlot().

Amends the start of the public history, but not picking back far,
because a) a prequel commit to this commit wasn't picked further,
either, and b) this has been such a long-standing issue that it's
clear no-one cares and so it's just not worth the risk, however small
that may be, to backport.

On GCC, the only remaining warnings thrown by tst_moc are now
moc-generated ones.

Task-number: QTBUG-119042
Change-Id: Icde1eee6c97bd48d72e15461b6ec80c50c044eaa
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b1b3af02c0fb8084d2eb984b1f7ae68f1861f9a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-18 08:09:09 +00:00