Commit Graph

66366 Commits (03f949dcf8d4060f66b1f91a1ff314a4dc7262f3)

Author SHA1 Message Date
Giuseppe D'Angelo 03f949dcf8 Fix the command line options for the hardening features
Make them take dash-separated names, not underscore-separated ones.
Amends 9ff1e6d80b.

Change-Id: Ia6af2ef4b422dba74acb4ea835e70045d5f53215
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-20 15:24:07 +01:00
Isak Fyksen b1e8287b8d Extract method `bool QDomNodeListPrivate::maybeCreateList()`
Extract duplicated logic to own method, and call where previously used.
Also, make `QDomNodeListPrivate::[list|timestamp]` mutable, to allow
`maybeCreateList()` and `createList()` to be `const` methods, and avoid
`const_cast` in `QDomNodeListPrivate::length()`.

Task-number: QTBUG-115076
Change-Id: I4f3a27315da28082a12cc4f5653567039b4cb376
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-03-20 14:21:00 +00:00
Tatiana Borisova e5ebb9022a QCborMap: use new comparison helper macros
Replace public operators operator==(), operator!=(), operator<() of
QCborMap to friend methods comparesEqual() / compareThreeWay().

Use QT_CORE_REMOVED_SINCE to get rid of current comparison methods
and replace them with a friend.

Delete #if 0 && __has_include(<compare>) blocks,
since they are not required anymore.

Add friend methods comparesEqual(QCborMap, QCborValue) and
compareThreeWay(QCborMap, QCborValue) to the QCborMap
class, to support comparison between QCborMap
and QCborValue elements, see test-case mapSelfAssign() ->
QT_TEST_EQUALITY_OPS(it.key(), QCborMap({{0, v}}), true);

Task-number: QTBUG-120300
Change-Id: I9e33df255d16484efd3124cf0632db859408fb5d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-03-20 15:21:00 +01:00
Tor Arne Vestbø b7eb73b1f0 iOS: Don't apply UIWindow safeAreInsets to available geometry on visionOS
There is no concept of a screen on visionOS, and hence no concept of
screen-relative system UI that we should keep top level windows away
from.

As UIWindow and UIScreen on visionOS report the exact same bounds, we
can't use the same code path we use for iOS/iPadOS to detect whether
to apply the safe area insets, so skip the logic entirely.

We still report the safe area insets on a QWindow level, so applications
can avoid rendering content close to UI elements such as the window
move and window close buttons.

Task-number: QTBUG-121781
Change-Id: I20ad02390564972a3715c27f351689b79ad579d8
Reviewed-by: Amr Elsayed <amr.elsayed@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-03-20 15:20:59 +01:00
Tor Arne Vestbø 17f6c62d97 iOS: Compute screen available geometry without UIScreen.applicationFrame
The API has been deprecated for a long time, and doesn't have the same
semantics as we want for modern iOS apps that may run in windowed mode
on iPad, macOS, or visionOS.

Instead we base the availableGeometry exclusively on the safeAreaInsets
of the screen's UIWindow. But we only do so if the UIWindow bounds match
the bounds of the UIScreen in each dimension. This means that iOS apps
that take up the entire screen, or run in Split View on iPad, will get
a smaller availableGeometry, but apps that run in Slide Over on iPad,
or windowed in Stage Manager on iPad, will get an availableGeometry that
matches the entire screen.

It's then up to the QWindow to take the safeAreaMargins into account
when rendering, to stay out of any UI elements that the OS may add.
We do this for QWidgets with layouts automatically, and the plan is
to do this for Qt Quick Controls as well. As the current situation
is quite broken anyways, we take the first step now, and then follow
up with the Quick changes later on.

Task-number: QTBUG-121781
Change-Id: I7728e117969474654fcccdb19a6c954bb0eea3f9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-03-20 14:20:59 +00:00
Alexey Edelev dc9c67c260 Allow filtering modules that will use pre-built tools
Add the support for QT_INTERNAL_FORCE_FIND_HOST_TOOLS_MODULE_LIST
argument which allows to set the list of tool targets that should not
build their tools if QT_FORCE_FIND_TOOLS is set to ON.

This mechanism doesn't work when crosscompiling.

Change-Id: I597ed766cc741cacf9cb73dd8dd255644c4c9e66
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-20 10:07:21 +01:00
Vladimir Belyavsky 3924c945d1 QMovie: allow only one dimension to be used for scaledSize
In 4c21f72837 we did this for
QImageReader. So, to support the same for QMovie, we just need
to remove the custom (and very inefficient) scaling for frames.
This should be safe since the underlying QImageReader must ensure
that the returned image matches the scaled size.

[ChangeLog][QtGui][QMovie] Allow only one dimension (width
or height) to be set for the scaled size. In this case, the other
will be calculated automatically based on the original movie size
and maintaining the aspect ratio.

Fixes: QTBUG-115039
Change-Id: I50979a75970c79647dbb8c8b4b121266ba033a63
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-03-20 00:37:24 +00:00
Liang Qi 23a906335e xcb: Avoid recreating xcb window in QXcbWindow::requestActivateWindow()
12203e94f5 exposes the issue in xcb
qpa plugin.

We should not recreate xcb window via the call of focusWindow->winId().

Fixes: QTBUG-123032
Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: I6da4f3e64a9d7a92a2aab714591986c5d128fbd4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-19 23:31:41 +00:00
Tor Arne Vestbø 2da738f035 iOS: Use UIWindow bounds for fullscreen/maximized geometry on macOS
In modern iPad apps, windows can be moved between screens, just like
regular macOS apps, but we don't reflect this as changes to the QWindow's
screen, meaning the screen() is not reliable input when computing
a window's full screen or maximized geometry.

In addition, when running iOS apps on macOS as "Designed for iPad",
the system will scale the UI down by 77%, to better match metrics
(fonts, sizes) to the macOS environment. Classes like UIView and
UIWindow are oblivious to this scaling, and will think they are
larger than what they really are on the screen. However, UIScreen,
for some reason, reflects the actual screen size, instead of taking
part in the "inflated" view of the world.

As a result, even if screen() would reflect the correct screen the
window is on, we can't use the screen geometry for clamping the
window geometry, as the two have separate coordinate systems.

We could scale up the QScreen geometry accordingly to work around
this, but we don't know if the UIScreen behavior is a bug or not,
so instead we skip the screen() as input and use the UIWindow
bounds directly.

Task-number: QTBUG-121781
Fixes: QTBUG-106709
Pick-to: 6.7 6.6 6.5
Change-Id: Ie734fc477b37a7e39e6fb16d7738d3f69731a975
Reviewed-by: Amr Elsayed <amr.elsayed@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-03-19 23:04:46 +01:00
Ulf Hermann 4662e80755 Suppress bogus warning from gcc 12
It says:

/home/qt/qt6dev-src/qtbase/src/corelib/tools/qcontainertools_impl.h: In function ‘auto QtPrivate::sequential_erase_with_copy(Container&, const T&) [with Container = QList<void (*)()>; T = void (*)()]’:
/home/qt/qt6dev-src/qtbase/src/corelib/tools/qcontainertools_impl.h:383:14: error: ‘D.282000’ is used uninitialized [-Werror=uninitialized]
  383 |     const T &tCopy = CopyProxy(t);
      |              ^~~~~
cc1plus: all warnings being treated as errors

We can avoid storing the value into a const ref to silence this. Storing
a non-const pointer into a const reference is quite confusing anyway.

Fixes: QTBUG-123486
Pick-to: 6.5 6.6 6.7
Change-Id: I77fcd871724ce7f81b9567603dc5b4cb31f121c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-19 21:26:24 +00:00
Joerg Bornemann 3dba889fef Fix build of tst_qoperatingsystemversion.cpp with C++20
The QCOMPARE_EQ macro was mistyped.

This amends commit 5ea434b09f.

Change-Id: I313eb5ef02bb2266d659bdbe41d7d8f10691e0ca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-19 21:09:38 +01:00
David Faure 75d82afa0d QObjectPrivate: fix data race on ConnectionData contents
The atomic pointer "connections" is always populated under
mutex in QObjectPrivate::ensureConnectionData() but isn't necessarily
read under mutex protection (e.g. in maybeSignalConnected()).
This caused a data race, fixed by using storeRelease and loadAcquired.

Task-number: QTBUG-100336
Pick-to: 6.7 6.6 6.5
Change-Id: Ifd605e65122248eb08f49e036fdda6e6564226bc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-19 21:09:38 +01:00
David Faure e46f99fdaa QSignalSpy: make the mutex a member variable
The static inline was only a workaround for maintaining BC within
minor releases while backporting the fix. Since we don't promise BC for
QtTest between minor releases, we can make the mutex a proper member
variable for Qt 6.8.

Amends c837cd7593.

Change-Id: I0d6353bdd6a11daa4f927139abf9a867d8c9f95f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-03-19 20:09:37 +00:00
Marc Mutz ce913bff5d tst_QSignalSpy: check (thereby suppress) intended runtime warnings
Use QTest::ignoreMessage() to prevent the runtime warnings being
printed, cleaning up the test log, and to document that they're
intended.

Pick-to: 6.7 6.6 6.5
Change-Id: Ia0ba888cce83529217642be0e7e321d9406ba386
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-19 21:09:37 +01:00
Marc Mutz 7565034aad QSignalSpy: fix C'n'P mistake in a qWarning()
The warning for the new-style signal constructor was copied from the
old-style signal constructor, but not adjusted to its new home. The
signal pointer passed here is not the signal "name", but a signal
"pointer" (-to-member-function, but no need to go into that much
detail).

Amends 6fc7d76e73, but not picking to
very strict LTS branches, just in case someone has a
QTest::ignoreMsg() installed on it.

Pick-to: 6.7 6.6 6.5
Change-Id: Ia1f6b7001f38202ac72f9945c4a822d81562cdbf
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-19 21:09:37 +01:00
Vladimir Belyavsky 4c21f72837 QImageReader: allow only one dimension to be used for scaledSize
If only one dimension (width or height) of the scaled size is set
by an user, let's try to calculate the second one, based on the
image original size and maintaining the aspect ratio.

[ChangeLog][QtGui][QImageReader] Allow only one dimension (width
or height) to be set for the scaled size. In this case, the other
will be calculated automatically based on the original image size
and maintaining the aspect ratio.

Task-number: QTBUG-115039
Change-Id: If1b13b1ead3cf788915c08bdb3ba8becd8bf8042
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-03-19 17:22:16 +00:00
Alexandru Croitor 224b7c6b6a CMake: Allow configuring a minimal subset of examples to deploy
When building examples as part of Qt in the CI, it's best to skip
running deployment for all examples to save resources
(space and time).

Add a QT_DEPLOY_MINIMAL_EXAMPLES option similar to our
QT_BUILD_MINIMAL_STATIC_TESTS option, which will set
QT_INTERNAL_SKIP_DEPLOYMENT at the root examples directory scope, to
skip deployment for all examples.
Each example can then opt into the minimal subset by unsetting the
QT_INTERNAL_SKIP_DEPLOYMENT variable before its
qt_internal_add_example call.

Add Coin instructions to enable this option when building our examples
in the CI.

Pick-to: 6.7
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Task-number: QTBUG-102057
Change-Id: I2efcda455b400c27fe1efd1bcf81b133137fa2d1
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-19 18:22:16 +01:00
Alexandru Croitor c5d0e93199 CMake: Recompute QT_DEPLOY_PREFIX for each built example
The current deployment api implementation sets the value of
QT_DEPLOY_PREFIX based on CMAKE_INSTALL_PREFIX, if no QT_DEPLOY_PREFIX
was previously specified.

This does not work properly when multiple examples are placed in the
same subdirectory and are using deployment api.

Make sure to unset the QT_DEPLOY_PREFIX for each
qt_internal_add_example call, so that a correct prefix is computed for
each example, based on the modified CMAKE_INSTALL_PREFIX value that we
set for each example.

Pick-to: 6.7
Task-number: QTBUG-102057
Change-Id: I931e5f2d683ab94a940e20a2bdfeaa4ac5d8c5f8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-03-19 17:20:24 +01:00
Alexandru Croitor c90964788c CMake: Add option to allow skipping app deployment when building in CI
We would like to add deployment api calls to all our examples.
Doing that in the CI, where we build all examples, would mean running
the deployment tools for each example. This takes time and space.

Add the option to skip running deployment code by setting the
QT_INTERNAL_SKIP_DEPLOYMENT variable.
This can be set per-directory or at the root directory.
In that case we will generate an install script that does nothing.

With this option, we can ensure we run deployment for a few examples,
but skip it for the rest.

Also skip running the deployment api for non-prefix builds, because it
only partially works. In such a case, show a warning. The warning
can be hidden by setting the QT_INTERNAL_HIDE_NO_OP_DEPLOYMENT_WARNING
variable. This might be revisited in the future.

The newly introduced helper functions are also meant to be used in
qtdeclarative.
qtbase only uses one of them, because currently it does not contain
POST_BUILD deployment logic.

Pick-to: 6.7
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Task-number: QTBUG-102057
Change-Id: If5a4102137e9dfc4a8bfde7b26d511ed1700340e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-03-19 17:20:23 +01:00
Alexandru Croitor a6965441d7 CMake: Evaluate genexes for extra deploy file paths
Since d08fa86e63 we add extra deploy
files with target file information.

The file paths contain a $<CONFIG> genex to handle multi-config
builds. These were not evaluated in the DeploySupport file content.

Add a TARGET_GENEX_EVAL genex around the TARGET_PROPERTY genex, to
ensure they do get evaluated.

This avoids an error like:
 include could not find requested file:
   C:/Users/qt/work/qt/qtbase_build/.qt/QtDeployTargets-$.cmake

Amends d08fa86e63

Pick-to: 6.7
Task-number: QTBUG-117948
Task-number: QTBUG-118153
Change-Id: Ia3898c31d80b82bdb25fe733fc73b45c6d689ed0
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-19 16:48:58 +01:00
Alexandru Croitor 270315e019 CMake: Fix finding standalone parts config file for yocto
When building standalone tests of qtsvg targeting yocto, the
standalone parts config file was not found.

That's because it specifies a new CMAKE_STAGING_PREFIX for each built
repo, and the QtSvgTestsConfig.cmake file will be located there,
rather than in QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX, where
the QtBuildInternalsConfig.cmake file is.

So in this case, we always have to prefer looking into
CMAKE_STAGING_PREFIX for the file.

Amends 62905163bf

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I8902381afa4267e40dfb2ad47e44285a806a35e2
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-19 16:04:59 +01:00
Tatiana Borisova 8ed8844343 QCborArray: use new comparison helper macros
Replace public operators operator==(), operator!=(), operator<() of
QCborArray to friend methods comparesEqual() / compareThreeWay().

Use QT_CORE_REMOVED_SINCE to get rid of current comparison methods
and replace them with a friend.

Delete #if 0 && __has_include(<compare>) blocks,
since they are not required anymore.

Add friend methods comparesEqual(QCborArray, QCborValueConstRef)
and compareThreeWay(QCborArray, QCborValueConstRef) to QCborArray
to support comparison between QCborArray and
QCborValueRef/QCborValueConstRef, see test-case mapMutation().

Add QT_TEST_EQUALITY_OPS/QT_TEST_ALL_COMPARISON_OPS tests for QCborArray
test-cases.

Task-number: QTBUG-120300
Change-Id: Ifad1a04c61363618e8bba73cf7c87757552d722a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-19 14:38:11 +00:00
Tor Arne Vestbø 5e81a17b22 cmake: Merge Apple platform auto-detect functions
Makes it easier to see the interaction between the different
parts, and extract some of them to apply to a wider set of
platforms later on.

Change-Id: I3dd71dd6ad7a5b2870ab60bfbe4cf31be418bd8a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-19 14:52:48 +01:00
Ahmad Samir b3e9e80719 tst_qdir: don't use the source dir for testing
Copy test dirs from the source dir to a QTemporaryDir,
this way each run starts with a clean slate.

Also on some setups the source dir could be read-only.

Task-number: QTBUG-117449
Change-Id: Iea5fd661b66dd3cbae0b663bb504b14c8ccbe491
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-19 15:52:48 +02:00
Tor Arne Vestbø 14ec2ab89f Add configure feature for Metal
Simplifies maintenance of code paths that rely on Metal.

Change-Id: I1d1f705fffc14dbafde346eeb555b43be6d5be54
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-19 14:52:48 +01:00
Tor Arne Vestbø e8e029e2a5 iOS: Replace deprecated UTType constants
Change-Id: Ia610d46cf36292327ef87645af7516754eb1c79c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-03-19 14:52:48 +01:00
Tor Arne Vestbø 317a519431 iOS: Remove support QClipboard::FindBuffer
The Find pasteboard has been unavailable on iOS since iOS 10.

Change-Id: I05d5ae49b3a733144ac5c35970ff4a3c62923650
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-03-19 14:52:48 +01:00
Chris Lerner 379f23cfdc Correct a typo in the reference documentation of D-Bus Chat example
In the sentence "Users connect and send message to each other",
change "message" to "messages".

Pick-to: 6.7 6.6 6.5 6.2
Change-Id: Ib4d0991d314cd300a56def8797cac604fa88ea35
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-19 12:45:38 +00:00
Mate Barany 282839ad41 Add a means to send a PUT request with an empty body
We have implemented the same functionality recently for POST, in this
patch implement it for PUT.

Task-number: QTBUG-108309
Change-Id: I34c41538054fec836d0d1d1dbb44fabab9bc0e9a
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-19 13:01:31 +01:00
Mate Barany e566a8a968 Add a means to send a POST request that has an empty body
Actually this has already worked if a nullptr was casted as a
QIODevice*. Add an overload with a nullptr_t type, that does
this behind the scenes.

Fixes: QTBUG-108309
Change-Id: I2d4b17ae94cf4de2c42257d471ef901c8994fee5
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-19 13:01:31 +01:00
Piotr Wierciński cd2e1b0b4b wasm: Fix minimum and default window sizes
Remove minimum window size restriction. User should be able to change
minimum window size if needed.
Set default size to 160x160 to match other platforms.

Change-Id: Ic199fc34982021ba38d631476fbb1c51370b2e8e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-19 11:51:00 +01:00
Ulf Hermann 476e503cfb QProperty: Use RefCounted as intended
You're not supposed to mess with the refcount directly. That's what the
addRef() and deref() methods are for.

Change-Id: I5cae946cef7ac72dd99b247ade95590d142c269e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-03-19 11:51:00 +01:00
Even Oscar Andersen 7071010880 wasm: Add qdiriterator test + minor runtime fixes
There was a runtime feilure in that we try to create
directories until it fails. This does not fail on wasm
so added a hardlimit of 20480

Change-Id: I6ef65f7be277fc8775879733f969d2ce008a439a
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2024-03-19 10:28:06 +01:00
Piotr Wierciński a1a8a20206 Revert "wasm: Temporarily disable selenium tests"
This reverts commit c2b359721d.

Reason for revert: Required fixes have been merged

Change-Id: I2314323e7ee673fe4136ce4ac4f867ac18dcd2e6
Reviewed-by: Simo Fält <simo.falt@qt.io>
2024-03-19 05:42:21 +00:00
Mitch Curtis ce9f06c157 Doc: explain how to check for the existence of a font family
bb6d68703b67e042e2a7254c2ca6a004a1441cc5 fixed warnings in the
Universal style by using a faster alternative. It's possible that users
will run into these warnings too, and they should be provided with
information to make a more informed choice about which approach they
can use.

Fixes: QTBUG-123360
Pick-to: 6.5 6.6 6.7
Change-Id: I4170e9ade40c4b54dbc2bd73d124b2ade4d8c939
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2024-03-19 12:31:31 +08:00
Giuseppe D'Angelo 9ff1e6d80b Add hardening build options
This commit enables hardened-specific checks and codegen, inspired by
GCC 14's -fhardened command line switch and LLVM/libc++'s hardened
modes.

We enable (depending on compiler capabilities):

* -ftrivial-auto-var-init=pattern;
* -fstack-protector-strong;
* -fstack-clash-protection;
* -fcf-protection=full or /CETCOMPAT;
* -D_FORTIFY_SOURCE=3 or 2 on Glibc, depending on the Glibc version,
  provided that some optimization level is enabled (release build or
  optimized debug build);
* on libstdc++, -D_GLIBCXX_ASSERTIONS;
* on libc++, -D_LIBCPP_HARDENING_MODE set to
  _LIBCPP_HARDENING_MODE_EXTENSIVE in debug and to
  _LIBCPP_HARDENING_MODE_FAST in release (_DEBUG is too slow);
* -Wl,-z,relro,-z,now.

This aligns us 100% with -fhardened (we already pass -fPIE and -pie
anyhow). Some Linux distributions already ship GCC/Clang with some of
these options enabled by default.

The check for Intel CET has been amended to always test if the compiler
supports the corresponding flag; and, if so, enable the feature. Before,
it was behind a configure option and the test only checked if the
compiler had CET support automatically active (the test didn't pass
-fcf-protection to the compiler).

The check for -fstack-protector-strong has been made general (rather
than QNX-specific). We don't support QNX < 7 anyhow.

Finally, the qt_config_linker_supports_flag_test test has been
amended to also support MSVC.

All of the hardening options are enabled by default.

[ChangeLog][Build System] Qt builds by default in "hardened mode",
meaning that a series of security-related compiler options are
automatically enabled. In the unlikely case in which these options
constitute an unacceptable performance hit, it is possible to disable
individual hardening options when configuring Qt.

Change-Id: I2c026b0438010ad10d5e7b1136fedf4ae3af8822
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-19 02:52:43 +01:00
Tor Arne Vestbø a89a916377 iOS: Remove NSView.safeAreaInsets wrapper
The API is available on all iOS versions we support nowadays.

Pick-to: 6.7 6.6 6.5
Change-Id: Ia58c5ad1649e7e6b22f9c56a809e2455586a8e5a
Reviewed-by: Amr Elsayed <amr.elsayed@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
2024-03-19 01:52:29 +01:00
Yifan Zhu daa5f7bd5f qxkbcommon: fix isKeypad
This amends a34e81ab8b .

The previous range comparison doesn't work since XKB_KEY_KP_9 is 0xffb9
while XKB_KEY_KP_Equal is 0xffbd. Change to an explicit switch.

Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: I3a340bac61fb074eef505ef9b06300a6468877f1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2024-03-19 00:52:29 +00:00
David Faure c837cd7593 QSignalSpy: fix data race between wait() and emit from another thread
Detected by TSAN in tst_QThread::terminateAndPrematureDestruction()
but better have a dedicated unittest, with values emitted by the signal
and recorded in the spy.

Pick-to: 6.7 6.6 6.5
Change-Id: I141d47b0ea0b63188f8a4f9d056f72df3457bda5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-19 00:55:15 +01:00
Tatiana Borisova 2b2cd119e1 QCborValueConstRef/QCborValueRef: use new comparison helper macros
Replace public operators operator==() and operator!=() of
QCborValueConstRef and QCborValueRef classes
to friend methods comparesEqual().
Replace public operator<() of QCborValueConstRef and QCborValueRef
classes to friend methods compareThreeWay() respectively.

Use QT_CORE_REMOVED_SINCE to get rid of current comparison methods
and replace them with a friend.

Delete #if 0 && __has_include(<compare>) blocks,
since they are not required anymore.

Add comparison() test-case for QCborValueConstRef/QCborValueRef
testing.

Add QCborValue::operator==()/QCborValue::operator!=()/
QCborValue::operator<() and QCborValueRef::operator==()/
QCborValueRef::operator!=()/QCborValueRef::operator<() operators
to the removed_api file.

Task-number: QTBUG-120300
Change-Id: I2e8e4e32b7b5b49da321364cc12986e9c64b5f37
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-19 00:48:23 +01:00
Thiago Macieira 5401a9a6cd QDBusArgument: disambiguate between QMap on std::pair and std::map
For QMap on a std::pair, QMap::iterator{}.operator->() would result in a
type that has "first" and "second" members: std::pair itself. But it
would be wrong to marshall and demarshall the first and second elements
thereof as the key and value, so give preference to the .key() and
.value() selection, which would store the std::pair as the type.

Fixes: QTBUG-123401
Pick-to: 6.5 6.6 6.7
Change-Id: I6818d78a57394e37857bfffd17bd69bb692dd03b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-18 14:43:13 -07:00
Alexandru Croitor 990b60120e cmake: Override generator for iOS projects to Xcode in qt-cmake.in
Instead of maintaining a separate qt-cmake.ios.in wrapper script that
can easily diverge from qt-cmake.in

Change-Id: I53f4eac02188be89a4c11b3e71cde04ac2a24b51
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-18 22:34:48 +01:00
Eskil Abrahamsen Blomfeldt 6ee5fcc456 Support foreground gradient in CSS parser and HTML generator
Qt supports some complex foreground brushes which we cannot
express using normal CSS, so we introduce a Qt-specific property
for this. We already had some support for background gradients
in widget style sheets, but this expands support to foreground
brushes of text when converting a QTextDocument from and to HTML.

It also adds an optional "coordinatemode" attribute to the
gradient functions so that this can be faithfully restored from HTML.

Task-number: QTBUG-123357
Change-Id: I3d6dd828f68272995c8525bec5a7b421fdbed670
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-03-18 20:28:36 +01:00
Eskil Abrahamsen Blomfeldt e205edfff6 Implement support for stroke color and width in CSS parser
CSS does not have text outline properties, instead different
browsers have custom properties for this. That currently means
that you can have a QTextDocument where you applied a stroke to
text and textEdit.setHtml(textEdit.toHtml()) will remove it.

Since a primary goal of the HTML support in QTextDocument is that
it can be used to save and faithfully restore its contents, we
implement qt specific properties for stroke.

Task-number: QTBUG-123357
Change-Id: Id9cf63abfabe2109ffb6fd74f9cb013304763ccb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-03-18 20:28:36 +01:00
Thiago Macieira 58796ac177 qfloat16: further disable the -Wfloat-conversion warning
It shows up in our headersclean mode.

Fixes: QTBUG-123374
Pick-to: 6.6 6.7
Change-Id: I6818d78a57394e37857bfffd17bcf9e350dc493c
Reviewed-by: Simo Fält <simo.falt@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-03-18 12:28:36 -07:00
Liang Qi 8a67504754 Fix dangling references - GCC 14
This amends 18def77d27 .

Pick-to: 6.7 6.6 6.5
Change-Id: Icadf46326f1fda1bdbcd40d101170581e510b87a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-18 20:28:36 +01:00
Øystein Heskestad 89467428f8 QHttp2Connection: Send error for CONTINUATION without preceding data
Send connection error type PROTOCOL_ERROR when receivng CONTINUATION
frames without any data received from previous HEADERS or PUSH_PROMISE
frames, instead of assert.

Task-number: QTBUG-122375
Pick-to: 6.7
Change-Id: Ib14e4610692dc4832b1f3e99dca497d9baf3d9d3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-18 20:28:36 +01:00
Tatiana Borisova 9377039fe5 QCborValue: use new comparison helper macros
Add qcborvalue.h header to removed_api.cpp file
Ammends from 15da9c75d0a05b7451a35b5b6a3c940f9cb85143

Task-number: QTBUG-120300
Change-Id: Ic33bf80298730f2c3fd408ffb45f0e1b32f531fc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-03-18 20:28:36 +01:00
Isak Fyksen 5e29bd14a4 Fix truncation warning in generation_helpers
Remove redundant if-statement and return bool value, rather than -1.

Fixes: QTBUG-122302
Change-Id: I06e98eb76e160f7dd7859ab43f23eb3b6540dbd5
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-18 20:10:34 +01:00
Tor Arne Vestbø 7826a96652 cmake: Move iOS detection into qt_auto_detect_ios
We don't need to deal with the input arguments to configure. We
can instead look at QT_QMAKE_TARGET_MKSPEC, like we do when we
auto detect other platforms. This handles both the -xplatform
and the -platform arguments.

Change-Id: I8d987d23e16bfa106833d521f67e8b5a931d9169
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-18 19:04:14 +01:00