Commit Graph

61943 Commits

Author SHA1 Message Date
Tor Arne Vestbø
08f2757fe0 Move chart example to manual test
Change-Id: I95a40834853a0157d8fa6137431bfd86ce855b2f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e46fb69a87)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-29 14:39:41 +00:00
Tor Arne Vestbø
a9b924dca6 Move character map example to manual test
Change-Id: Ie27fe436fc7ae7774beaa78f8a27f6009027753a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3a8265a429)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-29 14:39:40 +00:00
Tor Arne Vestbø
de85c3a3d0 Move dock widgets example to manual test
Change-Id: I23ca3f2450df8f6c71509235ccec655d88d0d6d7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2a65849e10)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-29 14:39:39 +00:00
Tor Arne Vestbø
d3cef8f3f4 Move dirview example to manual test
Change-Id: I9057d5efb1cdf3e425e879f8cc96a544c1892e77
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fc0e82f58a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-29 14:39:37 +00:00
Tor Arne Vestbø
366bf02129 Move calendar example to manual test
Change-Id: Ie2215ae0feeb322888619aed632e20db9b69e20b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 288c7ef557)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-29 14:39:37 +00:00
Tor Arne Vestbø
fcf1dc1633 permissions: Handle EKAuthorizationStatusWriteOnly on macOS 14/iOS 17
For now we do not have a QCalendarPermission::AccessMode::WriteOnly,
so we have to report Qt::PermissionStatus::Denied.

Fixes: QTBUG-114864
Change-Id: I94e92912ef4c24adb524ccf2cf28553115d6781b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 2736e908e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-29 14:39:32 +00:00
Tor Arne Vestbø
7eb7da8e52 CoreText: Handle failure to find matching theme font descriptors
CTFontDescriptorCreateMatchingFontDescriptors has been observed to
return nullptr, so we need to handle that explicitly.

Fixes: QTBUG-113698
Change-Id: Ic9fa574c14068fcae98fe8e6ceddd8a4f7008210
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9526a76936)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-29 14:39:30 +00:00
Tor Arne Vestbø
77573a04aa Move windowcontainer example to manual test
Change-Id: I68b866bcc2659b90aad2c10dc06240674bf4a826
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit cd7995de57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-29 14:39:29 +00:00
Tor Arne Vestbø
8b8b7467bf Move border layout example to manual test
Change-Id: I3f45043a64275f8678288e1d9839271eafa1fd2b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 42b58f8cb4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-29 08:40:23 +00:00
Tor Arne Vestbø
cd54a5e837 Fix qdoc link warnings after moving a few examples to manual tests
Change-Id: I81a6e9d52e858c3f733d4c527c70408772813b56
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 71f156fff0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-29 08:40:23 +00:00
Tor Arne Vestbø
2d83c9d026 Move item views puzzle example to manual test
Change-Id: Idbb4222861be86275a86f731e75127b8496a08a7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a18c55e738)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-29 08:40:23 +00:00
Marc Mutz
212ff817ca Make qt_noop() constexpr and noexcept (for C++)
Since qt_noop() is supposed to be a no-op, it should not affect
constexpr'ness and noexcept'ness of functions and expressions it's
(indirectly) used in.

That requires that it be constexpr and noexcept itself. Add the
keywords, but guard against use from C. We can't use our Q_ macros
(which would enable noexcept for C, too, on some compilers, because
qcompilerdetection.h depends on qtnoop.h, and we don't want the
circular dependency.

Change-Id: Ie5441c423b7942a6c956345126fc7aec99907d25
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7bad2902f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-29 08:40:23 +00:00
Marc Mutz
13197d7506 Remove all class-level [[nodiscard]] from the code-base
A class-level [[nodiscard]] used to be the only way to get a waring
for code such as

   QMutexLocker(&mutex);

with original C++17 means. This was because a few of our compilers
would warn about the presence of [[nodiscard]] on ctors, which is
really the semantics we want: we don't want to prevent users from
passing QMutexLocker out of functions and users of those functions
from ignoring the return value, if they so choose. That should be the
choice of the author of the function returning such types, not ours.

So QUIP-0019 makes class-level [[nodiscard]] conditional on proper
rationale in the user docs (or the commit message in case of private
API). Since none of the existing uses really strikes this author as
particularly convincing, remove them all.

All these classes have gotten Q_NODISCARD_CTOR on all their ctors, so
we continue to provide the same true positive warnings, minus the
false positives when returning from functions, at least on the
majority of compilers (and it's not as if all compilers interpreted a
class-level [[nodiscard]] as a trigger to warn on the initial example
of this commit message).

Task-number: QTBUG-104164
Change-Id: I163356486e7c80f9d69bf67023010a88233fe662
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 01e1dc273d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-29 08:40:22 +00:00
Michael Klein
91132d6b27 QNetworkReply: Propagate proxy errors properly
Map QNetworkError::HostNotFoundError and QNetworkError::ConnectionRefusedError
 to ProxyNotFoundError resp. ProxyConnectionRefusedError when it originated
from the communication with the proxy server.

Fixes: QTBUG-68821
Change-Id: I21b91f2667ba0cd329d4ece1fe543472cdab2d22
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 69de333e1f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-29 06:08:01 +00:00
Yuhang Zhao
972984521e WASM: don't ignore custom QSurfaceFormat settings
Previously, Qt would always ignore user's custom QSurfaceFormat
settings and this behavior makes user have no way to control
the preferred OpenGL version when running on WASM. And after reading
the wasm platform plugin code, I don't see any reason why we should
limit ourself to the default OpenGL version. And I've tested this
patch locally, Qt still work normally if I set a newer OpenGL version.

Change-Id: I0cfb831d6a722fe61cc85808a6d9e3098c73d82e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 33a9cbef65)
2023-06-29 05:53:32 +00:00
Axel Spoerl
51dc94df9c QGtk3Theme: Do not default Active WindowText to button foreground
QGtk3Theme uses the GTK button foreground as a default for the
WindowText color role. When a GTK3 theme has no specific color for the
entry text, this can lead to text on certain assets looking darker
and thus disabled.

This discontinues usage of the button foreground for the window text.

Finding the WindowText color role in QPlatformTheme::SystemPalette now
follows the following logic:
(1) GTK normal entry text is used if specified. This is the preferred
option, copying GTK behavior.
(2) If (1) is not specified, the GTK default text color is used, making
WindowText equal to Text.
(3) If neither (1), nor (2) are specified, the WindowText color role is
taken from qt_fusionPalette, where it is also equal to Text.

The SystemPalette is used as a default template for all other control
or widget speicific palettes. The rules above therefor apply to all
screen assets (unless they use a JSON file to specify a their
individual WindowText).

[ChangeLog][QGtk3Theme][SystemPalette][WindowText] Default to GTK
Entry Text / Normal Text / qt_fusionPalette

Fixes: QTBUG-114600
Change-Id: I4c96ac7d096526faf4c2feee436753990c6c9f92
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 574a47dd5a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 20:48:53 +00:00
Alexey Edelev
32466f5763 Pass CMAKE_OSX_SYSROOT to syncqt CMAKE_FLAGS
Fixes: QTBUG-114803
Change-Id: I2eed5d6a7255eb61eff09d0c9a102e0652e63c0c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a3ec70a929)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 20:09:32 +00:00
Alexandru Croitor
87ccb0b481 CMake: Require CMake 3.21 when building/using Qt on Apple platforms
Explicitly check that at least CMake 3.21 is used when building Qt or
when using Qt in a project.
This only affects macOS and iOS builds.

We check for 3.21 instead of 3.21.1 as described in the documentation
to avoid an error like:

 Policy VERSION range "3.21.1...3.21" specifies a larger minimum than
  maximum.

Until the technical limitation is addressed, if someone does end up
using 3.21.1, another existing check for "unsuitable" cmake versions
(as opposed to minimum required) will let them know they should use
something newer.

Amends 1cf3295cef321c9a587af2f2de7740c0cd3ca743.

Fixes: QTBUG-114869
Change-Id: I2a479baaa63cfbe23af187cf0796e1c00042692b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9ef864f56f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 20:09:30 +00:00
Marc Mutz
afe4666519 De-inline QGenericRunnable overrides
Pins the vtable to a single TU and therefore prevents duplicate
vtables, -Wweak-vtables warnings and false-positive dynamic_casts.

This requires exporting QGenericRunnable, which hopefully won't
also export the nested class.

Task-number: QTBUG-45582
Change-Id: Ie1f29d25b0dcdee7654c33c497e8e0350d12e311
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit be1b589cb9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 17:58:25 +00:00
Morten Sørvig
07708f6e61 wasm: fix touch -> mouse event synth on Safari
Mobile Safari generates touch pointer events with negative
pointer id's, which causes processTochEvent() to skip
the event instead of synthesizing a mouse event.

Ensure that the id's are always positive by taking the
absolute value of the event.

Change-Id: I1514329dc76ecc4b9103f7deca9642aaf304df8b
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 7a31911b79)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 17:58:25 +00:00
Michal Klocek
970888356a Fix headers clean for newer msvc
Newer msvc gives C4309 warning for 'initializing':
truncation of constant value

Warning would go away if we had 'enum foo: unsigned'.
Disable the warning for problematic enums is not enough
as it also complains about headers coming from windows sdk
like:

C:\Program Files (x86)\Windows
Kits\10\include\10.0.22621.0\shared\wtypesbase.h(395): warning C4309:
'initializing': truncation of constant value

Note 10.0.22621.0 is the latest sdk already.

Do not disable language extensions for header clean target.

This reverts commit 8bf602518d

Task-number: COIN-1059
Fixes: QTBUG-114931
Change-Id: Ifc3883f88a6bd52794a37dc640eca99c158a40e0
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 2dcc30592b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 17:58:25 +00:00
Laszlo Agocs
613a37e7ca rhi: gl: Correct data type for D24 and D24S8
Change-Id: I7aaaba49d0cc427c82e1ee4d0657b2992ffd4905
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 409cd2be18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 17:58:25 +00:00
Amanda Hamblin-Trué
5ef2440102 Revamp bindable subscription example
Silence a bogus warning.

Task-number: QTBUG-114689
Change-Id: I7267b752e780b0c48cc57a513d12ad504e4c7a30
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 0644f8e63a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 17:58:25 +00:00
Laszlo Agocs
27d2256494 rhi: d3d: Handle the case of passing in a texture array as depthTexture
Behave identically to Vulkan, i.e. create a view that spans all array
elements. (except when the range is set)

This becomes relevant with multiview, where the depth/stencil attachment
the render target must be set up with a texture array as well, similarly
to the color attachment. But applies even to D3D11, even though it is
not common to use a texture array there, but it's possible.

Task-number: QTBUG-114896
Change-Id: Ieda8475500b0553f8c14aa9ecad57001b9714d49
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit e126558b9b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 17:58:25 +00:00
Morten Sørvig
34a64c3771 QWizard: Support fractional DPR on Windows
We were storing the DPR as int; change to qreal.

Task-number: QTBUG-114175
Change-Id: I7dc7df82f584cddbbb3f690f1df74e7a30369ab2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c0e48ed645)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 15:58:00 +00:00
Amanda Hamblin-Trué
2bc452d8a3 QBindable example: Replace SpinBox connection with QBindable
Made this change because there was no example of the interaction
between QBindable and non-bindable properties.

Task-number: QTBUG-114689
Change-Id: Ief7662f8af5e6fab32491418fa35f0daa937819d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 19b0800555)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 13:20:34 +00:00
Timothée Keller
fe36efc625 Windows QPA: Move transient children with a window move
When moving a window with keyboard shortcuts, popup menus currently do
not follow along. Allow this to happen by accounting for a window's
transient children, and moving them after the owning window has finished
its move.

Fixes: QTBUG-106483
Change-Id: Id51a7c0163e4fdd2d139565f2bf500a3fc997488
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 530d092eae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 08:57:01 +00:00
Assam Boudjelthia
75abc39672 Android: explicitly bundle the OpenSSL libs for tests
Use the new argument to bundle the OpenSSL prebuilt libararies so that
ssl operations are actually tested at runtime.

Task-number: QTBUG-110025
Change-Id: I0d73fed463a1724a9e0ee84ba603aa2ff1bc649b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f667445006)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 07:57:31 +00:00
Assam Boudjelthia
72821e7ebd Android:CMake: Add argument to bundle OpenSSL libs for internal tests
The new argument would allow bundling the prebuilt OpenSSL libs
into the test apk so that SSL can actually run. It expects the CMake
argument OPENSSL_ROOT_DIR to be set ( we set that in Coin configs).

Task-number: QTBUG-110025
Change-Id: I4c82796635ca89f5511255ae26182f41a504b026
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9d5a8162a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 07:57:28 +00:00
Tor Arne Vestbø
f1e796193a Move fridge magnets example to manual test
Change-Id: I6e40aff63f24dc98ab6b84450d288159f036142b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 532e1c9bf6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 07:57:06 +00:00
Tor Arne Vestbø
58aa9808a4 Move graphis view flow layout example to manual test
Change-Id: I713816114b87def9eab79b893d13554f1c37c6a5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 95595d68be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 07:57:04 +00:00
Tor Arne Vestbø
3852b2f4fd Move icons example to manual test
Change-Id: I08f44448f96a61f780c21d628954879c7b28dce3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c3fd8e911e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 07:57:03 +00:00
Tor Arne Vestbø
028c3b6e15 Move font sampler example to manual test
Change-Id: I696d9be26edfaadd40579884930b2f061d308a06
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 917282ea53)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 07:56:57 +00:00
Tor Arne Vestbø
c0d9424404 Move finger paint example to manual test
Change-Id: I26eec035eaa78eac2aa96de72ae38093bc08fd23
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0b6f5ae131)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 07:56:50 +00:00
Axel Spoerl
28ee92c656 QDialogButtonBox - code cleanup
Replace const char * based connect statements by modern API and remove
'_q_' slot prefixes.
This requires explicit disconnection in the destructor -> add.
Replace bool traps for layouting and removing buttons by enum classes.
Replace if/elseif event handler by switch.
Replace iterator typedef with auto.
Encapsulate logic to ensure defaulting to first accept button in a
member function for better readability.
Remove dead code.
Move private header declaration from cpp to a new _p.h.

Task-number: QTBUG-114377
Change-Id: I8a2bc355e3816c3c826c10cd96194c89bf0ae510
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit df735d794f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 01:37:54 +00:00
Ahmad Samir
2b0ea48258 Handle a couple of GCC 13 warnings about dangling references
There are two temporaries, reply.arguments() returns a temporary QList
and list.at(0) returns a temporary reference to the first element. The
local reference variable would only extend the lifetime of the temporary
object it's bound to, list.at(0), but not the temporary list itself.
Even though this a false positive in this case because QList is
implicilty shared, the compiler can't tell the difference and the fix is
simple.

tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp:1845:21:
warning: possibly dangling reference to a temporary
[-Wdangling-reference]
 1845 |     const QVariant &retval = reply.arguments().at(0);
      |                     ^~~~~~
tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp:1845:50:
note: the temporary was destroyed at the end of the full expression
‘QDBusMessage::arguments() const().QList<QVariant>::at(0)’
 1845 |     const QVariant &retval = reply.arguments().at(0);
      |                              ~~~~~~~~~~~~~~~~~~~~^~~

Change-Id: I03d54b56769cbd0f9f1165e4679ec4947267181a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3a9526468c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 01:37:53 +00:00
Tor Arne Vestbø
b024426ee9 Move embedded dialogs example to manual test
Change-Id: I86213aa47def7ebacaa9465a0200cef10871706e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7b4b5c839b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 01:37:53 +00:00
Tor Arne Vestbø
16c9ea4194 Move drag and drop puzzle example to manual test
Change-Id: I859cdb2cf74cd6272c29924c77dab26b4f4c0b6c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit cefb1c9ca9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 01:37:53 +00:00
Marc Mutz
3343eeb1fb tst_QFutureSynchronizer: describe how setFutureAliasingExistingMember() works
So no-one 'fixes' the test by pinning synchronizer.futures() into a
named variable or collapsing the two lines into one. Both would break
the premiss of the test.

Amends e8dcbaaaf6.

Change-Id: I7a98c382a7db0bf3ff369dcaf61af0942796d6a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 70a7a695fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-28 01:37:53 +00:00
Amir Masoud Abdol
f03c7e4a2d Introduce -no-vcpkg flag for disabling vcpkg detection/integration
Vcpkg detection is enabled by default, but we did not have a flag to
disable it, and it was not showing up in config.summary either. By
adding a -vcpkg flag, we get to use `-no-vcpkg` when necessary, as well
as adding an entry to config summary indicating whether vcpkg is in use
or not. Besides `-no-vcpkg`, one can pass `-DQT_USE_VCPKG=OFF` to cmake
command in order to disable the automatic vcpkg detection/integration.

[ChangeLog][configure] vcpkg detection, and integration can be disabled
by passing the -no-vcpkg flag to the configure command, or by passing
`-DQT_USE_VCPKG=OFF` to the cmake command.

Change-Id: Ide8da70a7b473ec23995104d162356e75e6d1240
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b3f27f75b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-27 22:00:08 +00:00
Ahmad Samir
a13f78144a QXmlStreamReader: make fastScanName() indicate parsing status to callers
This fixes a crash while parsing an XML file with garbage data, the file
starts with '<' then garbage data:
- The loop in the parse() keeps iterating until it hits "case 262:",
  which calls fastScanName()
- fastScanName() iterates over the text buffer scanning for the
  attribute name (e.g. "xml:lang"), until it finds ':'
- Consider a Value val, fastScanName() is called on it, it would set
  val.prefix to a number > val.len, then it would hit the 4096 condition
  and return (returned 0, now it returns the equivalent of
  std::null_opt), which means that val.len doesn't get modified, making
  it smaller than val.prefix
- The code would try constructing an XmlStringRef with negative length,
  which would hit an assert in one of QStringView's constructors

Add an assert to the XmlStringRef constructor.

Add unittest based on the file from the bug report.

Later on I will replace FastScanNameResult with std::optional<qsizetype>
(std::optional is C++17, which isn't required by Qt 5.15, and we want to
backport this fix).

Credit to OSS-Fuzz.

Fixes: QTBUG-109781
Fixes: QTBUG-114829
Change-Id: I455a5eeb47870c2ac9ffd0cbcdcd99c1ae2dd374
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 6326bec46a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-27 21:11:41 +00:00
Ahmad Samir
47c6473680 QXmlStreamReader: change fastScanName() to take a Value*
For easier debugging, e.g. to print out value.len and value.prefix.

Change-Id: Ib0eed38772f899502962f578775d34ea2744fdde
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 1a423ce437)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-27 21:11:33 +00:00
Alexey Edelev
c131e159b0 Introduce QT_SYNC_HEADERS_AT_CONFIGURE_TIME flag
The syncqt tool was originally designed to run at build time, as a
part of dependency chain of Qt modules. This works well unless we need
the code model of the Qt project in IDE, since Qt source code actively
uses header aliases, and creating them at build time breaks the code
model until the initial build is done. So we made syncqt the configure
time tool to not break the developer experience.

It's more likely that developers build Qt using command line or don't
need the code model before the first build. So running the tool at
configure time should be optional.

QT_SYNC_HEADERS_AT_CONFIGURE_TIME switches the "mode" of the syncqt
tool from build time tool to the configure time tool. Without the
option enabled build procedure runs all the syncing targets at build
time only. The exception are the developer builds, if the
'-developer-build' option is enabled, QT_SYNC_HEADERS_AT_CONFIGURE_TIME
is set to TRUE by default. This gives better development experience for
the developers that don't use the code model in their IDE or don't
require it before the first build is finished. Also this build time
mode is preferred for the CI or similar build procedures where code
model is not required at all.

By default, the option initialized from the
QT_INTERNAL_CONFIGURE_FROM_IDE CMake variable.

TODO: The option is forced to TRUE for the static Ninja Multi-Config
builds. See QTBUG-113974 for details.

[ChangeLog][Build System] When building Qt from sources, syncqt and Qt
header files are now created at build time, not configure time. This
should speed up the configuration step. You can set the CMake variable
QT_CONFIGURE_TIME_SYNC_HEADERS to ON to use the previous behavior,
though. The old behavior is also preserved if cmake/configure is run
from inside an IDE - Qt Creator, Visual Studio Code, and CLion are
currently detected.

Task-number: QTBUG-111163
Task-number: QTBUG-109792
Change-Id: Ib61bda9546e58492be874a8591c37e100313d02c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a8cf976ce6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-27 20:03:54 +00:00
Liang Qi
c73372b5fe tests: skip tst_QWindow::enterLeaveOnWindowShowHide() on Wayland
This amends 79ac430537.

Change-Id: Id68daff20de11361a1bb20071266e8adafe5e9c4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d1f3ffc80b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-27 20:03:53 +00:00
Ahmad Samir
50dbf86104 QTest: port qSleep() to std::this_thread::sleep_for
As requested in code review. Big improvement, code-wise.

tst_Sleep::wait() was failing on the CI, so be more accurate by using
QElapsedTimer::durationElapsed(), which returns nanoseconds.

Change-Id: I5bed6d6bd768adfdecab2475e6cbe245c20aabd7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8ace5b26aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-27 20:03:51 +00:00
Topi Reinio
50150e3b4e Doc: Add \relates command to two global swap() functions
And fix incorrect copy-paste error in QBasicTimer's swap()
description, 'string' -> 'timer'.

Change-Id: I28f5e4d6c8e3b8698ab9b4587d503b06c5628b78
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 2f283489ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-27 13:02:27 +00:00
Giuseppe D'Angelo
abd60e9592 SSL: upgrade the default DH parameters
We have been using as default DH parameters the 1024-bit MODP group.
This is now considered insecure, and applications should use the
2048-bit at a minimum [1]. This commit therefore replaces the parameters
with the 2048-bit MODP group from [2].

To double check the data, use openssl asn1parse to verify that the prime
matches. For instance:

1) put the encoded string in a `encoded.txt` file (c&p from the source,
   removing the double quotes)
2) put the hexadecimal value of the 2048-bit group in a `reference.txt`
   file (c&p from [2])
3) compare the output of openssl asn1parse with the reference. For
   instance like this:

    $ diff <(openssl asn1parse < encoded.txt | grep -m 1 INTEGER | perl -pe 's/.*://; s/\n//') <(perl -0777 -pe 's/\s//g' reference.txt) && echo OK
    OK

[1] https://datatracker.ietf.org/doc/html/rfc8247#section-2.4
[2] https://datatracker.ietf.org/doc/html/rfc3526#section-3

[ChangeLog][QtNetwork][QSslDiffieHellmanParameters] The default
Diffie-Hellman parameters are now using the 2048-bit MODP group from
RFC 3526.

Change-Id: I47133cd78ba0e954b8f93a3da09fa2c760c9f7a8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 3ec24e329c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-27 11:16:03 +00:00
Laszlo Agocs
0445c77429 rhi: gl: Make resolve on par with other backends
Just handling attachments with a render buffer set and only one
attachment is not what other backends do. They support all attachments
and also the cases of multisample (2D) textures and multisample texture
arrays.

By extension this allows multisample 2D texture arrays. (GL 3.2+/GLES
3.1+) This was previously not working probably since the correct texture
target was never used.

Change-Id: Ibe929faaf86824a596f9794240d1becc51f68e43
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 07d900dd57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-27 07:40:39 +00:00
Thiago Macieira
59a826e9a6 tst_QFile: remove the timer in unixPipe and socketPair
We were basically timing the qSleep, which is pointless. We don't need
to verify that qSleep(X) spends at least X time. Because it also
doesn't. Somehow, QNX can execute 1000 ms sleeps in 996 ms.

Amends commit 30e5ff3ff2.

Change-Id: I46b5dede27114be29724fffd176a66c1799075b7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7d0431bb8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-27 02:17:18 +00:00
Thiago Macieira
9529e3e13e QMetaContainer: add missing #include <iterator>
For std::iterator_traits, tags, std::advance, std::distance, etc.

Fixes: QTBUG-114583
Change-Id: I443cf0c8a76243eead33fffd1768e904ae823f75
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 003c29511d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-27 02:17:05 +00:00