Compare commits

...

1470 Commits
dev ... 6.7.2

Author SHA1 Message Date
Edward Welbourne
efbfb4e404 Remove test for America/Hermosillo transition at the epoch
A recent update [0] to the IANA timezone database has improved the
historical accuracy of transitions in Mexico. It turns out that the
transition at the start of 1970 was not a real event. The only actual
change then was that Mazatlan has followed the main Mexico zone rules
since then, having ignored some transitions of the main zone in
earlier decades.

[0] 812aff32b3

Fixes: QTQAINFRA-6757
Change-Id: I65d8ea1dfa76ce635bf11ffcc1ded8c9ceaf9fec
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 8a27c310b1e4ebc74999e09551ca5eab4570a68e)
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2025-05-14 07:28:35 +03:00
Mårten Nordheim
b6cd629905 QFileSystemEngine/Win: Use GetTempPath2 when available
Because the documentation for GetTempPath nows says apps should call
GetTempPath2.[0]

Starting with Windows 11[1], and recently Windows 10[2],
GetTempPath2 was added. The difference being that elevated
processes are returned a different directory. Usually
'C:\Windows\SystemTemp'.

Currently temporary files of an elevated process may be placed in a
world write-able location. GetTempPath2, by default, but can be
overridden, places it in a directory that's only accessible by SYSTEM
and administrators.

[0] https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettemppathw#remarks
[1] https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettemppath2w
(Minimum supported client - Windows 11 Build 22000)
[2] https://blogs.windows.com/windows-insider/2025/03/13/releasing-windows-10-build-19045-5674-to-the-release-preview-channel/
(This update enables system processes to store temporary files ...)

[ChangeLog][QtCore][Important Behavior Changes] On
Windows, generating temporary directories for processes with elevated
privileges may now return a different path with a stricter
set of permissions. Please consult Microsoft's documentation from when
they made the same change for the .NET framework:
https://support.microsoft.com/en-us/topic/gettemppath-changes-in-windows-february-cumulative-update-preview-4cc631fb-9d97-4118-ab6d-f643cd0a7259

Change-Id: I5caf11151fb2f711bbc5599231f140598b3c9d03
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 69633bcb58e681bac5bff3744e5a2352788dc36c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6a684a53b371ec483b27bf243af24819be63f85f)
(cherry picked from commit bbeccc0c22e520f46f0b33e281fa5ac85ac9c727)
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2025-05-14 04:28:29 +00:00
Volker Hilsheimer
6ffbf10db5 QCompleter: add more nullptr checks for the widget
The widget might become nullptr, especially after delivering events to
it. So consistently test for nullptr before calling the event function.

Fixes: QTBUG-128478
Change-Id: Ieed4e8b68b41488fafd9946d718c1d77fad39a44
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 6b86d9d08b407a56bad2d37f65169e36356b0741)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 92005e34e8c20a89a27a4f8a7a0ad6bd46745b50)
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2025-05-14 07:28:25 +03:00
Mårten Nordheim
c7ba485b35 tst_qnetworkreply: localhost may resolve to ipv4 and 6
On some platforms, localhost resolves to both ipv4 and ipv6 addresses.
In that case we might get multiple emissions of the
socketStartedConnecting signal, for Happy Eyeballs.

Change-Id: Ib39a167bdde2089106c89a3e297cbb0ad2f357d9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 13a0f294b5ef2ec8a2057d72365f989ddf6290de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6e98673846b3a5e992f7220b4e0f1b4ecfb9cdaa)
(cherry picked from commit ff909d8b4cb1d423fd51412564d12b4e4d999794)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2025-05-14 07:28:21 +03:00
Axel Spoerl
5fb73f8dc9 Blacklist tst_QDnsLookup::lookupRoot() on macOS and Linux
Blocking CI; Blacklist until solved.

Task-number: QTQAINFRA-7130
Change-Id: Id420bfd9afcbe23555052ca9c3c8f3703b937bca
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4748d4303b7b49a9187a353df5d8e7a7fe9ec2dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b2b48ff26ea30f2c9ef99cbebd75ee04c8ddd9cd)
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-05-14 07:28:17 +03:00
Lorn Potter
b5fbe0923c Wasm: fix QtVirtualKeyboard crash
Do not try to access non the existent input element when there is no touchscreen,
as we do not use it in that instance.

Fixes: QTBUG-125120
Change-Id: Iedac1890d13b348ef12690947779347e3c2f8476
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 41cb01dc595c8de374ce58ae43afbb69db70c379)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit f01a0e9ed90cd970d5b089648424ab4af1aed594)
2024-06-07 14:44:04 +00:00
Tor Arne Vestbø
a428c69335 Return button index for deprecated QMessageBox APIs
The static QMessageBox APIs taking button texts instead of standard
buttons promises that the return value is 0, 1, or 2. After the change
in b30121041c07b1b8613eaf624c9aa55a51001aef the return value of exec
for custom buttons was changed (as the documentation says its an opaque
value), which unfortunately affected the deprecated functions.

To fix this, we use the index of the clicked button in the custom
button list, to restore the previous behavior of the deprecated
APIs.

Fixes: QTBUG-125858
Pick-to: dev 6.8 6.7
Change-Id: I96d39e42b64e2b55eab07e2f15df71b94cfe3e6d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2024-06-05 16:38:13 +00:00
Thiago Macieira
a5fdbd73a9 Entrypoint/Win32: just use __argc and __argv if available
We were splitting the Unicode command-line using CommandLineToArgvW(),
then converting to 8-bit for argv. That was practically always the same
as what the runtime had already stored in __argv. But not always: it
looks like the runtime splits the 8-bit command-line (GetCommandLineA())
and there are certain Unicode characters that WideCharToMultiByte()
converts to a quote ("), which causes the command-line splitter to
differ from what Qt is doing.

__argv may not always be populated, if the user requested a wmain()
somehow, because that causes __wargv to be populated. Therefore, we need
to keep the old code.

[ChangeLog][QtGui] Fixed a bug that caused Qt applications to disregard
Unicode command-lines on Windows even when argc and argv were passed un-
modified to QGuiApplication or QApplication. This happened only for
builds with Visual Studio and in the "windows" subsystem (not
"console").

Pick-to: 6.5
Fixes: QTBUG-125380
Change-Id: If05cb740b64f42eba21efffd17d007799f99d8bf
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 993b197d9c944060763fb46514c5c1d31abce205)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 34533705b27838d1507f1267cdf55ce6a399b225)
2024-06-05 01:41:28 +00:00
Tuomas Vaarala
9c1096f4f6 [QNX] Return Qt::Key_Clear when numpad key 5 is pressed without num lock
Based on the documentation, the numeric keypad key 5 is commonly mapped
to Qt::Key_Clear, when Num Lock is off. Previously the number 5 was
returned also when the Num Lock is off which caused an ui application
being unable to disable the numpad key number 5 when numlock is off.

Fixes: QTBUG-125958
Pick-to: 6.5
Change-Id: I62f7521376890a201cd11abf78847bcb0eb1752a
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
(cherry picked from commit cc89c4c76567184b2887952dfe44375ff3ebd28d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8f50ece5fa3a5fe6751681e0a6530e51037b6acb)
2024-06-04 13:56:52 +00:00
Oliver Wolff
6771f66fae tst_qprocess: Add crash helper for MSVC ARM64
The ud2 intrinsic isn't available for ARM64

Fixes: QTBUG-125436
Change-Id: I3f71252c570cf9795de7907fea68f46ffc81211a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1fd965cd2be5e73ab7ab8d1e9b44d77f32182744)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ea588a8a2b080417a1602d4832d9a03b94111c5a)
2024-06-04 13:56:52 +00:00
Marc Mutz
229ed81c72 QAnyStringView: fix char-ish ctors to not allocate memory
Extending the fromCharacter() tests to check for the construction to
be noexcept and implicit turned up a few bugs:

The constructor from char32_t was simply not marked as noexcept, even
though all its operations were. So just mark it noexcept.

The constructor from QChar, otoh, was never called, (certainly not for
rvalues), because QString happens to be constructible from QChar (and
QLatin1Char and QChar::SpecialCharactor), so due to perfect
forwarding, the if_convertible_to<QString> ctor won, allocating a
QString.

This is a regression of Qt 6.5 compared to Qt 6.4.

To fix this, exclude arguments that convert to QChar from matching the
if_convertible_to<QString/QByteArray> ctors, taking care to not match
those arguments that are already compatible_char<>s.

This, in turn, creates a problem for implicit QASV construction from
QLatin1Char and QChar::SpecialCharacter, because now that we've
excluded them from the if_convertible_to<QString> ctor, calling the
existing QChar or QString non-template constructors for these types
would require two user-defined conversions (from said type to
QChar/QString and from QChar/QString to QAnyStringView). That works
for explicit construction, but we need implicit convertability.

So bring out the big guns once more and add a perfectly-forwarding
ctor for anything convertible to QChar. QChar itself is actually
already handled by compatible_char<>, so the old QChar non-template
ctor can go. The extra copy of the QChar argument will be optimized
away by the compiler.

[ChangeLog][QtCore][QAnyStringView] Fixed a regression where
constructing a QAnyStringView from a char-like type (QChar,
QLatin1Char, ...) would first construct a QString and only then
convert that to QAnyStringView.

Amends 812a0d3125cb89e340c59aa92cdc946862fb009d.

This change is forward and backward BC and SC, but not
behavior-compatible: certain operations detectably change
noexcept'ness, and some arguments may now cause the resulting
QAnyStringView to have a different encoding (though I really tried
hard to avoid that).

Since it's a regression, I proposed to pick this to the affected
branches, 6.7 and 6.5 (6.6 is already closed at this point).

Pick-to: 6.5
Fixes: QTBUG-125735
Change-Id: I86f37df5d80bee36db27e529c017cb73995a6831
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 88b1c9623903d54bd64cc92aa2dd61ee4ff4389b)
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-06-04 15:56:52 +02:00
Eskil Abrahamsen Blomfeldt
cff1142732 Update to Harfbuzz 8.5.0
Pick-to: 6.5 6.2 5.15
Change-Id: Icfc5300598cf0ee58e3d791326b7f37b27a1c9c0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f09f70fcdfc1f1ba5829bc17829e8a4103921ac7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-04 11:24:00 +00:00
Ilya Fedin
5627844168 Check D-Bus tray availability every time
It could appear in runtime, this allows applications to watch for it
themselves and re-create QSystemTrayIcon as needed.

Task-number: QTBUG-94871
Pick-to: 6.5
Change-Id: I10678cca4238ec0212c69155c9f22c07755ab1a8
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 3c93dedc063bf453bcda581b4e9ccab5a810c80f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-01 20:10:13 +00:00
Thiago Macieira
cb38b5026a QStorageInfo/Linux: reuse the file descriptor
We need it for the ioctl() to get the label and we already have it open.

Change-Id: If3345151ddf84c43a4f1fffd17d3f7f1312ca185
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 24b1e52a1a46e9c7801a1bfffb963e56610872a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-01 14:24:21 +00:00
Thiago Macieira
55eae1b3bb QStorageInfo/Linux: use the mount ID to match paths to mountinfo lines
Linux kernel version 5.8 added support for the stx_mnt_id field in the
struct statx because "Systemd is hacking around to get it and it's
trivial to add to statx, so...". This allows us to much more neatly
match the lines in /proc/self/mountinfo.

The same kernel version added STATX_ATTR_MOUNT_ROOT so we can tell if a
given path is the mount point of a filesystem. We don't have a need for
that information for now.

We need to retain fallback code for two reasons: first, the user may be
running with an old Linux kernel, in which case we won't get the
STATX_MNT_ID bit set in stx_mask. Second, we may have failed to open()
the path in question, because the user may not have the necessary
permissions.

There's still a race condition because the mount IDs can be reused
immediately after something is unmounted. There's a 64-bit unique mount
ID (available since v6.8) but it's not reported in /proc/self/mountinfo,
so we couldn't us it right now. We can with 6.8's statmount().

Task-number: QTBUG-125721
Change-Id: If3345151ddf84c43a4f1fffd17d3f7dbce4ff16b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 8836b677786ec4c967a9adfe5fc7a1febcb1a12e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-01 14:24:15 +00:00
Thiago Macieira
98f3c36ed2 QStorageInfo/Linux: re-work the mountedVolumes() check for mounted-overs
Commit ddc39eb3a46d699c23d39f0e914978199eb98cc6 ("QStorageInfo/Linux:
fix mountedVolumes() for paths mounted over") added a clever check that
did stat() on the path to figure out if it was the device that we'd just
found on /proc/self/mountinfo. But if the same device was mounted on top
again, we may have got the wrong answer.

More importantly, since kernel 6.9, btrfs subvolume mounts no longer
report the subvolume's block ID in /proc/self/mountinfo, which would
lead us to conclude every single subvolume has been mounted-over.

So let's revert back to string-matching later lines to see if any is a
parent path.

https://lore.kernel.org/linux-btrfs/2548140.Uh0CODmnKu@tjmaciei-mobl5/T/

Fixes: QTBUG-125721
Change-Id: If3345151ddf84c43a4f1fffd17d3d59fef4446dd
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit ad968d3602eec2b1f34a9c80606e59c5a2c76a2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-01 14:24:08 +00:00
Ilya Fedin
c1daaf5217 Don't fallback to X11 tray backend on non-X11
This allows to have system tray support on the fly on Wayland at least
where only QDBusTrayIcon is possible and no need to fallback to
QSystemTrayIconSys

Fixes: QTBUG-114439
Task-number: QTBUG-94871
Pick-to: 6.5
Change-Id: Ic927cde585ef02f9b9ef03f3b6338f35072bef70
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit f6cd286e6609cfbfda50bc74e96e115f3f8ec0ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-01 10:29:19 +00:00
Giuseppe D'Angelo
1752308123 QDateTime::fromStdTimePoint: fix a call to fromMSecsSinceEpoch
The overload taking a Qt::TimeSpec is deprecated; we need to use
the one taking a QTimeZone instead. However I can't just use
QTimeZone because this is inline code in qdatetime.h, and QTimeZone
is only forward declared there. Moving the definition in qtimezone.h is
possible (like it's done for zoned_time), but that is a source break
(requires a new inclusion from users) and also weird (this function
doesn't deal with timezones, why do we need to include qtimezone.h?).

Instead, just add another overload of fromStdTimePoint that takes
precisely sys_time<milliseconds>. As such, it can be always available
even in C++17, and implemented out-of-line.

Even if this is a new symbol, the new commit policy allows the
backport. I also don't think this qualifies as a new feature;
it's a cleanup that we forgot to do (if we had a C++20-enabled
configuration in the CI when we also did the fromMSecsSinceEpoch
deprecation, we would've caught this).

Pick-to: 6.5
Change-Id: Ica77da291be4bcda2ffc7c164316a2977974c386
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit c4fc3a74b4525ad5d80e558707301a12e4d4cb19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-06-01 08:00:13 +00:00
Lars Schmertmann
8d6ed7acf1 Android: Fix missing EXTRA_SOURCE_INFO onResume
Amends 3b6d288e3bf7a778f3ea8ccf51f59780a6de0dcc.

Change-Id: Ib135d8e04b1a7b95dde5cc220472b922069df86e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 57595bd90a974f33ce4573afff0f145caabd4b32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-31 16:31:06 +00:00
Tor Arne Vestbø
2656666e71 QOpenGL2PaintEngineEx: Store context via QPointer
The QOpenGLBuffers used by QOpenGL2PaintEngineEx are tied to a specific
share group on creation, via QOpenGLSharedResourceGuard.

If QOpenGL2PaintEngineEx is later used with a recreated QOpenGLContext,
that happens to live at the same address as the previous one, we will
fail to detect that the context has changed by using a naked pointer
comparison (ABA problem).

If the share group of the new context is different, this will cause
problems down the line in QOpenGLBuffers::bind(). This scenario has
been observed on Android, where the context created in
QOpenGLWidgetPrivate::initialize() ends up with the same address,
but then adopts a new share context from RHI, because the widget has
been moved to a different top level window.

To remedy this, we store the QOpenGL2PaintEngineEx's cached context
via a QPointer, so that we pick up the B state of ABA (null), and
correctly throw away the old buffers in QOpenGL2PaintEngineEx::begin.

Change-Id: I5c221a37fd95f846d96e72509bba54f3d10fee3a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 8f6b27fdeef4f45d70c7bc93f7393f58f5ddeb16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-30 21:24:42 +00:00
Thiago Macieira
b927ef2ce7 tst_qfloat16: don't cause UB in converting from float to ints
The test data is provided as float, so we must obey [conv.fpint]/1 when
converting from float to integer types. There are values in the rows
that are outside of the range of short and shorter integers, so just
check the range.

Fixes: QTBUG-125889
Change-Id: If3345151ddf84c43a4f1fffd17d405ee0cd00d44
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3c9bb0daaf0cbff9135f88e55bae8243aa937faa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-30 21:24:41 +00:00
Alexei Cazacov
f036e6f1ad Docs: Update the obsolete requirements for Q_OBJECT and Q_GADGET
Since 6.5, you can declare the Q_OBJECT macro in any class section, not
only in private. The docs are updated accordingly. The Q_OBJECT macro
specifies a private section on its own, thus making private all the
members declared after the macro. This is an important behavior change,
so the note about it was rewritten for clarity & moved a little bit up.

Fixes: QTBUG-125776
Pick-to: 6.6 6.5
Change-Id: Ifba063af7cf7fe7258b6183da5a4599784171052
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit ce26eaf1b9300a788f7c3caa18dd8a5eec23da23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-30 18:59:22 +00:00
Viktor Arvidsson
364588cf82 QWindowsMime: Fix loading of CF_DIB (non-v5)
Drag-dropping and image from for example photoshop didn't work in Qt6
due to a (probably?) copy paste error in the commit
8fa91c75ad0cb0b1905c6775b62f734bc610fb60

Pick-to: 6.5
Change-Id: I18dedc09596fe590e915e3aa526131f2d6957d8b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 5b7422f74d73822aeab76163811ea1fcaafabc12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-30 18:59:22 +00:00
Alexey Edelev
565cd685ab Prefer using the non-suffixed libzstd over static one
Recent zstd versions provide the libstd target but not only libzstd_shared
or libzstd_static. Attempt to use it as the WrapZSTD::WrapZSTD counterpart
if the target exists.

Task-number: QTBUG-119469
Pick-to: 6.5
Change-Id: I47916bfa6f10883d099184a497800277c8026b14
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7d9d1220f367d9275dfaa7ce12e89b0a9f4c1978)
2024-05-30 14:40:21 +00:00
Alexey Edelev
0dd3e7008f Ensure that libzstd targets are promoted to global if they were found
Promote all internal zstd targets if they were found by WrapZSTD to
global using PROVIDED_TARGETS mechanism.

Amends 7d9d1220f367d9275dfaa7ce12e89b0a9f4c1978

Task-numer: QTBUG-119469
Pick-to: 6.5
Change-Id: I15ec484304f7bf2b3ee2a533d2badb3bb7797863
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3073b9c4dec5e5877363794bf81cbd4b84fdb9ee)
2024-05-30 14:40:13 +00:00
Nicholas Bennett
d0aeeed49d Docs: update the QAndroidApplication::context() documentation
The word "main" here is confusing. use "most recently started" instead.

Fixes: QTBUG-86203
Pick-to: 6.5 6.2
Change-Id: I3fd4e49204fac8a2f97cdfc57d5f7901fa7b96a6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 480940f0aa73922461a0ab51820b584a8e441e17)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-30 08:58:16 +00:00
Alexandru Croitor
11b0bd1bc7 CMake: Fix configs passed to qt_get_install_target_default_args
Because the configs passed to the ALL_CMAKE_CONFIGS option were quoted
cmake_parse_arguments(PARSE_ARGV) would escape the semicolon in
the set value, effectively doing
 set(arg_ALL_CMAKE_CONFIGS "Release\;Debug")

Then the
 list(GET arg_ALL_CMAKE_CONFIGS 0 first_config)
call would essentially do
 set(first_config "Release;Debug")
and the
 if(all_configs_count GREATER 1
    AND NOT arg_CMAKE_CONFIG STREQUAL first_config)
condition would never trigger because a single config string can never
equal a double config string.

Remove the quotes to ensure correct behavior.

This won't really trigger any behavior change, because we exclude
installation of Debug executables in -debug-and-release builds,
but it will make --trace-expand logs less confusing.

Amends f240d94f140ba1614828804efafd2fc5e6d00099

Change-Id: I53179511c7698c90b33cb3ff2762cef680a99815
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a1445670f5860398b475ad8ed87ba0629275499e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-29 21:01:59 +00:00
Wladimir Leuschner
495e5cbbb0 QWindows11Style: Increase min size of QAbstractSpinbox Widgets
With WinUI3 a new layout of the lineedit and buttons was introduced. The
buttons are now aligned horizontally instead of vertically. Trying to
mimic that layout in widgets results in too few space for the text in
the lineedit. This patch increases the minimum width when using the
QWindows11Style for QAbstractSpinBox elements and saves the original
width in a property in case the style is changed at runtime to restore
the original geometry.

Fixes: QTBUG-124235
Fixes: QTBUG-124150
Change-Id: I8067b338fa4a2c1efd0a1b0644fb8a563601385b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b457376c038acc0c1cb9a0966508b4999314ea86)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-29 18:12:55 +00:00
Marc Mutz
3750611d6d tst_QStringApiSymmetry: add tests for unary arg() calls
This exercise found an inconsistency involving char16_t. Filed
QTBUG-125588 to keep track of this and decide how to deal with it.

Task-number: QTBUG-125588
Pick-to: 6.5
Change-Id: I259fecef34539e8841149570d7411d959b48d876
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4bb36a6e78ad6e5ca67af402bc17695d11282b60)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-29 17:02:30 +00:00
Marc Mutz
7d16ea588b tst_QAnyStringView: add fromX for various char-like types
These were not covered by the existing tests.

Pick-to: 6.5 6.2
Change-Id: I909ea3aa5b676904dc72ecf8ce32b73cca1b6af7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 39189190fee872d2e6fcaca0f5c10d0ba6a70ea6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-29 17:02:27 +00:00
Lorn Potter
fd6f9e92d8 wasm: fix uri-list handling urls
We were only handling the case where uri-list was a file.
This fixes a regression.

Also - add dragging url into the clipboard manual test

Pick-to: 6.7.1
Change-Id: Ifbd087ffd157463b6b903199e3ff22c2de1c4942
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit d67d49f45ec84aba4047305825f36bbc02d3d26c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-28 22:18:17 +00:00
Giuseppe D'Angelo
a3e37975e1 PDF: fix the encoding for the file name of attachments
A file specification in PDF is a string (§3.10.1 of the PDF 1.6 spec).
As such, it needs to be properly encoded. Right now the code was
doing a naive conversion to latin1 (which was lossy), and was not
considering things like round parenthesis which need to be properly
escaped. Just use printString instead.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: Icdcf8b553955d31fe2bc430dea54bb6e68221fc7
Pick-to: 6.5
Reviewed-by: Albert Astals Cid <aacid@kde.org>
(cherry picked from commit 0effdc98dcaaf4fab118f9834f67b4d5d3107d7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-28 22:04:33 +00:00
Giuseppe D'Angelo
6197078fbd QDateTime::fromStdTimePoint: fix the constraint
The constraint requires the input time_point's duration to be
convertible to milliseconds. That's inaccurate: we need to check the
duration of the time_point we get from the clock_cast, not the input.
In general, clock_cast is allowed to return arbitrary durations, so
it may not match the input. (It indeed doesn't match for some
standard clocks, like gps_clock.)

Task-number: QTBUG-125587
Change-Id: I5a93317c8cdc0a3cef4acab17c656e2e5dac5d8d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e95812df85d98689d51bed92acce51e0e250f854)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-28 21:35:43 +00:00
Vlad Zahorodnii
7f219f23b4 xcb: Correctly report whether QInternalMimeData::retrieveData_sys() fails
QMimeData::retrieveData() checks whether the returned QVariant value is
valid, i.e. the variant contains some data. If the variant contains an
empty QByteArray, it will be considered valid.

So retrieveData_sys() should return QVariant() in case data with the
specified mime type cannot be retrieved.

Fixes: QTBUG-125531
Pick-to: 6.5 6.2 5.15
Change-Id: I0a668ca7ad5b2c5430335e8554cc597747287173
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 59b7e143a98c1a91587f8cc87e92c0bc0650f55d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-28 18:19:27 +00:00
Kai Köhne
2267382273 Doc: Hint about QtMsgType order
You could get the idea that the underlying int value is indicative
of the severity. Make it more explicit that the order in the text
is the correct one, and reorder for Qt 7.

While at it, remove mentioning of Qt 5.5.

Fixes: QTBUG-102347
Change-Id: I5d1b46afb37e50baa209a06c192a943980ca774b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 469367dc08654e02dae39162750fce7fa39d906d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-28 18:19:25 +00:00
Marc Mutz
86e180ec4b tst_QString: add more checks for unary arg() calls
Add missing checks for integral overloads uint, short and ushort and
character overloads char and char16_t (the latter being a reproducer
for QTBUG-125588).

Pick-to: 6.5 6.2
Task-number: QTBUG-125588
Change-Id: I479e4c8c3cd86c3f85ab3c9d44b79158b0a48476
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit a6d2e45d5765c0c05e408c6c74a05c9d70fe1bdb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-28 17:52:17 +00:00
Marc Mutz
a32e8d4263 QLatin1StringView: fix UB in "a"_L1 <> nullptr
Found by ubsan: if rhs is nullptr, then we fed a nullptr as the second
argument of memcmp(), which is UB.

Fix by catching an empty rhs before we reach that line.

Amends e52d50a03da29e2dddaee551e4409f28c7ed56f2 (which, despite
pick-to's to the contrary, never made it into 6.2 or 5.15).

Change b977ae371a753a82e1d0bb32c5b62099da663721 fixed this for
UTF-8/UTF-8 comparison from 6.5 on, but 6.4 ad 6.3 remain vulnerable
there, but they're closed, so can't be fixed anymore.

Pick-to: 6.5
Change-Id: I12fa986aa82a7440a9d53fad19a15e9420233e0b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 89f184b4034ce54b8a3439069e57b0f35798fec3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-28 17:07:54 +00:00
Axel Spoerl
4809d41e67 QDockWidget::setFloating() - reparent floating tab to main window
setFloating() called on the 2nd last dock widget in a floating tab
didn't cause reparenting to the main window. The dock widget remained
parented to a QDockWidgetGroupWindow, while no longer being part of
floating tabs. The QDockWidgetGroupWindow would therefore have only
one tab, which is an inconsistent state and causes crashes.

Factor out the implementation of setFloating() to a new
QDockWidgetPrivate::setFloating(). Reparent to the main window, if
the dock widget is part of floating tabs.

Add test functionality in tst_QDockWidget::setFloating().
Turn createFloatingTabs() into a macro, in order to QSKIP() in the test
function's scope.

Fixes: QTBUG-122394
Pick-to: 6.5
Change-Id: I3719785f310b131446cdea908f09b7195c992b3e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a910daf52678469b7e595da5fe54aa09ba2373c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-28 16:30:53 +00:00
Michał Łoś
875327e567 Skip tst_QProcessEnvironment::systemEnvironment on VxWorks
This tests assumes existence of `PATH` environment variable. This
variable is not a special variable on VxWorks (it's neither set nor
evaluated by command line), causing this test to fail.

Skip this test as it's not applicable on VxWorks.

Task-number: QTBUG-115777
Change-Id: I431b3f0a0ff9efefffc356bb5c7e11fdfac78690
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 480d9bb67dd7232a9cdd462d0bcdcc932c0b0f6b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-28 16:30:52 +00:00
Marc Mutz
34cf289a35 Replace QUuid::toRfc4122() with toBytes() where possible
They're content-equivalent, except that the latter doesn't have to
allocate a return value on the heap.

Change-Id: Ifcae47b487c80c2bac02900f08393b386cfe806c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit e0d87f70d87a63aa55a11ecb91f8d355767d61bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-28 14:40:14 +00:00
Toni Saario
79d24b191d Coin: sign only x86 packages
Coin is currently missing support for arm64 signing. Drop the signing
on arm64 for time being to allow packaging flag to be added to export
arm64 builds.

Change-Id: If684fa4d787fccb99ac9a0ebad56ec723faba354
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
(cherry picked from commit 8d5e7d50d8dbf1ad79bd8ff9f6ef6028eba481c9)
2024-05-28 09:40:56 +00:00
Christian Ehrlicher
bf4c9bbf80 SQLite: Update SQLite to v3.46.0
[ChangeLog][Third-Party Code] Updated SQLite to v3.46.0

Pick-to: 6.5 6.2 5.15
Change-Id: I9029055f8ba1b3a3156b039f830dcf900c77bfc9
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 8931f2c8365de9a8e36c6bbdf662f07c95684d4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-28 04:50:29 +00:00
Tor Arne Vestbø
075bf7a5d2 Emit QPrintDialog::accepted(QPrinter*) before QDialog::finished
As part of d8bbb5ee0e60d44a70d29306e607a59caf7fe5bc the order of
QDialog::accepted/rejected and QDialog::finished was changed so
that the latter came last. This has been the behavior now for
the entire Qt 6 series.

QPrintDialog didn't pick up on this new behavior, and was emitting
the QPrintDialog::accepted(QPrinter*) signal after calling the
dialog's done() method, which resulted in emitting finished before
the QPrintDialog printer-specific accepted signal. Clients such as
the textedit example, who would "clean up" in finished() would then
crash when processing the accepted signal.

We now emit QPrintDialog::accepted(QPrinter*) at the same time as
the dialog's accepted signal. The natural place to do this would be
the QPrintDialog constructor, but that's spread out and duplicated
between all the platform specific print dialog implementations, so
we do it via a single shot connect instead in QPrintDialog::done.

[ChangeLog[Print support] QPrintDialog::accepted(QPrinter*) is now
emitted before QDialog::finished, in line with QDialog::accepted.

Pick-to: 6.5
Change-Id: Idade32b667bdf7b81845025b8d83f08a551d32bb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 73a11c9d6a684e25cf4feca402ff3a1d7141af9d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-27 18:35:30 +00:00
Timothée Keller
316946089d Windows QPA: Prevent restoreGeometry from showing hidden windows
When we use GetWindowPlacement, the showCmd parameter will NOT be
SW_HIDE, even if the window is hidden. To prevent showing a hidden window
with SetWindowPlacement, change showCmd if the window is currently hidden.

Amends 21e411687428d05655b8db2634466384fa35cc03

Fixes: QTBUG-120415
Change-Id: Ib7de369a6d1a530fdeb5ff930097ae06e25761f3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Zhao Yuhang <yuhangzhao@deepin.org>
(cherry picked from commit 8a5fed6da41bcc29506d5b4e166a6e87e8fe9eb7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-27 18:35:30 +00:00
Ivan Solovev
e4f87f2045 Docs: fix include header for Qt::*_ordering types
As the classes do not use the common naming pattern, qdoc suggested
some weird non-existend includes when generating the docs for these
classes.
Explicitly use the \inheaderfile qdoc command to point to a proper
include.

Amends bdd41f491c0f85ae0897a1c7372c5ecda62a5aab.

Change-Id: Ia721658df38f1006fdc2fa1de1fab7eb381ceb0b
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 72b8c7d59c1b485383f4311310bc17ea2c8beb84)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-27 15:13:49 +00:00
Ivan Solovev
d3c060defa QDate: fix C++20 builds with MSVC
Commit c4f7dba81e43c11c1e71c19ef7f0b5acad119e60 reworked the C++20
QDate constructors and introduced a helper stdSysDaysToJulianDay()
method. However, the QT_POST_CXX17_API_IN_EXPORTED_CLASS was not used
on this new helper function.
As a result, an application which is built with C++20 but uses a
pre-built QtCore that is built with C++17 cannot call QDate constructors
with the new std::chorono types.

An obvious fix is to add the missing macro to the function.
However, we cannot do it directly, because the function is exported
in C++20 builds, and adding the macro will unexport it.

Use QT6_{DECL,CALL}_NEW_OVERLOAD_TAIL macros to add a new overload of
the stdSysDaysToJulianDay() function and mark it as
QT_POST_CXX17_API_IN_EXPORTED_CLASS.

Keep the old function under the QT_VERSION < Qt 7 check to keep BC.

Amends c4f7dba81e43c11c1e71c19ef7f0b5acad119e60.

Fixes: QTBUG-125610
Change-Id: I999354da51ee58c3691dbc1c0351be15a18a268b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 88702cc87cf830b145c8bff5174748e3719364f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-27 15:13:29 +00:00
Tim Blechmann
eb4e5b798d Widgets: silence clang's -Wimplicit-fallthrough
clang's fallthrough detection is a little stricter than gcc.

Change-Id: If1052275f035a8e8a496cc5a40a21137d18712e3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4656fabd8a6ff46f786cb48c220511ebe43ea300)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-27 10:51:31 +00:00
Thiago Macieira
76752235a0 QFileSystemEngine::canonicalName: don't use malloc()'ing realpath()
It is available in POSIX.1-2008 but is not worth it. The Linux man page
says it only works up to PATH_MAX anyway and the POSIX documentation
says it's UB if PATH_MAX isn't defined.

This cleans up the source code out of these messy #if and should be
faster, because we avoid a heap allocation (stack is always faster).

Instead, we only relegate the heap version to the case where PATH_MAX
isn't defined (i.e., GNU HURD), because in that case the realpath()
function can't be used with a stack allocation.

Change-Id: Ie30a3caf09ef4176bb36fffd17cde1ed5c5dad59
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit e32009fc0d48411b835d81b36993828277b5042e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-25 18:40:38 +00:00
Ilya Fedin
3e5034794d xcb: move QXcbXSettings initialization to QXcbVirtualDesktop constructor
This prevents e.g. gtk3 platformtheme from hanging.

Change-Id: I68593ad54fa5530366d590309c10621e5a48bd22
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 297cdf16d06023ad626d798e3529a3cd98af0050)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-25 14:09:37 +00:00
Tuomas Vaarala
14ea2a3662 [QNX] Use QRhiBackingstore for non-raster surface windows
Since the change to use compose render-to-texture widgets through QRhi,
the RasterGLSurface is not existing anymore and it was used in QNX QPA
to check the support for using backingstore with non-raster windows.
With the use of QRhiBackingstore the QNX QPA now supports
render-to-texture widgets for non-raster surface windows.

Fixes: QTBUG-114938
Task-number: QTBUG-114938
Pick-to: 6.5 6.6
Change-Id: I01d4a34efe4902a527051776b0460ccf22e5d232
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Marianne Yrjänä <marianne.yrjana@qt.io>
(cherry picked from commit c9ddc4b8e17fac10d2f25fe21c09bdd734513ac6)
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2024-05-24 05:38:01 +00:00
Volker Hilsheimer
80b41c615d QPalette: clarify documentation of resolve a bit
Explain where the colors come from for unset roles, and add a see-also
for isBrushSet.

Pick-to: 6.5
Change-Id: I35e58e6b0f3ff9e57d9df95879859dd10424dc92
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit f9cf13d23e8777aa88e8dd9bb631afed5f4f9acc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-23 23:23:52 +00:00
Tor Arne Vestbø
074c812cb0 QFrame: Disable implicit inclusion of safe area margins in contents rect
The QFrame::frameRect property is implemented in terms of the QWidget's
contentsMargins, and when the QFrame is resized it recalculates the new
frame rect by reading the contents rect and then setting the widget's
content margins based on the new value.

This conflicts with the implicit inclusion of safe area margins in the
widget's contents rect, as those implicit margins are then persisted as
user-set contents margins. If the safe area margins later change (to 0),
the frame will still reflect the old safe area margins.

We may find a way to untangle this for QFrame, but in the meantime let's
set Qt::WA_ContentsMarginsRespectsSafeArea to false. This avoids the
issue above, and also informs child widgets of the QFrame that they
themselves need to potentially take the safe area margins into account.

Disabling Qt::WA_ContentsMarginsRespectsSafeArea in this manner should
not cause any major behavior changes, as a QFrame is typically part of
a parent widget that does respect the contents margins, and so the frame
will not need to apply any margins of its own once the layout settles
down.

Task-number: QTBUG-125345
Change-Id: I936ff5ec9056d05676560cc7659ba31105fdc224
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 668914649c03d502935c79001baf95ac017ba061)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-23 20:22:45 +00:00
Tor Arne Vestbø
0f169ac80a rhi: Don't fall back to OpenGL backingstore if Metal is not available
We were reusing the QRhiMetalInitParams when falling back to OpenGL,
which caused crashes at runtime.

We remove the fallback altogether, as tests or clients that rely on
a specific RHI backingstore backend should do feature-testing before
requesting the specific backend.

Change-Id: Iee38348ae06ea118aafcada33a8956ae07bb2228
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit bc1f9837815b3a3058be6a51fd032ba10adf472e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-23 20:22:44 +00:00
Andreas Eliasson
16d95b95a0 Doc: Document function argument
The current docs describes the function name, when, in fact, it should
refer to the argument.

Fixes: QTBUG-123838
Change-Id: I36e3bdff66712b8f35ac19859acb65e6fdcdf355
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 71bc951870906abbe656d9c2f08c42c3bf35c554)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-23 12:14:05 +00:00
Nicholas Bennett
3b55a36f0a Docs: Correct Android ABI string in build documentation
Changed arm64-v8 to arm64-v8a.

Change-Id: I8ee5a5591bc22c28422643ab0d462b0638624d8c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit daf494c58541ede53d3c592cf5af9ce5a447bf08)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-23 09:40:12 +00:00
Lorn Potter
69180500af wasm: add autorepeat for QKeyEvent
We weren't handling it at all, emscripten already supports it.

Fixes: QTBUG-125222
Change-Id: I761eed2c8c034604cd02ba436db68cec4fdeb784
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit aae5c89d5f49136a83e25f1ade00ca5d84b55d5f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-23 05:35:25 +00:00
Marc Mutz
ef5cba01f8 QString: replace homebrew toString() with the Real Deal™
QLatin1StringView has had a toString() since Qt 6.0. Remove the
wrapper.

Pick-to: 6.5
Task-number: QTBUG-124365
Change-Id: I91e1cc9a2be2d01f309d681b5abcaf417fa584da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 23dfacb17d0925d376ea548613ee04c75a4503cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-22 23:37:24 +00:00
Marc Mutz
78974f8219 tst_QStringView: (re)fix GCC ubsan build
Move the constexpr fromArray() check from fromArray() to constExpr()
and there add the protection necessary to work around
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962, copied from
tst_QByteArrayView.

As a drive-by, add the test for constexpr construction from a char16_t
array, which was missing here (probably because of the GCC bug) while
the corresponding test was already in tst_QByteArrayView.

Amends 107ff4c1d6b5da2cb11c65b2bd9106817f7fdb02(!).
(iow: 6.0, and no, I don't know why it became a problem only now)

Pick-to: 6.5 6.2
Change-Id: Id9d2a08175709f8bf85b3b192e7aa49783b9e715
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3f3be9d7745dc6a6b16efdd940ccd12f6622c467)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-22 23:37:17 +00:00
Marc Mutz
1b076b3027 tst_QByteArrayView: (re)fix GCC ubsan build
Move the constexpr fromArray() check from fromArray() to constExpr()
where there is already the protection necessary to work around
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962.

Amends bbe7570ddcc6fcce707a355b76d2d0024c44ea38(!).
(iow: 6.0, and no, I don't know why it became a problem only now)

Pick-to: 6.5 6.2
Change-Id: Id9d2a08175709f8bf85b3b192e7aa49783b9e714
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6d28744e43c113b0f94b2132d5904d85a18d81a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-22 23:37:11 +00:00
Marc Mutz
b4df307723 tst_QByteArrayView: expose constExpr() test to non-ubsan GCC builds
Because of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962, and
because marking constExpr() as __attribute__((no_sanitize_undefined))
doesn't fix a thing, we opted to disable the triggering parts of
constExpr() from all GCC builds.

This is, of course, unfortunate, since it meaningfully reduces
compile-time coverage in the general case for a rather obscure build
type most won't ever use.

While GCC doesn't give us a predefined macro to check for in the .cpp
file, the cmake build system knows whether we use ubsan, so just
define a macro of our own.

As a drive-by, simplify GCC detection by using Q_CC_GCC_ONLY.

Amends de6a004bc5a5b9cd3ecfbb14818bb42fb1ecfd68.

Pick-to: 6.5 6.2
Task-number: QTBUG-101307
Change-Id: I4be5bd103b9d2386b2ac9fd22e0c34f9c63fee04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 564be117fece258f661a20e5c81166fa658f5e84)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-22 23:37:05 +00:00
Alexandru Croitor
7431811c2a CMake: Fix DEBUG_POSTFIX to apply to macOS multi-config builds
There was refactoring in 8c41125118768ce037698e0605755128b2da705d to
handle custom postfixes, which caused a regression in the postfix not
being set for macOS frameworks.

Specifically we set CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_DEBUG to
the value of ${${postfix_var}} but that variable was empty, because we
only set it in the PARENT_SCOPE.

Set the variable also in the current scope.

Amends 8c41125118768ce037698e0605755128b2da705d

Pick-to: 6.5
Change-Id: Iae3f1050bb11805b4cce01ec491a13a3d6c0a9fc
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 6328aaadf9683089aaa3904ea1cec56012d6212e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-22 16:18:36 +00:00
Marc Mutz
d87f93d1b7 tst_QSpan: fix a typo
We've already tested fixed-size-0 spans for default-constructibility
two lines before. We need to check dynamically-sized spans here.

This doesn't extend test coverage: in the course of the function we've
already default-constructed the correct type.

Amends f82cf6333e4e21c96d8b6bb272392f8142ead2b7.

Change-Id: Ibb192b1661f12babb449752bf107eca404a95ad2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6ea123ca4cdc7e33f6c21d29398823fe8afaea63)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-22 16:18:27 +00:00
Marc Mutz
b0214c1b07 tst_QStringApiSymmetry: add overload check for (weak)QString/QBAV
Overload set to be used in QUuid soon.

Pick-to: 6.5
Change-Id: I6f2c180bb7bb884d40f1691409e816405c3e5d47
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit ede58f3670a95243fa800b445b3edfba7534ac39)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-22 16:18:25 +00:00
Marc Mutz
af91a1b778 QMessageAuthenticationCodePrivate: mark ctor explicit and noexcept
Both members, QCryptographicHashPrivate and QSmallByteArray, are
nothrow-constructible.

Change-Id: I59fa93db15906002f230eb12b8639a595ef559cf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b8b84b9d917635b6b5e4632a152cd51a23894617)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-22 16:18:24 +00:00
Marc Mutz
6afec142a0 tst_http2: fix -Wunused-parameter warning
Amends 4f9387f2aee19e38f05cab76a71f0d067b8d80dd.

Pick-to: 6.5
Change-Id: I3e58967e05afad9f1a0dd581c3795e4f4c8c8de5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 658939dae2030ca5090d9161c4300e81827e656c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-22 13:48:00 +00:00
Axel Spoerl
1c2bd7809d QKdeTheme: update color scheme with unknown desktop theme
When a KDE theme name doesn't contain the keywords "dark" or "light",
QKdeThemePrivate::updateColorScheme() falls back to heuristics. It
compares text and base color. It sets the color scheme to dark, if
text is lighter than base and otherwise to light.

When the theme name can't be read from KDE settings, because it is
stored on a different location or not yet set, the heuristics fallback
doesn't happen. The color scheme always becomes "Unknown".

Remove this limitation to the benefit of currently unsupported Linuxes.

Fixes: QTBUG-125285
Change-Id: I120dd23eee71b14ea8ce3735c3f53bda2caa403e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 71d0de98359decfcc9be01a0ed5823a9595ef5d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-22 09:04:44 +00:00
Axel Spoerl
56c37e7ddc QKdeThemePrivate: refactor reading of KDE settings
KDE settings locations and keys were hardcoded in QKdeThemePrivate.
readKdeSetting() was implemented as a static method, because it was
called from the static readKdeSystemPalette().
It expects a QStringList argument with the KDE settings directories,
an int representing the KDE version, as well as a QHash with settings
passed as a reference.

Class members exist for settings directories and version. They have to
be passed for each call. The hash containing settings objects will be
created on the stack of each function making calles to
readKdeSetting(). The settings key, including subsections, was passed
as a QString.

Implement enumerations for all KDE setting types and settings.
Derive subsection from the settings type.
Change the signature of readKdeSetting() from a string to the new
enumeration.
Implement a non static override of readKdeSetting, to avoid passing
data memebers on each call.
Implement a mutable has for KDE settings, to enable caching across
functions in the future.

This patch does not change any behavior.

Task-number: QTBUG-125285
Change-Id: Ic0320853e08e82dd83bdba1e7765a1e5c6ffb384
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit b0b34c56a99130bfc9c82cb006653ce6b8f0516e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-22 09:04:43 +00:00
Volker Hilsheimer
4b1b46ee77 Fix build with -no-feature-mdiarea
Amends 96fcb4ef84bb7486221f04e53be8ee7218385178.

Fixes: QTBUG-125506
Change-Id: I8d7b4396623f4420f6901c44146a0cfd2cda4e5c
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 08f6a9a522b085c53934648ea634530518305252)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-22 09:04:29 +00:00
Axel Spoerl
4d4aa3078f Fix documentation of QKdeThemePrivate::updateColorScheme()
The method's documentation mentions appearance, instead of color scheme.
Update it.

Task-number: QTBUG-125285
Pick-to: 6.5
Change-Id: Iceb2b7d0a51d0ba34f98dd942d7988feb685a4f6
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 802cd973f2e90f4fa947a8ae19158568e7e265b1)
2024-05-22 05:00:56 +00:00
Christian Ehrlicher
82b3f3fbaf QCommonStyle: fix drawing artifacts for some standard icons
Some standard button icons do not have the correct quadratic extent
which leads to rendering artifacts. Even though the real fix might be to
actually let QIcon::actualSize() return the correct pixmap size instead
the size given by the construction of the QIcon via QIcon::addFile()
this fix does not hurt anyone.

Pick-to: 6.5
Fixes: QTBUG-73655
Change-Id: I43edb38b0146e7d0a698f7a6239da5dbfbc65aa4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e771e5e2d7ae77f46d01f087242e0f777fdc02ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-22 05:00:56 +00:00
Thiago Macieira
843b0b819b QVariant: do reset is_null after setValue()
Issue introduced by a68e4f3b96a82a93898f381e8ddc7f50f9c89d40 ("Use the
new QMetaType API in QVariant") in 6.0, which removed the d.is_null
reset at the same time as it replaced the std::destroy_at /
std::construct_at pair with an assignment operation.

[ChangeLog][QtCore][QVariant] Fixed a bug that would allow the class to
keep returning isNull() = true even after calling setValue().

Fixes: QTBUG-125472
Pick-to: 6.5
Change-Id: If05cb740b64f42eba21efffd17d13f6b1e8113c2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 26a81bd4fb1f382b2b1652566652301cfe1270a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-21 23:25:13 +00:00
Assam Boudjelthia
f9ce500915 Android: remove \c format from manifest table row titles
to keep the same format because \c is only used with two
tags which is unconsistent.

Change-Id: Ie49f6c22a0f0813d49ea69865a80133ad81011c5
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit 067f60f7927fa825b71eed9d94bc280dd70ccc5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-21 21:22:03 +00:00
Wladimir Leuschner
bec8a58da1 QWindows11Style: Initialize colorSchemeIndex/highContrastTheme in ctor
When creating a QWindows11Style with QStyleFactory::create() the current
colorSchemeIndex and highContrastTheme usage is not set. Those values
are now queried and set also in the Constructor of QWindows11Style.

Fixes: QTBUG-124524
Change-Id: I42a3aa5bafb0ff4193b8644ac1895a78b8c82120
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b7874f1fabb6cd89962ebbb8ed09a00e1c1ad1ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-21 20:26:07 +00:00
Christian Ehrlicher
be509449b6 QIcon: Adjust documentation of QIcon::pixmap()
The documentation of QIcon::pixmap() taking a devicePixelRatio could be
read in the way that a QPixmap of the requested size and
devicePixelRatio is generated which is not true. The generation part is
only valid for the given mode and state.

Pick-to: 6.5
Change-Id: I5374cd7be17c32cd87d7b35552e60a4c07ebe6b2
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 2422f8b18dd325e5ac7d0adff39b2c93a8f75466)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-21 19:47:17 +00:00
Eirik Aavitsland
77d44dca3e Fix qt_attribution file for libjpeg
In the version update to 3.0.3, the LicenseId and LicenseFiles items
were updated, but not the License item.

Pick-to: 6.5 6.2 5.15
Change-Id: I21870c78a247740ea8d67487a18511169607daba
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit a3e3e105ab10607cef4589f5c6d4c5770b44b9cf)
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-05-21 09:33:00 +00:00
Alexey Edelev
d95c3cd99a Consider the versioned Qt6::Gui when target when adding the plugin dependencies
QtGui module can be linked using both versioned and non versioned
targets. Consider this when adding the dependencies to the
qpa_default_plugins targets.

Change-Id: Iccbf3009ab8a4f9df4de1677f1b41445814c8c9e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1e8a36e360d7e86b86db7ba7a7cc258f65348929)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-20 16:43:29 +00:00
Marc Mutz
13fb621396 [docs] QSpan: enable 2nd subspan() overload docs
They didn't work due to qdoc bug QTBUG-118080, which has since been
marked as fixed (for 6.7FF).

Remove the protection.

Task-number: QTBUG-115022
Task-number: QTBUG-118080
Change-Id: I1b792676754074dd85611e647d4e2c372de3a647
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 725455ed3330b098effa7bfb7aa4a43f16be2a0d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-20 16:41:51 +00:00
Marc Mutz
951003d3d5 QCryptographicHash: add specific test for static hash() function
The test already exercised the function here and there, but it lacked
a central place to test the static hash() method, so add one.

Pick-to: 6.5
Change-Id: I229bc8a8ed07e0036f60de62ecc4d11ef88dd20e
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8586f9e1b9fa553b7fe450bbb45ef2cfbd3dd404)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-20 16:41:41 +00:00
Marc Mutz
89737a2221 tst_QCryptographicHash: mask a QSKIP in addDataAcceptsNullByteArrayView()
We know NumAlgorithms is not supported, so don't print a skipped
warning, by not including that enumerator in the test data in the
first place.

Amends 96dc4acb235f13a72bef7c719d005846fe1d9726.

Change-Id: Ie19f7ebcceb855b9363017c8b2626dae99e23313
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 00099c057cb584713cb9327738393e1748fc14f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-20 16:41:30 +00:00
Marc Mutz
077ffcebc7 tst_QSpan: fix GCC 11 -Wmaybe-uninitialized
GCC 11 doesn't understand that 'i' isn't ever read from (because all
spans created over it have size zero), but initialize it nonetheless
to suppress the warning.

Amends f82cf6333e4e21c96d8b6bb272392f8142ead2b7.

Change-Id: Ibfb3e9b7fdcbe93c43b7873986c74b4b5a0c9e54
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 6736fe3a0f33d2c37927a79203999acb8ef7b343)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-20 16:40:11 +00:00
André Klitzing
e1767a63cb Bump androix dependency to 1.13.1
This avoids linter warning like in
5dc9692e48ea15ab3da4283997547a2849f1944e:
       Obsolete Gradle Dependency

Brings back the commit 3bae65e7d61f85d2942c89e46e913c1056ba2daa
that was reverted earlier.

Task-number: QTBUG-106907
Change-Id: Ia1e3362853b5d43299acf21d5f3ac099a478b396
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit 0beaa63d4adf6a30c9f48919c1d9f4908de738b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-17 01:36:04 +00:00
Christian Ehrlicher
623e9b1fb4 Tests/QWidget: fix hoverPosition test for openSUSE
On some xcb platforms the xcb_configure_notify_event_t is sent after the
window is fully exposed which leads to a wrong position for
QWidget::mapToGlobal(). In this case this results in a wrong position
for QCursor::setPos() which lets the test fail.
Fix it by waiting for a move event with a position != 0,0 before calling
mapToParent/Global().

Pick-to: 6.5 6.2
Fixes: QTBUG-123998
Change-Id: Ic5e989c4497ccf3ed720a521f9d7e73632b4b1fc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f6fdd91941de1cefb021b837ece77fec7363f23c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-16 22:49:09 +00:00
Michał Łoś
813d8d5588 Exclude VxWorks from qstorageinfo tests
VxWorks doesn't have implementation of QStorageInfo and uses stub.
Remove tests of it from building and running, since these can't work.

Task-number: QTBUG-115777
Change-Id: Idd63d20c2dda1ae09838a7d371ae5b713180cb96
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 062c538781be594821ae8b3c09eb3ae4f5adc6f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-16 21:26:40 +00:00
Michał Łoś
5c3cfd2eeb Limit size of large files test for VxWorks
VxWorks doesn't allow mapping file beyond EOF, adjust tests to encompass
that.

Additionally, for testing on VxWorks we use use builtin /tmp which is a
RAM disk (in case of VxWorks-supported imx.6 bord which have 1GB of
RAM), set max size of tested large file to 256MB, 28 bits.

Task-number: QTBUG-115777
Change-Id: I73cbe112331b7cb95d80bb44b792578a1eb88a07
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7678edebba7e93ce648714cd6849023e2880813f)
2024-05-16 20:59:13 +02:00
Tor Arne Vestbø
107f76f29a Windows: Destroy display change window before unregistering window class
The QWindowsScreenManager's m_displayChangeObserver window would still
be alive at the time ~QWindowsContext would unregister window classes,
resulting in a warning that was hidden by the default verbosity of
QWindowsContext::verbose. The result was that we would get a warning
when then trying to re-register the already registered window class.

We now do what we do for m_powerNotification and m_powerDummyWindow,
which is to destroy them explicitly before unregistering their class.

Fixes: QTBUG-125058
Pick-to: 6.5
Change-Id: Id3b02237fdd81f734a58a2314a157cad1289a82c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 48cc43a1e00e564438227dc0c251c988cee22483)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-16 16:25:44 +00:00
Assam Boudjelthia
f6b4a48498 JNI: fix docs snippet typo in QJniObject
Task-number: QTBUG-125287
Change-Id: Ie0f2f26400d2e055d1de7a2307c9905d12891828
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 8473b9ad1997fa61882f540ad87bd4b4a671f926)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-16 13:54:50 +00:00
Tomasz Kozłowski
2c6a26efc6 Exclude sync() usage from VxWorks platform
This function is not available in VxWorks libraries and it is not
mandatory for proper qstorageinfo test execution.

Task-number: QTBUG-115777
Change-Id: Ic503c776002087d461c32f890795c27be4b1ca34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c0c66a42ced590cadfb55efc82f80af5f035020e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-16 13:54:50 +00:00
Łukasz Matysiak
4be9c76f1c Make tst_QFileInfo::setFileTimes more robust
There are some systems that do not support millisecond resolution in
timestamps.

An example of such system is VxWorks.

POSIX2008 demands that `stat` contains an `st_mtim` field of type `timespec`.
That field holds modification time with a nanosecond resolution.

VxWorks reports _POSIX_VERSION as 200112.
The `stat` struct does not contain `st_mtim`, but rather an `st_mtime` which
holds a `time_t` which contains seconds.
This leads to setFileTimes failing, because the test tries to
save the current datetime as the modification time of a file, but the ms
part is cut off.

Fix the problem by checking if the timestamp read back from the
filesystem contains milliseconds and only check it if it's not zero.

Task-number: QTBUG-115777
Change-Id: I8c8a3b1c8e97955f13f059bcebf66d1b5af174fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 88cb405514270a320d2993e8fb1c7b7b62646112)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-16 13:54:50 +00:00
Kai Uwe Broulik
44565ed793 Mark QGuiApplication::platformName property as CONSTANT
It cannot change at run-time once the platform
has been initialized.

Change-Id: Ib5ec049d799cbc54f184ebc8a6531f22c02b6b5b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit c587eeef11a00866347e44ec4e701c7775558a07)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-16 10:42:53 +00:00
Marc Mutz
72bf7a7679 moc: port to RAII handling of fopen()ed FILE*s
Similar to what we did for androiddeployqt, port moc's output file
handling from raw FILE* to unique_ptr<FILE> with an fclose() "deleter".

Introduce a openFileForWrite() helper function to abstract away the
difference between Unixoid and Windows FILE handling.

Keep the actual type of the unique_ptr instantiation local to
openFileForWrite() function so that creation and destruction are
defined close together, notwithstanding the occasional need to spell
out the type of the return value in callers.

NB: The moc copy in qtscxml does not contain this code.

Pick-to: 6.5
Change-Id: I0c9bca0bf3e29c137c02cc563098c5f2e2708cf3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 785a5e6eb4745dc3219cc33dc5ea2e671a40b5f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-15 21:03:20 +00:00
Kirikaze Chiyuki
f05cf3f11f Fix separator in QLocale::uiLanguages()
Since commit 91e70f23 introduced separator to uiLanguages(), the system
locale id still does not respect the separator parameter and hardcodes
dash as separator. Fixing this should make the format consistent.

Change-Id: I1ab8edfa49117bdc9c4353228e73c2d1e5becffc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Moody Liu <mooodyhunter@outlook.com>
(cherry picked from commit 4431ffa8b90f4d089f98544e8c2eeac6cfc7abb2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-15 21:03:20 +00:00
Marc Mutz
e85a0951dd QDesktopServices: clean up pre-Qt-6.6 code
Remove the code that was already commented out by
37a25fce94976ab2a0f94abe43f1ed6ad950672f for Qt versions ≥ 6.6.

Change-Id: I40a3e974430add17b52307781d092bd4f58c0c35
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit bf96c45f94d840f15c71e0630f9f9c3f8ef8bc6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-15 17:33:36 +00:00
Allan Sandfeld Jensen
a85c3939df Make minimal tag size more accepting
Accept tags between 8 and 12 bytes long, and move the check for 12
bytes to where it is needed.

Pick-to: 6.5
Fixes: QTBUG-125241
Change-Id: I1a46852a9ab60e7c63f8d74de1809d731912ab5b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit f5cafb6f1ceeb907cc99baccf97d2da6299e5809)
2024-05-15 19:33:36 +02:00
Edward Welbourne
c4b2d2389e Cope with CLDR's "day period" format specifiers
The LDML spec includes a 'b' pattern character which is like the 'a'
pattern, for AM and PM, but would rather use noon and midnight
indicators for those specific times. We don't support those and using
am/pm will be right enough of the time to be better than simply
discarding this option, if it ever gets used (which it currently
isn't), so treat as an alias for 'a'. No locale in CLDR currently uses
this.

CLDR also has a 'B' specifiers for "flexible day periods", including
things like "at night" and "in the day". At present only zh_Hant uses
'B'. As a result, this change only affects zh_Hant's formats for time
and datetime, which only zh_Hant_TW uses - zh_Hant_HK overrides them
to use am/pm markers and zh_Hant_MO inherits that from
zh_Hant_HK. Based on this and user feed-back, I've opted to treat 'B'
as another synonym of 'a'.

This removes an entry from the time_format_data[] table (it happened
to occupy one whole twelve-character row), causing many other locales'
offsets into that table to be shifted by 12. Only zh_Hant_TW has an
actual change to which entry in the table it uses.
Added a test-case.

[ChangeLog][QtCore][QLocale] CLDR's 'B' (flexible day period, e.g. "at
night" &c.) field, not currently supported, is now handled as a
synonym for the AM/PM field 'a', instead of leaving the B as literal
text. Only affects zh_TW at present.

Fixes: QTBUG-123872
Change-Id: I6ba008c0a048190bf7af8c7df7629a885b05804f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d778d17b9f023e115dfbaa4bbd7255b52f41e67f)
2024-05-15 16:23:13 +02:00
Edward Welbourne
1119a3775b Rewrite CLDR-ingestion's date-time format conversion
Rework the somewhat ad-hoc handling of format blocks. Instead of
converting one character at a time, then coming back to map contiguous
chunks of various lengths to Qt's best match, use the first
non-separator character to select a function that looks ahead to see
what to consume with it. Quoted text can be handled the same way, with
a look-ahead. This potentially allows for more flexible parsing in
future.

In the process, matching qlocale_mac.mm, treat all unquoted letters as
reserved. The LDML spec says:

  Currently, A..Z and a..z are reserved for use as pattern characters
  (unless they are quoted, see next item).

and its description of literal text explcitly says these reserved
characters are not to be understood as literals. Document the letters
we do know about as unsupported pattern characters, but don't do
anything specific to handle them. This transiently changes zh_TW's
"Bh" hour fields to plain "h" but an imminent commit will change that
again and there is no other change to data, so the locale data is not
regenerated in this commit, to save churn.

This makes the parsing front-end function more straightforward and
makes it easier to document the quirks of the different format letters
and the impedance mismatches between CLDR's and Qt's. In the process,
recognize C, like j and J, as special magic to ignore and harmonize
with what qlocale_mac.cpp's macToQtFormat() does, where it's right and
dateconverter.py differed. Document the need to stay in sync with this
last.

Task-number: QTBUG-123872
Change-Id: I490d395b37751c9b8d6f3ee5ed4edbc0d405db5b
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit ea806fa3f15061d75d2c2c40144588053e2217b0)
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-05-15 16:23:08 +02:00
Edward Welbourne
e78b7e7010 Tidy up macToQtFormat() in Darwin system locale backend
Impose standard Qt indent.
Within each set of cases grouped together, impose alphabetic order.
Made formatting of ranges in comments terser, for two-value ranges.
Fix errors:
* the 'j' field should not arise and has a 'J' partner
* The 'c', 'e' and 'E' forms' numeric variants are still day of the
  week, so should not be mapped to 'd' or 'dd', which are day of the
  month. Qt date formats only actually support long and short, not
  narrow, despite the QLocale::Format having a NarrowFormat.

Other errors and infelicities shall be addressed in later work, in
tandem with changes to dateconverter.py that are coming.

Task-number: QTBUG-123872
Change-Id: I61bf363d2598502f8bfc0d67245eae1b41858147
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e04f7d0d2779a7ee47f7cea2d3b6f6f93fd286c8)
2024-05-15 16:23:03 +02:00
Eirik Aavitsland
febed4c265 Update bundled libjpeg-turbo to version 3.0.3
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 3.0.3

Pick-to: 6.5 6.2 5.15
Change-Id: I1f7184959d84bc3b486f495d782755fd6f9cbaa4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit c9a1e8d306d588c161461f8b22b76b701d10bce0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-15 12:32:07 +00:00
Assam Boudjelthia
d32f7dc016 Android: account for namespace in build.gradle instead of manifest
AGP version 7.4 deprecated the use of "package" attribute in the
manifest to specify the unique package name, it's instead been
moved to build.gradle file and set using "namespace" property.
This patch adds support of that to androiddeployqt.

Removing the "package" attribute from the default manifest would
break Qt Creator 13 and below because Qt Creator would fail to
deploy apps without such attribute in the manifest. For that reason
we'll defer removing it until a later version, for example Qt 6.10,
to allow some buffer for a Qt Creator that can handle that to be
adopted by users to reduce breakage.

[ChangeLog][Android] Add support for namespace in build.gradle instead
of the package attribute in the manifest.

Task-number: QTBUG-106907
Change-Id: Ib0f0d6a6fbb3b38f605aadfdcc497067daf90297
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit b740cd1f38e8fa08e61cee1d7a19badaff2dd282)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-15 11:54:02 +00:00
Marc Mutz
f7847ccd22 QDir: replace a QScopedArrayPointer with a QVLA
QDirSortItem contains three implicitly-shared members (two QStrings
and one QFileInfo), so the mere default-initialization of the
QDirSortItem[n] array with which we initialize the QScopedArrayPointer
will take quite some time.

Using QVarLengthArray, OTOH, delays construction until we have the
data to initialize the sort items, saving n default constructor and n
move assignment operator calls, plus the memory allocation for the
case where we have less than 65 elements to sort.

This code precedes the start of the public history, but the
emplacement won't work before 905bc6293354a0d3ee832b6dd3f632a647f809f3
introduced the QDirSortItem ctor, so not picking back further than
that.

Change-Id: I262217eabaded2a6aef08b87fc6369812bc8958a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 81a0753299fb8cc3e6b4b5e41a0292024ccea9e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-15 11:54:02 +00:00
Marc Mutz
61a593a469 androiddeplyqt: port to RAII handling of popen()ed FILE*s
Coverity found several FILE* leaks (since fixed) in the code, so make
sure that those can't happen anymore, by using unique_ptr to manage
the pclose() of the openProcess() FILE handles.

Keep the actual type of the unique_ptr instantiation local to
openProcess() so that creation and destruction are defined close
together, notwithstanding the occasional explicit pclose() calls to
capture the error code.

As a drive-by, port a naked popen() to openProcess(), make some
variables const and replace 0 with nullptr.

Pick-to: 6.5
Coverity-Id: 378357
Coverity-Id: 378442
Change-Id: I2b06b99cba1e4eb5b8963a9c5d2cb398eb25a8b3
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 0a48730d0821cf0d2f8ad25934d2498293c3648b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-15 08:45:03 +00:00
Michał Łoś
6b2103960c Add compilation test instead of VxWorks check
`<future>` is explicitly excluded for VxWork, because enabling it causes
compilation error when building tests (and causes some serious issues
when trying to naively work-arond this compilation problem). When
forcing `QT_FEATURE_cxx11_future` on VxWorks, failure occurs:

```
qtbase/src/corelib/thread/qthread.h:125:19: error: no matching function for call to 'invoke'
  125 |             (void)std::invoke(std::move(f), std::forward<decltype(largs)>(largs)...);
      |                   ^~~~~~~~~~~

[...]
qtbase/tests/auto/corelib/thread/qpromise/snippet_qpromise.cpp:32:45: note: in instantiation of function template specialization 'QThread::create<(lambda at qtbase/tests/auto/corelib/thread/qpromise/snippet_qpromise.cpp:32:52), QPromise<int>>' requested here
   32 |     QScopedPointer<QThread> thread(QThread::create([] (QPromise<int> promise) {
      |                                             ^
VSB/usr/h/public/type_traits:2720:7: note: candidate template ignored: substitution failure [with _Callable = remove_reference_t<(lambda at qtbase/tests/auto/corelib/thread/qpromise/snippet_qpromise.cpp:32:52) &>, _Types = <QPromise<int> &>]: no matching function for call to '_Call'
 2720 |         auto invoke(_Callable&& _Obj, _Types&&... _Args) noexcept(noexcept(_Invoker<_Callable, _Types...>::_Call(
      |              ^
 2721 |                 _STD forward<_Callable>(_Obj), _STD forward<_Types>(_Args)...)))
 2722 |         -> decltype(_Invoker<_Callable, _Types...>::_Call(
      |                     ~~~~~~~~
```

Instead of excluding cxx11_future on VxWorks explicitly, replace
condition with actual check which should pass in non-VxWorks 24.03 (or
older) standard libraries.

VxWorks in version 24.03 fails this test due to std::async improperly
forwards argument type to lambda, which causes compilation error when
argument type is a non-copiable value type. This is a problem in VxWorks
standard library, which could be fixed in future versions of this OS, so
keeping this as a test should unlock `<future>` header once it's fixed.

Task-number: QTBUG-115777
Change-Id: Ic67df9be2e95dce999689eaea146f113017ab4f3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ced943e936e335a16e9b479a2010e5bbee1af4f1)
2024-05-15 10:45:03 +02:00
Oliver Wolff
a4118e8b2a windeployqt: MSVC: Add support for ARM64 hosts
Windeployqt deployed all the non Qt libraries in their x64
versions as it was not aware of the host it was running on. This
check needs to be done before any deployment happens.

Current support is limited for MSVC. mingw/clang might be done in
followup commits.

Change-Id: I70fd6ad66c9cacfc6ff5b109f214a142b8b6d5f8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 81984807b30b1865a98fbd928a29d5ab6d8f5375)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-15 05:53:31 +00:00
Mårten Nordheim
6b1e1a319e QDecompressHelper: update the benchmark
After the zip bomb checks were added the benchmark was not
adjusted.

Also move the QByteArray creation outside the loop, to not include
the time it takes to make a heap allocation.

Pick-to: 6.5
Change-Id: Ia958d497dd27fc61e0084b6f5c11d76886bb24c4
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6f2ef2eacb927022e89b5e02edcbc8b06954639e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-14 16:11:36 +00:00
Thiago Macieira
1163efe559 QResource: obey the MapPrivateOption option to provide RW memory
The documentation says:

 The mapping will have the same open mode as the file (read and/or
 write), except when using MapPrivateOption, in which case it is always
 possible to write to the mapped memory.

So obey it.

This may cause high memory use by copying data we already have. This may
be important because applications may want to memory-map resources which
they intentionally didn't compress because those resources are
large. Later commits will implement some workarounds.

Fixes: QTBUG-124608
Pick-to: 6.6 6.5
Change-Id: I6979d02a7395405cbf23fffd17c8f03baf0ec00d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 39e156e639ac4eadd7a0d4dac73d05db077e817b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-14 16:11:35 +00:00
Thiago Macieira
404ac7d7f3 QResource: simplify map() to rely on the uncompressed data being there
We can only call map() if we've already called open() and that will
decompress the data.

Pick-to: 6.6 6.5
Change-Id: I6979d02a7395405cbf23fffd17c8f1f77ca92b2b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit bc5cd4dba8dceed808a573c6201acd9d210dc315)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-14 16:11:35 +00:00
Wladimir Leuschner
78bf5f7ccd QWindows11Style: Use absolute Slider positioning
WinUI3 changed the behavior of Sliders by not using steps anymore but
by absolute change.

Fixes: QTBUG-125154
Pick-to: 6.7.1
Change-Id: I708f2584432b277b0c1fc0b2587137ce71714e69
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 392c5fab815cbe41df9e25e50e4d296e7e1606f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-14 16:11:35 +00:00
Edward Welbourne
dcc482cd01 Disambiguate a QDateTime construction
When compiling removed_api.cpp, both the removed QDateTime(QDate,
QTime) constructor and the one taking a transition resolution with a
default are visible. The inline fromStdLocalTime() was thus ambiguous
as to which it was calling. So make the transition resolution overt.

Fixes: QTBUG-125079
Change-Id: I0c498bed2831afee0adc41c4575f3ed1bc244122
Reviewed-by: Tim Blechmann <tim@klingt.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 669f7e3b9723446732d31d48b653cd2bd9580f2d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-14 11:03:32 +00:00
Alexandru Croitor
43877ca81a CMake: Suppress package not found warnings in some FindWrap scripts
Some of our FindWrap scripts try to call find_package() once or more
to find a system package, and then fallback to a different source in
case if not found.

The side effect of this is that find_package() will append not found
packages to the global PACKAGES_NOT_FOUND property.
FeatureSummary feature_summary() will then list these as not found,
creating confusion.
For example while FindWrapSystemPCRE2 might be found, PCRE2 found will
be shown as not found, because we found the package via PkgConfig
instead of cmake Config file.

Manually remove these packages from the PACKAGES_NOT_FOUND property
in some of our Find scripts, to avoid the confusion.

Fixes: QTBUG-96120
Task-number: QTBUG-96394
Task-number: QTBUG-111216
Change-Id: I4be825c810248202c34f446e3cebe66574d0531c
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 70a2e7f32b9f9ce19d1538f14fbde7b0d1e77ffd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-14 11:03:32 +00:00
Alexandru Croitor
dacab83373 CMake: Propagate ZLIB version in Find script to wrapper script
Pick-to: 6.5
Change-Id: Ieba03d792b5a21c7a101e3034831475d22fd9814
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit aec74f9c767b979dbe488f48e311fe4d04413edc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-14 11:03:32 +00:00
Wladimir Leuschner
4a5d814d33 QWindows11Style: Respect user set Stylesheets
QWindows11Style inherits from QWindowsVistaStyle for which StyleSheet
theming is deactivated. QWindows11Style draws most elements with
QPainter and should therefore be able to use overrides by StyleSheets.
This patch checks, whether QWindows11Style is used and enables the
theming by declaring it not to be a QPixmap based style. Further drawing
routines for QComboBox, QPushButton and QLineEdit are now drawing always
the base background and when they are hovered a alpha mask is used to
overdraw the elemens to create a highlight effect.

Fixes: QTBUG-124286
Pick-to: 6.7.1
Change-Id: I65436493bc2b1572c0d9423a066caea3ba9e1459
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit b733d31f275d09ca81b5e347ca1e9b6c9b216cd4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-14 06:45:48 +00:00
Edward Welbourne
b562d2529a Remove old copyright notice from QTZP_data_p.h
The SPDX header now makes this redundant.

Pick-to: 6.5
Task-number: QTBUG-121653
Change-Id: I46624407ab268920b31238b26ca9cdc825dea84a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
(cherry picked from commit f43ef0802abc47c60d617fd89be82a9bb45aee04)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-13 14:18:31 +00:00
Joerg Bornemann
94b2432f1b CMake: Record static libs and target type in for deployment
In <build-dir>/.qt/QtDeployTargets.cmake we recorded deployable targets
and their file path. We skipped static libraries, because we don't
consider these deployable.

However, we need information about static library targets too when
deploying QML plugins: we need to know that they are "built by us" in
order to properly skip them.

Now, we record STATIC_LIBRARY targets too and also record the type of
each target.

Task-number: QTBUG-124771
Change-Id: Ic1ef33a3295458c372c2bc9f24ecce43f17e7321
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 519a47e870dddc16879bad9a3f8398e0349fb76a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-11 16:33:11 +00:00
Thiago Macieira
a371f0fd8c QDnsLookup/Unix: fix off-by-one error in parsing the reply
Found this when the DNS server replied with no errors, no answers, and
no EDNS0 tail.

Amends eb51454b907b02aa67268c162896fc6778920e4c

Change-Id: Ie30a3caf09ef4176bb36fffd17cdf0916ac31545
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit e3f520e621a9ea631d8a1d2f9bfc7a5f20dc698a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-11 05:14:59 +00:00
Thiago Macieira
12ae2e8075 QDBusSignature: accept empty strings as valid
QDBusSignature holds a D-Bus value of type SIGNATURE, which is zero or
more signatures, not one or more. This changes the default constructor
to create a valid signature, which we denote by not being a null
QString. That means we need to use something other than the default
constructor in our tests for attempting to pass invalid signatures.

[ChangeLog][QtDBus][QDBusSignature] Fixed a bug that caused the class
not to accept an empty string as a valid D-Bus SIGNATURE value.

Fixes: QTBUG-124919
Pick-to: 6.5
Change-Id: I262c3499666e4f4fbcfbfffd17cb3793dcf2eae3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ed6d1fa71a79a70b7e6a20fbbc737ed9f6c287b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-11 05:14:58 +00:00
Marc Mutz
4dfb99fcb2 QRestReply: allow comments where white-space is allowed
This is RFC2822 grammar (except that line folding is not
allowed).

RFC9110 doesn't allow it anymore, but it might make sense to accept it
nonetheless (Postel's Law).

Manual conflict resolutions:
- dropped constexpr on parse_comment(), which uses QByteArrayView's
  startsWith(char), which is only constexpr in 6.8.

Task-number: QTBUG-123544
Change-Id: Ie990cd332c7603dbdae29c19b2804bd33a058ca0
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 834e7d60a9cb67a1d445151a4f7c34d4288db01b)
2024-05-10 20:33:34 +00:00
Łukasz Matysiak
27407322e8 Make QFileSystemEngine::canonicalName use the realpath function on VxWorks
Despite realpath being available on VxWorks (when the INCLUDE_IO_REALPATH
component is used in the VIP), canonicalName doesn't use it, because
the system reports _POSIX_VERSION as 200112.

Fix the problem by adding an additional condition so that VxWorks
correctly uses realpath.

Task-number: QTBUG-115777
Change-Id: I734f525e870f93a7ec955d379dcc2137b591e171
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f097cbd9bf975439ed55dbe563d45948a0a43794)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-10 08:15:53 +00:00
Christian Ehrlicher
ee598d0b0e SQL tests: Fix dropping procedures Firebird/IBase
Firebird can not handle 'DROP PROCEDURE IF EXISTS' - need to call it
unconditional without 'IF EXISTS'.

Pick-to: 6.5
Change-Id: I530bcc2c756eed680a6fdaf27b3e3a0715f96bd4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 1a4470a8eff39b96c13a5f9826b0366b5418c738)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-09 09:49:11 +00:00
Christian Ehrlicher
64984f66ab QWidget: fix render() in RTL mode
Rendering a widget to a paintdevice via QWidget::render() did not pass
the LayoutDirection mode of the widget to the paintdevice which lead to
wrong rendering of text.
This is especially visible with the windows 11 style which does not draw
some widgets directly on the screen but through a QGraphicsEffect on a
QImage.

Pick-to: 6.5 6.2
Fixes: QTBUG-124931
Change-Id: If2cfa326d2ca45c42e203a4ae91fd857afa5c69c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 5ea248155654b58fcb52ef326dc4d94de83d0409)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-09 09:49:11 +00:00
Volker Hilsheimer
0508839f7e Docs: fix QT_NO_FOREACH/KEYWORDS macro documentation
QT_NO_FOREACH didn't related to anything so the documentation
wasn't generated, and QT_NO_KEYWORDS wasn't documented but
referenced.

Conflict resolution: include relevant documentation that was
added in 3a6c8e02b6d1b0574da52b0087092d0c74aa92c1 as well.

Change-Id: I7b79e61519c186d10f8e8c674705adb3d10bd53a
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit fd6cfd22831c6ff7078bb97e62439375cfc849f6)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-09 11:49:11 +02:00
Thiago Macieira
7910e5a36e QDnsLookup/Unix: check size in parsing of SRV records
We need at least 7 bytes: three 16-bit numeric fields and the hostname,
for which we need at least one byte and expandHost() takes care of
checking size further.

Pick-to: 6.5
Change-Id: Ic5b1273bb0204c31afd8fffd17cd3c9ba3c9fec7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 55c6d6c86bf092401a4876faead603561cc54d50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-09 07:21:42 +00:00
Tor Arne Vestbø
d43c9b0246 iOS: Always call setParent during QIOSWindow construction
We rely on setParent for parenting top level windows into our desktop
manager view, so we can't condition the call on having a parent window,
like we do on other platforms.

This was a regression from 988039729f55a5e62e32b82c6f29ff7457e91d9d.

Fixes: QTBUG-125142
Change-Id: I2884d77db09cba5371ccd77eabda7ce38c0292de
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 6c36e21bec1197e933ee1fbe14bd18936544d32a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-08 17:51:35 +00:00
Thiago Macieira
bb51347266 QCoreApplication: make removeNativeEventFilter() remove from main thread
installNativeEventFilter() always installs on the main thread, so match
it.

[ChangeLog][QtCore][QCoreApplication] Fixed a mismatch on which event
dispatcher was modified between installNativeEventFilter() and
removeNativeEventFilter(). Now both functions in QCoreApplication access
the main thread's event dispatcher. To access the current thread's
dispatcher, use QAbstractEventDispatcher's functions.

Fixes: QTBUG-124783
Pick-to: 6.5
Change-Id: I6979d02a7395405cbf23fffd17ca09e1ac43f1f3
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit ed70faf87af42dea290853730093b3c2ecb90b0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-07 21:22:42 +00:00
Thiago Macieira
0de6328f06 QThread/Doc: update the docs on setStackSize()
There's some confusion about minimum and maximum.

Fixes: QTBUG-109512
Change-Id: I262c3499666e4f4fbcfbfffd17cc1d592bc658b3
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Philip Van Hoof <philip@codeminded.be>
(cherry picked from commit 3fc5ee5c2e4ed919b2939ca54a1958b8463eb404)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-07 21:22:38 +00:00
Alexey Edelev
5ee9da89af Prefer the versioned targets over the namespaceless one when collecting deps
Change the way we collect dependencies in __qt_internal_walk_libs.
Prefer the versioned Qt targets over the namespaceless. This fixes the
generating of the pkg-config configs.

Pick-to: 6.6 6.5
Task-number: QTBUG-124135
Change-Id: I660376e122a99b5bc0874f2bc6ccd4d80c9ad453
Reviewed-by: Ionen Wolkens <ionen@gentoo.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit ac4920b5c0a537ede62dcef76a32311a497c68e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-07 17:23:10 +00:00
Alexey Edelev
21b2ce455c Consider versioned targets when checking the existens in __qt_internal_walk_libs
Since Qt targets now are linked as versioned targets by default, we
should adjust the respective check in __qt_internal_walk_libs.

Change-Id: Idb896c1d9eda944a06d57b0491686cd78e010df0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 721cfbd1942f8148dd464c0542b0d4c1191b53f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-07 17:23:10 +00:00
Alexey Edelev
062f701a11 Consider '^Qt6' deps when generating pkg-config files
Dependencies that alredy start with QT_CMAKE_EXPORT_NAMESPACE shouldn't
be skipped but collected as is when generating pkg-config files.

Pick-to: 6.6 6.5
Fixes: QTBUG-124135
Change-Id: I6875337c2e1d98f657e52a5fc2c37eebccf08b98
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 337cadbcb7900d78505b25e66555b853d2c2c707)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-07 17:23:10 +00:00
Christian Ehrlicher
1d4d3cff19 QCommonStyle: Fix painting arrows when size is even
Rework the painting code to not use floating point numbers and make sure
the tip of the arrow is painted with one or two points (depending on the
size is odd or even) so the arrow is always symmetric. Therefore also no
anti-aliasing is needed. Sadly the dpr scaling and also
QPainter::drawPolygon() screw things up a little bit with such small
sizes, therefore do the dpr handling by ourself to get nice results.

Fixes: QTBUG-124554
Task-number: QTBUG-114539
Change-Id: I8ab8c2ce3ceb90af5d7c3a0dfeec7f7445e92a4d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bbff35a343f607fde64a71b651db9f35365e3c67)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-05-07 17:23:09 +00:00
Volker Hilsheimer
d42931b82e Docs: fix warning from old QCheckBox::checkStateChanged overload
The overload carrying the new state as an integer is deprecated, but
still documented, so we need to document the parameter as well. Bring
the full documentation back to silence the warning.

Amends 5a96d13bb5abd5339cf21dd1de7a17152c71f0fc.

Change-Id: I5253e68e4ad7b42fc552feb958cc0ac40d685609
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 31de58990661f6fdc9f1145e16745916d1c6df59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-07 10:18:25 +00:00
Christian Ehrlicher
c08aed6d47 QLineEdit: set object names for actions
Set object names for actions created by createStandardContextMenu() to
be able to access them from the outside. Use the same naming schema as
by QWidgetTextControl::createStandardContextMenu() (used by QTextEdit
and others).

Pick-to: 6.5
Fixes: QTBUG-112721
Change-Id: Id92f1ba13e7f7e8b1d531678895902374114d167
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 77c6b0c66f3191dd1b15ea052e98e6a16442f8cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-06 21:12:13 +00:00
Edward Welbourne
bbdf2b86f5 Document calendar setting of QCalendarWidget and QDateTimeEdit
It seems this was neglected in 5.14, when the methods were added.
The calendar setting is also not a Q_PROPERTY; and hadn't been tested
until recently.

This follows up on commit 2dee00621632ab8acd0b3d59bdba264afe2f32c1

Pick-to: 6.5
Task-number: QTBUG-115200
Change-Id: I9625bf54d05a55a40867847bd58130be90e78271
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 33cc65328819836374eb4823e571789b066003f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-06 21:12:13 +00:00
Volker Hilsheimer
e8b3e37c5a JNI: Mark tech preview API as such
Retrofit the QT_TECH_PREVIEW_API macro into the JNI classes and
helper constructs that are not yet documented, and which can only
become publicly documented once the full JNI type system with the
type registration infrastructure is documented.

We can remove the tagging in dev once we have documentation and
are ready to move this functionality out of TP, presumably for Qt 6.8.

Change-Id: I235e57b8e57c2d04be72b4c842131d99a5f83d9e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 5b41046813d21d565904a6b37bef4b75268fc8f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-06 21:12:13 +00:00
Axel Spoerl
e259e5b9c5 Android: Detect mouse buttons
The mouseDown() and mouseUp() methods in androidjniinput.cpp hardcoded
Qt::LeftButton to all mouse-press / release events.
If a mouse is connected to an android device, all three buttons are
mapped to the left button.

Extend both mehtods' signature by a mouse button state.
Add a converter method to map from Android button states to
Qt::MouseButtons. Add a sendMouseButtonEvents method, that iterates
through all buttons pressed/released and sends the respective events
to QWSI.

Adapt the mouse handler in java, to obtain and pass the button state
to C++.

The patch can't be verified in an autotest. Testlib's mouse emulation
injects into QWSI.

Fixes: QTBUG-99106
Pick-to: 6.6 6.5 6.2
Change-Id: I933f490901928db9761d2ef254ae1e5b4f473f28
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 8d8cbe87e21f05b7d611ed4be47299977288b267)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-06 17:50:25 +00:00
Andreas Eliasson
1eb9f165ec Doc: Remove \note that indicates you can access the source code
There used to be an examples page; this is no longer the case. Thus,
remove the \note that indicates you can access the source code.

Fixes: QTBUG-122166
Pick-to: 6.6 6.5
Change-Id: I1abe88000ae406e8d2cc9cc1deed42664607626b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit f8bc0e7c3b220dd19a2bb3ed7f868b6c1bcfde7d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-06 17:50:08 +00:00
Santhosh Kumar
35afe09b03 Fix progress bar rendering issue when using windows 11 style
The Windows 11 style checks for QProgressBar type and gets the
respective orientation required for rendering. This creates an issue
when we use QStyleItemDelegate as it's not QProgressBar type. This patch
removes that condition and gets the orientation information through the
style option similar to Windows Vista style.

Fixes: QTBUG-124447
Change-Id: Ic2b36d79d7af017262e44dd2800ad45fbe63f8f2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 8f283aa2997975f94c9e214064855553b4a6ee48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-06 17:50:03 +00:00
Laszlo Agocs
aa6d59deee rhi: metal: Reduce staging copy size for full-width texture uploads
Pick-to: 6.6 6.5
Task-number: QTBUG-120565
Change-Id: I3f11796e0cfd7261885cec04695665b2266082f8
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit a1371783ac3b04df5b5275de49179a26a7c5112b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-06 13:06:53 +00:00
Laszlo Agocs
191459da49 rhi: vulkan: Reduce staging copy size for full-width texture uploads
Pick-to: 6.6 6.5
Task-number: QTBUG-120565
Change-Id: I057f40ee410df35af87f27a0357252bc26234f04
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit aa12713c1fdb8dfb9034de6f8f162864cf868753)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-06 13:06:50 +00:00
Axel Spoerl
4e396bcdc4 Fix crash in QMainWindow:.tabifiedDockWidgets()
QMainWindow:.tabifiedDockWidgets() was refactored in Qt 6.6.3, because
it returned wrong values. It now loops from 0 to
QMainWindowTabBar::count() and uses QMainWindowTabBar::dockAt(), to
get the dock widget pointer for an index.

When a dock widget is removed from a floating tab, event processing is
necessary for the item_list and QMainWindowTabBar::count() to get in
sync. This case was overlooked in the refactoring. It can lead to
dockAt() being called with an out-of-bounds index, which it asserted.
The assertion triggered, when QMainWindow::removeDockWidget() and
QMainWindow::tabifiedDockWidgets() were called right after each other,
without processing events inbetween.

QMainWindowTabBar::dockWidgets() doesn't add nullptr to the list, it
returns.

Therefore, return nullptr, when dockAt() is called out-of-bounds.
Add test functionality in
tst_QDockWidget::updateTabBarOnVisibilityChanged().

Fixes: QTBUG-124262
Pick-to: 6.5
Change-Id: If66084b9f00b4e39f7a620da68df67c735029cf1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f97e60a4f0602e1478c888ff1043276966c93387)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-06 12:14:01 +00:00
Christian Ehrlicher
4b47d64f15 QDialogButtonBox: properly clear buttons in setStandardButtons()
When setting new buttons with setStandardButtons(), the old ones are
deleted by iterating over d->standardButtonHash. But this hash is
modified when a button is destroyed and therefore sometimes not all
buttons were deleted.
This amends df735d794fd2e545c18b9e345e833422bcd64329.

Fixes: QTBUG-123939
Pick-to: 6.5
Change-Id: I867086855cfde88a7b22a5579662f250b9db0042
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 0e5d5513279cff61673adc2ace5ed27202bbdc97)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-05 12:45:34 +00:00
Thiago Macieira
9a504780b9 SOCKS5: remove '###' from the error message
There's no reason for it to be there.

Pick-to: 6.5
Change-Id: I262c3499666e4f4fbcfbfffd17cbbcfcd798b100
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d44d19dd98e20cb4163dea8e0fafb8f03bdc7f5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-04 17:17:53 +00:00
Thiago Macieira
17cfe9b2cf QResource: move the internal classes to unnamed namespaces
So the compiler has more opportunities to inline and to not emit out-of-
line copies.

Change-Id: I6979d02a7395405cbf23fffd17c9101b2b52472a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit fe6dda9bb9310878b408b2421f60acb7135bd8ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-04 17:17:20 +00:00
Ivan Solovev
06bb5f19bf QDataStream::readBytes: do not leak the memory in case of bad_alloc
The algorithm was leaking the previous buffer if the attempt to
allocate a new one failed with std::bad_alloc.

Wrap the buffer allocations into std::unique_ptr, so that we do
not leak the buffer in case of bad_alloc.

This patch is not changing the behavior of QDataStream, so it's
NOT handling the bad_alloc exception, and also does not change
the state of the buffer in case the exception occurs.

Pick-to: 6.5
Change-Id: I5558a6d03768094e4ee83ca47cacf4e09c36f1cf
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e176dd78fd2f253eb2625585b2bd90b5713e5984)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-03 15:36:23 +00:00
Ivan Solovev
232a866ea8 QDataStream::readBytes: guard against integer overflow
The step variable changes in the geometric progression, which means
that it may overflow at some point. Since it is a qsizetype (signed 64
or 32 bit integer), the overflow would be UB, so we need to avoid it.
Add an extra check that the step is lower than the safe threshold
before increasing it.

Amends a1bfac287ee5d3719646d68dc91dc8e8e4cec04e.

Change-Id: I6097986e614937fa88b31b3dd1e53ecff22533d7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2352fa0040f133e30ccc3955031618f51214791d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-03 15:36:20 +00:00
Thiago Macieira
16365a0b65 QThread: relax memory semantics from seq_cst on interruptionRequested
Amends a0faf9e23666d4aa26a93d6e9ebf420e71d5e6c2.

Change-Id: I262c3499666e4f4fbcfbfffd17cb1e141ad104d8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b2c236792c6eaa676b2dce3d8abb4f5948957699)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-03 00:13:32 +00:00
Marc Mutz
e571a82015 QtPrivate::Continuation: add missing Q_DISABLE_COPY(_MOVE)
This polymorphic class is not designed for copying or moving, so
statically assert that it isn't moved or copied.

Amends dfaca09e85a49d2983bb89893bfbe1ba4c19eab4.

Task-number: QTBUG-124909
Change-Id: I6a4fe460adf9bf903578601e500ccc697a3f7c96
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e53df7a0218ff2d88668a33a0d9cf8bbe40e4933)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-02 23:05:18 +00:00
Allan Sandfeld Jensen
98ab914efc Revert "SQL/IBase: print warning in case of unsupported data type"
This reverts commit 1fc95e5214c5ac6d831eb5e2701a061bddbe1f9f.

Reason for revert: Doesn't compile

Pick-to: 6.5
Change-Id: I0e8b39bd2b4f490664bdc935b941b2e7bdf1eb89
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-05-02 15:22:31 +00:00
Marc Mutz
2ca66ab096 QSettings/removed_api: don't return <void expr>
Fixes clazy-returning-void-expression.

Amends 4cf299eb5bbdbac8484c2ee8c5afbd260dccc6d5.

Pick-to: 6.5
Change-Id: I6192deb82afe9a5ba7ddaf6203d4046f518c545a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 59d24e361538e8ea03adc12785cbb73ecba61ab2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-02 08:42:08 +00:00
Eike Ziller
272808600a QCompleter: Hide popup when widget is hidden
When the widget the completer is attached to was hidden,
the popup stayed open. It would "hang around" with no
corresponding UI being around anymore, which is weird.

Fixes: QTBUG-124861
Change-Id: If9cb04e693c2663ef9da14164611f26becafc4b4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 24859d7deaf995e992f0d9439a1c476126d5f654)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-02 08:42:08 +00:00
Eskil Abrahamsen Blomfeldt
5310cce3ce test: Don't crash when focusWidget() is null
If QApplication::focusWidget() returns null, which was the
case on Wayland under some circumstances, then the code collecting
the error output would crash when dereferencing the null pointer.

This fixes that crash and gets proper test failure output instead.

Pick-to: 6.5
Fixes: QTBUG-124475
Change-Id: Ic34228be953cf42dfe2ebf75957cd48791e6de7d
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 5711aaa0170bd97dab1479c0e6c884289e41da99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-02 08:42:07 +00:00
Marc Mutz
8302c727e6 QRestReply: make charset parsing more robust
The old code was based on QString::split and e.g. didn't handle
escapes in quoted-strings.

Write a modern recursive-descent parser to parse out type/subtype and
charset parameter. Since we don't, yet, support CFWS (see below),
recursion depth is strictly limited, so we're not susceptible to
recursion bombs here.

It currently handles only RFC9110-style grammar, but can be easily
extended to support CFWS (RFC2822-style comments and folding
white-space) or RFC2231-style continuuations, if needed.

It's a bit more general than strictly required, because I expect this
to be reused elsewhere ere long.

Manual conflict resolutions:
 - dropped a few constexpr from functions which use QByteArrayView's
   startsWith(), which is only constexpr since 6.8

Fixes: QTBUG-120307
Change-Id: I309928dc350a043672dffb4a259b457764c031be
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 98b034e53a7821018683c05d5dba776f0f2753f0)
2024-05-02 05:34:25 +00:00
Tor Arne Vestbø
a8ef8ea550 Don't quit automatically via QEventLoopLocker if there are open windows
As part of df359bcb703db5a8adbf14e88ba4ae0d54f0cfcd the semantics and
interaction between QEventLoopLocker and QGuiApplication was changed,
based on the assumption that these two mechanisms were independent
and should not affect each other.

This had a surprising regression where the use of QEventLoopLocker in
combination with the QCoreApplication::isQuitLockEnabled() automatic
quit would end up quitting the app, even if it had open windows, for
example when the last job of some internal job queue finished.

It could be argued that if the app has open windows that should not
be closed, they should ignore the Close event, and that an application
with running QEventLoopLocker jobs should maintain an active window
showing the progress of those jobs, but still, this is regression
that we want to fix.

We now bail out if !lastWindowClosed() in QGuiApplication's
canQuitAutomatically, which is triggered from QEventLoopLocker's
isQuitLockEnabled() behavior. And we do so regardless of whether
quitOnLastWindowClosed is set or not, as the latter property
determines the behavior when closing a window, not the behavior
when a QEventLoopLocker goes out of scope.

Similarly, we now block quitting of the application when triggered
by quitOnLastWindowClosed() if a QEventLoop is active, regardless of
the isQuitLockEnabled(), as the latter property is determining
whether we should trigger a quit, not whether we should block them.

[ChangeLog][Important behavior changes] Fixed a regression where
the last QEventLoopLocker going out of scope would quit the app,
even if there were open windows, if quitOnLastWindowClosed was
false.

[ChangeLog][Important behavior changes] Fixed a regression where
closing the last window would quit the app, even if there were
active QEventLoopLockers, if isQuitLockEnabled was false.

Fixes: QTBUG-124386
Pick-to: 6.5
Change-Id: I84fd0ddea78a2f417f3a17b326113c880079cf85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0b494c47d36a8234b1763518c9cddafe62f03715)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-01 09:48:45 +00:00
Marc Mutz
2117fc2b16 QNetworkInformation: remove redundant friend declaration
Q_DECLARE_PRIVATE already marks the Private as a friend of the Public
class. No need to do it manually.

Fixes GCC's -Wredundant-decls.

Amends 0875626e22ad4e709ddf505e701a8d699559f5b4.

Pick-to: 6.5
Task-number: QTBUG-115583
Change-Id: I26f8a42e375c1377c03fe60ccccadc5d0c3b02c5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f24a03a22a863eac18a3981973f6a19aef3116f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-01 00:36:16 +00:00
Marc Mutz
624fd64d1e qfuture_impl.h: remove redundant declaration
QtPrivate::watchContinuationImpl() is already declared in
qfutureinterface.h, which qfuture_impl.h already includes.

Fixes GCC -Wredundant-decls.

Amends 59e21a536f7f81625216dc7a621e7be59919da33.

Task-number: QTBUG-115583
Change-Id: I9c77209d2d10492f4d81aacc1f1da3201b5d1810
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
(cherry picked from commit 1941c11b6a633fe9a1416d7ff3e03bb5342b65da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-01 00:36:10 +00:00
Volker Hilsheimer
98046f48fa QPageSize: remove redundant operator== declaration
Amends a45a3b1ece490bcae5cccd858dbe11408a19bee0, which added the hidden
friend as an inline function, without removing the already existing
declaration. Since that declaration was exported, keep it in the ABI
via Q_REMOVED_API, and only remove it from the API.

Fixes: QTBUG-115583
Change-Id: I169b565ed02168248f96c1379f537b90b4ea481c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit c4086d7b7a3b5a06a2faaaf26e2a9f9d6b2918c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-05-01 00:36:03 +00:00
Jens Trillmann
56c8ed47a1 Android: Propagate a11y ObjectShow events to screen reader
Sending an ObjectShow event, e.g. by setting QQuickItem::visible to
true, has to trigger a refresh of the screen reader hierarchy. If the
signal is ignored the source of the signal will be ignored by the
screen reader.

Fixes: QTBUG-122436
Pick-to: 6.5
Change-Id: I32ee2e8b2602cd0dd9b9a83ff1fe426d88d137a8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit efd00066b42d9cbd3a85336f4851213d94cdc28e)
2024-04-30 08:58:06 +02:00
Marc Mutz
5eecb650f6 QRestReply: add a few more content-type parsing tests
... incl. some that fail.

This is in preparation of a patch that makes the parser more
compliant.

Manual conflict resolution:
 - Rebased to before conflicting change
   15b0bd69ff2a3ac967ddb98b5fc3c3ce8c3d5b4b

Task-number: QTBUG-120307
Change-Id: Ic47b23132f2a7ea81b6c480bfb036bc2daff05da
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 2822b226109bc2e537e810b7c885baa2cb369588)
2024-04-30 02:24:56 +00:00
Kai Köhne
0aa0d505b1 SQLite: Update identified license
SPDX nowadays has a dedicated license identifier for SQLite. Let's use
this.

[ChangeLog][Third-Party Code] Change identified license for SQLite from
'Public Domain' to more accurate 'SQLite Blessing':
https://spdx.org/licenses/blessing.html

Pick-to: 6.5 6.2 5.15
Change-Id: I6c3378c45bc5edf498673c1b060f8e8c14d96a62
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit f0633e823796775d2c019363ca4f1cb008851402)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-28 12:42:11 +00:00
Jaishree Vyas
fadeb174bc Doc: QDataStream doc example
Updated the example description

Fixes: QTBUG-123035
Change-Id: I3dc953b02297e6e6bd9aecbc2e8831f13cf48715
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 210063a3cfcbe5fa9506ea14fd27787765ae2e9b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-27 16:58:19 +00:00
Wladimir Leuschner
2141c7998a Windows11Style:Save unpolished palette for QAbstractScrollArea::viewport
When using QWindows11Style, the viewports background has to be set to
Qt::transparent to have the effect of rounded corners in ItemViews and
Combobox flyouts. Other Windows styles do not make use of transparent
windows, so this polishment needs to be reverted in case the style
changes. Other styles also do not manipulate the
QAbstractScrollArea::viewport palette and thus changing color schemes
results in not applying the new color scheme.

Fixes: QTBUG-123928
Pick-to: 6.7.1
Change-Id: Icb529124f63587e75bb56e40e8b1fcfe3c61c55d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 7d7d843a3eacf11d2e9e5c2dd596f6daa3ab46f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-27 16:57:53 +00:00
Allan Sandfeld Jensen
1a21a55c1f Convert "(added in)" enum warnings to [since] syntax
With the since syntax we can now mark since more standardized

Change-Id: I3c53010043a40e8887f1899cde2689ee80e530ae
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
(cherry picked from commit b7b0478405fb95ec44b286e0efb41256ef5170d6)
2024-04-27 18:57:37 +02:00
Mitch Curtis
bab1773661 QCocoaMenu: fix crash when app quits while menu is open
Consider the following QML code:

    import QtQuick
    import QtQuick.Controls

    ApplicationWindow {
        visible: true

        Menu {
            id: menu
            MenuItem {
                text: "Some action"
            }
        }

        TapHandler {
            acceptedButtons: Qt.RightButton
            onTapped: {
                exitAppTimer.start()
                menu.open()
            }
        }

        Timer {
            id: exitAppTimer
            interval: 1000
            onTriggered: Qt.quit()
        }
    }

With the new native Qt Quick Menu, this will create a native menu on
platforms like macOS. When the user right clicks on the window, a timer
is started and a native menu opened. After 1 second, Qt.quit() is
called while the menu is still open. As popUpContextMenu is blocking,
when the menu is finally closed (by user interaction), control returns
to QCocoaMenu::showPopup, but the QCocoaWindow has since been
destroyed.

Account for this by storing the window in a QPointer.

It's not possible to test this as native menus can't be auto-tested.

Fixes: QTBUG-124551
Pick-to: 6.5
Change-Id: I14a97073f350c38828b3e16bb157439aeeeb6529
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 468cb035efe4890c388069eb373a7ae8ef178146)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-27 16:57:05 +00:00
Marc Mutz
fa8199459d QVariant: fix C++20 build with older MSVC 2022
... which claim full C++20 conformance (__cplusplus >= 202002), but
still lack https://wg21.link/P0846.

Fix by extending the existing workaround for lack of P0846 support to
these compilers.

Known to fail: _MSC_VER 1936
Known to pass: _MSC_VER 1939

We might need to check 1938 and 1937, but the workaround should only
show up as an additional get/get_if overload and not disturb normal
operation, so it's not critical to get the boundary version exactly
right.

Amends eb9c8042cfa71f16cda27cdeb052d84a6cc117d7.

Task-number: QTQAINFRA-6204
Change-Id: Ia3e0072d606efb7efd6ce0f75239850c7cd925bb
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit ab06d402dd833cefe9c0d929c13e93068aab96d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-27 16:56:45 +00:00
Axel Spoerl
c03274c5c4 Revert "QCommonStyle: paint arrows with anti-aliasing"
This reverts commit 74e8f673b827c57ebf2bf802840c19e4a1ac848b.

Reason for revert: the change as is makes the rendering of arrows in the
styles unpleasantly blurry.

Change-Id: I59ccd7373631a550276465caffb7d3074ff5893c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 35309856201dea2f14e53468a3c39a777c062729)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-04-27 00:22:27 +00:00
Tor Arne Vestbø
f268b98289 metal: Tie drawable's MTLTexture lifetime to MTLCommandBuffer
By default we define QRHI_METAL_COMMAND_BUFFERS_WITH_UNRETAINED_REFERENCES,
which means we create MTLCommandBuffer via commandBufferWithUnretainedReferences.

In this case, if Metal API validation diagnostics is enabled in Xcode,
the texture is released before the command buffer is done with it, so
we manually ensure the lifetime of the texture extends until the command
buffer is complete.

Change-Id: I9b9efa96b4a004f43e0b72144aafc4b440c7fbb4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 94e83aa7d7d05cf0b6636bdfac5cdcb38706aa73)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-26 17:58:29 +00:00
Marc Mutz
a4c2710077 QThread: check various ways users may use start(Priority)
Some of these would break if we changed the start(Priority) to say
start(QThread::Priority) instead.

Pick-to: 6.5 6.2
Task-number: QTBUG-124723
Change-Id: Id3ebe73718c8acbc54a2c88158f4062fd0dd5be1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cf19105e018314d1fb05bc91959f233d3d6747ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-26 17:58:29 +00:00
Christian Ehrlicher
1fc95e5214 SQL/IBase: print warning in case of unsupported data type
Print a warning when we encounter an unsupported data type.

Pick-to: 6.5
Change-Id: If35ac4dfdf29e555ec406f592c1001b5e16f8ff2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 463037d9bd5461218afe5fb5a5e4fe2d62923f20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-26 17:58:28 +00:00
Christian Ehrlicher
c267017d4c SQL/QSqlIndex: remove unused private function createField()
This function was forgotten when the Qt3 support was removed during
initial Qt5 porting (f306d18fe6555a9a5c60560745773b0bf5685ec3).

Change-Id: I83a0be0db7e81bd9d4f84683a013e1d4faab2dd8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
(cherry picked from commit 5a7d41667d08cd6062cee43ee871fae5663ed7e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-26 17:58:28 +00:00
Tinja Paavoseppä
398d4919aa Android: Add QT_ANDROID_SURFACE_CONTAINER_TYPE env var
The Android QPA picks between two types of Views that can provide a
Surface for it, SurfaceView and TextureView. Normally, SurfaceView
is used if there's just one window in the app, and TextureView is
used for any additional windows, since it allows better control
over the z order between the windows. Add an environment variable
QT_ANDROID_SURFACE_CONTAINER_TYPE that can be used to
override the normal choosing strategy, and force the application
to use either one of the View classes for all the windows of the
app.
This helps with testing changes to the Android QPA windowing,
as you can use the same app to test both Surface Views easily.

Change-Id: Icc15fd9675175b854354a379b6ffa7ae5532408e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 88168fa85dae337410169bf54e6bdf5b20e3023e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-26 17:58:28 +00:00
Ivan Solovev
7faabcce1a MSVC: improve QASV(const char(&str)[N]) compilation time
The lengthHelperContainer() implementation for sizeof(Char) == 1 case
is using qstrnlen() for the non-constexpr case.
qstrnlen() is an inline function which is effectively a nullptr check
and a memchr() call.

For some reason, on MSVC this combination resulted in very slow
compilation for the user projects, where each call to
QObject::setObjectName() was hitting this codepath.

Fix it by replacing the qstrnlen() call with strnlen_s() for MSVC.
It seems that for now all versions of MSVC are affected. However,
introduce a new Q_COMPILER_SLOW_QSTRNLEN_COMPILATION definition,
which will allow us to check for the compiler version later on.
For now this definition is set for all MSVC versions unconditionally.

Fixes: QTBUG-124376
Pick-to: 6.7.1
Change-Id: Id769bef1e950ffa756acf7af39d362fd8b112019
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d849cb80a4ba468e2c6097ebfcab384ddaec8e67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-26 17:58:28 +00:00
Eskil Abrahamsen Blomfeldt
843b9921f3 Update Harfbuzz to 8.4.0
Pick-to: 6.7.1 6.5 6.2 5.15
Fixes: QTBUG-124757
Change-Id: I1fa9259c2f7cb45b4dcec8956c2186735c89fb95
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9ecb468aec3ec0d649587007786475d9a9974a30)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-26 13:57:33 +00:00
Oliver Wolff
81395d94e9 Windows: Prevent potential "crash" in setApplicationBadge
In some circumstances our application badge code seems to throw an
exception. The issue is hard to reproduce but just catching the
exception should be enough to fall back to the "non-winrt" version of
the code.

Fixes: QTBUG-117091
Pick-to: 6.5
Change-Id: I61f4e59f7309e2bb47b50a6ca6f3099ed9cd0af1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 6f995b5e246bd9cc56710fa9cebc6dbb7cb2b72f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-26 10:55:46 +00:00
Oliver Wolff
c1b8f4aee6 windeployqt: Deploy target dlls for directx and vc runtime
When deploying for a cross compiled target we should deploy the target
versions of directx and compiler runtime dlls. Thus a new platform was
added to utils to be able to reflect this distinction.

Fixes: QTBUG-124719
Change-Id: I4dd797804fa871d76d56f8775b188d4306b51e5a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit ed191b6afa36aaf47478856fc44b9ebc300ff808)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-26 10:55:45 +00:00
Antti Kokko
eb0c781bde CMake: remove QT_EDITION from qconfig.pri
QT_EDITION is not used anywhere in Qt6, stop
adding it to qconfig.pri.

Packaging currently unnecessarily patches
the edition when handling the first steps after
integration and again during install time.

Pick-to: 6.5 6.2
Change-Id: I0ad1933ec8fea741796fdf6d13f627a657aac401
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
(cherry picked from commit d04deafed932d955e2e94324ec5b1a261fdb3332)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-26 09:53:22 +00:00
Tim Blechmann
f17ff4be2c Gui: fix memory leak in QGuiGLThreadContext
`QCoreApplicationPrivate::cleanupThreadData` calls
`~QGuiGLThreadContext`, which calls
`QOpenGLContextPrivate::setCurrentContext`, which creates a new
`QGuiGLThreadContext`, which is not destroyed anymore.

since `~QGuiGLThreadContext` sets a nullptr we exit early.

Fixes: QTBUG-124538
Change-Id: I51e40fcf8fd1169a4dfd336fac9c82f44d42f68e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit d139642aefde2d00683cf29f3875ccfae6c66779)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-25 17:33:33 +00:00
Friedemann Kleint
fe6e1c2191 uic: Write fully qualified enumerations for cursors/icon pixmaps
Fixes: PYSIDE-2492
Change-Id: Ic2505628b0550654c109cf239b4f2390f03df623
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
(cherry picked from commit b0325c799287a56837d7dd3b9eb40762107302be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-25 17:33:33 +00:00
Assam Boudjelthia
0aa3b32ad4 Remove check for Qt version > 4 that's not useful now
Change-Id: Ia24b2b9fb9f3b070f8eccaf74a09787b324ab01e
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 6e8f97b83b7636077a83f2f900a167d049b575f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-25 11:47:34 +00:00
Jani Heikkinen
e1c9216deb Bump version to 6.7.2
Change-Id: I99272a3b36c14be480f25a133f4e0a11cb46eaf3
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-04-25 05:33:41 +01:00
Marc Mutz
c8a0f5dd75 QAtomicScopedValueRollback: remove impossible constexpr
Neither atomic::load() nor store() are contstexpr in the standard. The
only reason this code compiled is because QASVR is a class template,
so contexpr tags that can't be fulfilled are silently dropped at
instantiation time by the compiler.

Remove the tag to avoid giving readers the wrong idea.

Reported-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I6f23ab9fb2e8ceecaa45ffaef1fadbc7de266803
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c1f1523047b2e005fb7442847c2aa000faa7d0ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-24 20:30:53 +00:00
Thiago Macieira
409bfca890 CMake: fix cross-compilation build: ${CMAKE_SYSTEM_PROCESSOR} is empty
CMake Error at tests/auto/corelib/global/qcomparehelpers/CMakeLists.txt:
20 (if):
  if given arguments:

    "CMAKE_VERSION" "VERSION_GREATER_EQUAL" "3.20" "AND" "NOT" "MACOS"
"AND" "NOT" "VXWORKS" "AND" "NOT" "(" "LINUX" "AND" "MATCHES" "aarch64"
")"

  Unknown arguments specified

Change-Id: I6979d02a7395405cbf23fffd17c900d8e25e4c0c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 1d17604c65803f900c751bd6386fc243c0291f06)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-24 19:27:41 +00:00
Marc Mutz
0eaf2e9df8 QRestReply: micro-optimize optional<QStringDecoder> handling
Use optional::emplace() instead of assignment from an rvalue.

Saves the move constructor and destructor calls, both of which are not
trivial (due to cleanFn).

Change-Id: Ief77626c77d0c8c2ce17e3b1a21496a7da969761
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 063e31209b1750b6cbd2c3f57c49ce372b13a91a)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-04-24 16:25:26 +00:00
Eirik Aavitsland
3516762d73 QMovie: fix regression in frame delays
The recent addition of support for multi-frame (non-animation) formats
had an unwanted side effect of sometimes calling
QImageReader::nextImageDelay() when the reader is at a different
frame than intended. Fix by effectively reverting to the previous call
pattern.

Fixes: QTBUG-124227
Pick-to: 6.5
Change-Id: I735f8d67afb17bd4c77f9b4507a71796b7d66958
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 5f0ed0ac0ddffd3779fae0db956df8d48d629f92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-24 15:13:23 +00:00
Tim Blechmann
5241ebcea6 CMake: add licenseRule.json to IDE projects
Some repos have licenseRule.json files. Adding them to the IDE projects.

Change-Id: I7fdc054d244d48e3343866775671d8f4f4c9390b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
(cherry picked from commit 7a62c962383b6a069c6955f57173a0f1001c4461)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-24 14:06:37 +00:00
Thiago Macieira
3053c9b2a3 tst_QDnsLookup: use the 4-argument writeDatagram() overload
When using writeDatagram(QNetworkDatagram), the sendmsg() call on
FreeBSD is failing. It works on Linux and on macOS, so my guess is that
IP_PKTINFO works to set the sender address but IP_SENDSRCADDR is not
allowed in this context for some reason.

Before:
 recvmsg(5,{{ AF_INET 127.0.0.1:19530 },16,[{"H\M-p\^A\0\0\^A\0\0\0\0\0\^A\tso"...,49}],1,{{level=IPPROTO_IP,type=IP_RECVDSTADDR,data={0x7f,0x00,0x00,0x01}},{level=IPPROTO_IP,type=IP_RECVTTL,data={0x40}}},48,0},0) = 49 (0x31)
 sendmsg(5,{{ AF_INET 127.0.0.1:19530 },16,[{"H\M-p\M^@\^C\0\^A\0\0\0\0\0\^A\t"...,49}],1,{{level=IPPROTO_IP,type=IP_RECVDSTADDR,data={0x7f,0x00,0x00,0x01}}},24,0},MSG_NOSIGNAL) ERR#22 'Invalid argument'

After:
 recvmsg(5,{{ AF_INET 127.0.0.1:16018 },16,[{"\^U\M-X\^A\0\0\^A\0\0\0\0\0\^A\t"...,49}],1,{{level=IPPROTO_IP,type=IP_RECVDSTADDR,data={0x7f,0x00,0x00,0x01}},{level=IPPROTO_IP,type=IP_RECVTTL,data={0x40}}},48,0},0) = 49 (0x31)
 sendmsg(5,{{ AF_INET 127.0.0.1:16018 },16,[{"\^U\M-X\M^@\^C\0\^A\0\0\0\0\0\^A"...,49}],1,{},0,0},MSG_NOSIGNAL) = 49 (0x31)

Change-Id: I455fe22ef4ad4b2f9b01fffd17c77565e230ce31
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 41675df695206d046d4786af142f163dfe9b18dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-24 02:05:02 +00:00
Thiago Macieira
787b1e7079 tst_QDnsLookup: fix MSVC 'truncation of constant value' warning
0x80 is too big for a signed char (range is -0x80 to 0x7f).

Change-Id: I455fe22ef4ad4b2f9b01fffd17c7746f4ea3c536
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 2dfb7f3337f601e90532499acc763be1c339aa4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-24 02:05:01 +00:00
Thiago Macieira
ae302ef016 QDnsLookup/Unix: handle more error conditions from res_nsend()
It does set ECONNREFUSED explicitly. So let's reuse ServerRefusedError
for it too (it was so far only used when we got a REFUSED DNS answer),
which allows tst_QDnsLookup to handle this as an ignorable failure.

For almost everything else, it sets ETIMEDOUT to indicate "no answer",
which isn't useful. So let's inspect the reply to see if it has
something.

Change-Id: I455fe22ef4ad4b2f9b01fffd17c771ffa4a998be
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f19e9f2521ff7784223ec34fc6794583f4faa2a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-24 02:05:00 +00:00
Thiago Macieira
81d8bf1c54 CBOR: fix the UTF8-and-UTF16 detection
This isn't a bug, it just removes dead code. The code to compare
US-ASCII to UTF-16 was never engaged because this conditional was wrong
and effectively catching everything. Fortunately, because that
comparison code is now wrong with the unit tests added to tst_QCborValue
in the past few commits.

Change-Id: If1bf59ecbe014b569ba1fffd17c4ce184948e646
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit af9f3c5da282a7eff9456b2133a91f06aa1c1a85)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-23 19:03:24 -07:00
Thiago Macieira
8764a0c79d CBOR: fix sorting of UTF16-to-UTF16 strings
This amends commit 394788c68efacdec2676988b4b4ff207b20557f2 (its
ChangeLog applies to this commit too). That fixed sorting of UTF8-to-
UTF16, but when adding more unit tests, I've discovered that some UTF-16
strings also sorted incorrectly. There were two problems:

First, we were assuming that we could rely on the UTF-16 length as a
proxy for the UTF-8 one, but that's not true for some cases:
* both 1-, 2- and 3-codepoint UTF-8 sequences are 1 codepoint
  in UTF-16, so some strings would have identical UTF-16 length
* 4-codepoint UTF-8 sequences shrink to 2-codepoint UTF-16 ones
  (2:1) but 3-codepoint UTF-8 sequences shrink to 1 (3:1), so
  some strings would be longer in UTF-16 but shorter in UTF-8.

Second, QtPrivate::compareStrings performs UTF-16 codepoint comparisons
not Unicode character ones, so surrogate pairs were sorting before
U+E000 to U+FFFF.

To fix all of this, we need to decode the UTF-16 string into UTF-32 and
calculate the length of that in UTF-8 to be sure we have the sorting
order right.

Since this is a slight behavior change with a performance penalty, I am
choosing to backport only to 6.7. The penalty mostly does not apply to
6.8 due to commit 61556627f25e7c7acbfcc5e54127a392b5239977.

Change-Id: If1bf59ecbe014b569ba1fffd17c4c4ddcc874aac
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit d4c7da9a07dc1434692fe08a61ba22c794574c4f)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-23 19:03:23 -07:00
Thiago Macieira
82b2436d4c QMimeData: fix setData on URI list without ending CRLF
Commit 8d127c57376e48dd49afe62cfb8e714d26759a69 refactored this code
from QByteArray::split to manually iterate over the list (and
QStringTokenizer doesn't work for QByteArray), so we missed the last
element in the iteration.

Fixes: QTBUG-124580
Change-Id: I455fe22ef4ad4b2f9b01fffd17c867f6ed350af7
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 038c199d59ff5e9e16fe2a010f3f1f55764cf5ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-23 02:06:23 +00:00
Krzysztof Sommerfeld
2bb4e23cc4 Make use of methods defined in utils unix layer
Some unix-like concepts are supported by VxWorks VSB layer - UTILS_UNIX.
One of such methods is getgrgid(). Include it in
`qfilesystemengine_unix.cpp`, so that we don't need to exclude VxWorks from code that uses it anymore.

Task-number: QTBUG-115777
Change-Id: I72b301647bfdb208cb6859bb0f9994e3537fc345
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 21196d26d84f0f9984308660714921aa17790bc4)
2024-04-22 18:31:20 +00:00
Christian Ehrlicher
15ce2b8b7a QCommonStyle: paint arrows with anti-aliasing
The high-dpi painting fix for the arrow painting was missing
QPainter::AntiAliasing flag so the rectangle had some artifacts with
certain (small) sizes.
Also there is no reason to move the center by 1 pixel to the top left
anymore now that we're using decimal values.
This amends 3936d254ca0e7259cd97238c31df8413d03fd475.

Fixes: QTBUG-124554
Task-number: QTBUG-114539
Change-Id: I8a34d7ed937db261ce652bd66234783fb3338cbb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 74e8f673b827c57ebf2bf802840c19e4a1ac848b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-22 18:27:03 +00:00
Liang Qi
e0ee9cfe31 QGestureManager: use gesture owner target if topLevelAt returns nullptr
For security reason, Wayland doesn't provide global position for
top level windows, so topLevelAt is not supported.

Fixes: QTBUG-113404
Pick-to: 6.5 6.2 5.15
Change-Id: Id60b8b77a1843344db4d4e4c13382ad87adac806
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 10c3dd87d3bc2e84d4f477888622f5fc7ed5d502)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-22 16:56:34 +00:00
Edward Welbourne
b19112dee4 Add benchmarks for QDate::fromString()
These reveal a roughly factor of six slow-down for two valid date
formats and a roughly factor of twelve slow-down for an invalid one.

Pick-to: 6.5 6.2
Task-number: QTBUG-124465
Change-Id: Ibd21e43d4c64aced33ba5b21e4602e0dc4fd7548
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 4467ebc837aded07b0b0cbc3b34ce67f2c0e96f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-22 16:56:32 +00:00
Edward Welbourne
d2473b30c4 Revise UCD-generated data files' SPDX headers
The existing data comes under Unicode-DFS-2016 but future updates
shall come under Unicode-3.0, so update the existing headers with the
former and the generator script with the latter. Leave a note in the
attribution file about this transitional state and how to resolve it.

Replaced UNICODE_LICENSE.txt from src/corelib/text/ with
LICENSES/Unicode-DFS-2016.txt, as fetched using reuse download.
This doesn't look like a rename but only actually adds some irrelevant
lines about where on the Unicode website the upstream files (to which
we do not apply this license) come from and changes some spacing.

Pick-to: 6.5
Fixes: QTBUG-121653
Change-Id: I50c9f4badc77a9aa402af946561aff58ae9e3e7a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit d5e40b5e58c187086d7c23af1860c1af28957ccc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-22 15:22:23 +00:00
Friedemann Kleint
654c36f4ef uic/Python: Recognize more C++ suffixes when determining the custom widget module
Also check for .H, .hh, .hpp.

Task-number: PYSIDE-2648
Change-Id: I993647e2b55e3b76d714a9d3a4b539c2d5874f04
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit bd231cc051d6246f572af23d953c27a95e0846a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-22 14:49:05 +00:00
Marius Kittler
04fe9d0617 Avoid crash with Windows 11 style when no widget passed
The documentation of `QStyle::drawControl()` states that
"The widget argument is optional" so it must not be used
unconditionally.

Change-Id: I8b5a8ed421c0ae2c667925e448c9a029b6deedfd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 30061e8960eb9d8abb8a98270e3e92beef60d7d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-22 14:49:04 +00:00
Morten Sørvig
8baa2b73a4 Update the cached DPR on QWindow update request
Follow-up from commit 299dfe which added a similar update
for expose events. This fixes missing DPR updates for
exposed windows.

Pick-to: 6.6
Change-Id: Ic1a9a41bd979270b97303abb71f1230bff001d19
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 041ca2a3a818955ebcbbc0acd164138ffd561a6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-22 14:49:02 +00:00
Lucie Gérard
957dd4e145 Add license exception
Task-number: QTBUG-121039
Change-Id: I84049920fa38af48a54714d9cd0a8cb940deb066
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 47d8c87b759c6f7b6e34bf86c923146c3d4a10d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-22 14:01:15 +00:00
Lucie Gérard
1c8bf0dcbf Fix real dot in location keys regular expression
Location keys are meant to be used as regular expression.
The . need to be appear as `\.` in the regular expression.
The JSON parser interprets the `\`, hence the `\\.`.

Task-number: QTBUG-121039
Change-Id: Ie3b8fb9686d59db13e5522309adbf3877bd2a3f7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit eb87f7bcb98afccde315a10c5e26dc3485f5d92f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-22 14:01:14 +00:00
Mårten Nordheim
8c2518bee8 Http2: fix handling unsuppported authenticate challenge
When adding/fixing parts earlier it was missed that it was not handling
the _unsupported_ case, when authentication is not handled and there is
no resend. But there _is_ a challenge header.

Pick-to: 6.5
Fixes: QTBUG-123891
Change-Id: I21470df0ce2528bad3babffc6e9f19b7afd29d20
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 4f9387f2aee19e38f05cab76a71f0d067b8d80dd)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-04-21 15:40:28 +00:00
Thiago Macieira
5be8cf4e9a QString: ensure multi-arg arg() parses replacement like single-arg arg()
There was a discrepancy that the multi-arg arg() overload would accept
any number of digits in the placeholder, resolving up to value 999
(e.g., %000001 was interpreted as placeholder #1), but the single-arg
arg() overload only supported exactly one or two digits. The single-arg
behavior was documented, so use it.

[ChangeLog][Important Behavior Changes] The QString::arg() overload
taking multiple QString-like arguments is now fixed to interpret
placeholders like the other arg() overloads: it will find at most two
digits after the '%' character. That is, the sequence "%123" is now
interpreted as placeholder #12 followed by character '3' (verbatim).

Fixes: QTBUG-118581
Change-Id: I455fe22ef4ad4b2f9b01fffd17c767a948d41138
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit f0f2a9ef2600288b16b69c135389dfe1fea89a8d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-21 13:48:20 +00:00
Edward Welbourne
a4b8399957 Fix duplicate data tag tst_QDate::fromStringFormat:year-match-1999
There were two of it. The "year-match-*" tests have two year fields,
one four-digit the other two-digit, and deal with whether they match.
The second year-match-1999 had, however, only a "yy" year format; it
in fact belongs to the "just-yy-*" family that follows. So rename it.
Amends commit 5108192f67042656afdb3508f8cc2563167fae97 which landed in
6.7.

Task-number: QTBUG-107185
Change-Id: Ibfe0c33cb00dc068d0f670d27c43ec4dc4550c05
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit de5c507a55097c08602f38062bf5291c9cbb4e24)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-20 14:56:38 +00:00
Edward Welbourne
ed98ffb75c More consistent handling of feature timezone
Follow-up to commit ae6186c7e8cfdb9420b9119f5affbba7d069598d
* require the feature in headers that should only be seen when it's
  enabled,
* expose the auto-test to being run even when the feature is disabled
  (the parts of that depend on the feature have needed #if-ery) and
* fix the Darwin-specific test's misguided #if-ery.

Pick-to: 6.5
Task-number: QTBUG-108199
Change-Id: I398cf44c33ffdcb4bb04f54a9d8ccfef68741e4e
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 98581c54fe729f8d30341ebbc0576ad5430df268)
2024-04-20 16:56:31 +02:00
Volker Hilsheimer
e08da35502 Fix documentation of QAndroidApplication::context
As of Qt 6.7 we no longer return jobjects from that API. The declared
QJniType::Context type (and similar types) is no longer jobject-like,
they are now QJniObject-like.

Task-number: QTBUG-123900
Change-Id: I215f84ac37907ae2b7950c40c7287590234e4e35
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 7d9cedec6aca825ea9b2280c4e3f3e30a0b51ccd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-20 06:13:33 +00:00
Thiago Macieira
d24b0c05a4 QProcess: fix startCommand() with whitespace-only strings
We'd end up trying to takeFirst() from an empty QStringList.

[ChangeLog][QtCore][QProcess] Fixed a bug that would cause
startCommand() to crash if passed a string that was empty or contained
only whitespace characters.

Fixes: QTBUG-124512
Pick-to: 6.6 6.5
Change-Id: I455fe22ef4ad4b2f9b01fffd17c7689095c39272
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 60bdf2b220151021e59baa372a050b9f72400b81)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-20 03:24:52 +00:00
Thiago Macieira
bdb713b1b7 QXmlStreamWriter: fix attempts to write bad QStrings
We weren't doing the decoding from UTF-16 to UTF-32, so weren't catching
invalid code sequences

[ChangeLog][QtCore][QXmlStreamWriter] The class now rejects writing
UTF-8 and UTF-16 invalid input (improper code unit sequences).

Task-number: QTBUG-122241
Pick-to: 6.6 6.5
Change-Id: I83dda2d36c904517b3c0fffd17b42d17c637fdc4
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit c25541e9ac4c7021c69c600906e5ca8c80f18401)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 19:11:44 +00:00
Thiago Macieira
6bef40cb82 QXmlStreamWriter: decode UTF-8 into code points
We were iterating over code *units* and that yielded wrong results. The
one from the bug report was simply caused by the fact that
QUtf8StringView::value_type is char, which is signed on x86, so the
expression:
  *it <= u'\x1F'
was true for all non-Latin1 content.

But in attempting to fix this, I needed to do the proper UTF-8 decoding,
as otherwise we wouldn't catch non-Latin1 sequences and such.

[ChangeLog][QtCore][QXmlStreamWriter] Fixed a bug that caused the class
to fail to write UTF-8 strings with non-US-ASCII content when passed as
a QUtf8StringView.

Fixes: QTBUG-122241
Pick-to: 6.6 6.5
Change-Id: I83dda2d36c904517b3c0fffd17b42bbf09a493d0
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 94c62e322264e2e7d61193ae74ba8556a330385c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 19:11:44 +00:00
Thiago Macieira
5d1b211aba QStringConverter/Doc: add more details about additional codecs
Fixes: QTBUG-124221
Change-Id: If1bf59ecbe014b569ba1fffd17c4d113d02425eb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 71e87993d6bb9c3bf61883d66f97a5e0cfa2bfb1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 19:11:43 +00:00
Thiago Macieira
ced930156c QStringBuilder: DRY: use the Concatenable typedef
Instead of repeating the full template expansion.

Task-number: QTBUG-124117
Change-Id: I40526efc4e93413794c3fffd17c4f9e200733660
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 11f242174b5b53a7052e9d6edc7b75aa8f8d91c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 19:11:43 +00:00
Thiago Macieira
5edb9a6a0f QStringBuilder: DRY: simplify the if constexpr conditionals a bit
Both sides of it were calling the same appendTo(), so we can avoid
repeating ourselves. This MAY fix a warning with VS2019.

Fixes: QTBUG-124117
Change-Id: I40526efc4e93413794c3fffd17c4f9c96ee187f9
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 2e8c6d467fa245e8bcb81cff63d2d9628e1ee81e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 19:11:43 +00:00
Edward Welbourne
249b8ff3ff Move LocaleScanner's INHERIT check from find upstream to __find
When digesting CLDR v44.1's github form, some data (e.g. pt_BR's
language endonym) were None that had perfectly sensible values in the
zip-file form.  Letting __find() yield INHERIT entries lead to find()
sometimes returning None, where __find() should have tried harder or
raised an Error.

This further amends commit bcdd51cfae24731a73d008add23d3c1e85bbd8d0
(after commit 0f770b0b34bcb5fa0a598b2ff76fe215fbc25f5c isolated its
magic value).

Pick-to: 6.5
Task-number: QTBUG-115158
Change-Id: I1af92a687cd50b8fd026c25f068c804a3516ef95
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 43cb4136a92331d1137ddd7453e7bb4ca130ecff)
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2024-04-19 18:23:51 +02:00
Edward Welbourne
a7338bd830 ldml.LocaleScanner.__find(): only Error if no matches found
The existing caller returns early on finding a match, so never ran off
the end of the iteration unless there were no matches. I'll soon be
adding a new caller that wants to iterate all matches, so will run off
the end even when there are some. So only raise the Error if we found
nothing.

Pick-to: 6.5
Task-number: QTBUG-115158
Change-Id: I1cae4674eb5e83c433554c15ecc4441b756f20eb
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit c8b70f4e511e26c73a9da453f4c2b5624e66a2c1)
2024-04-19 18:23:51 +02:00
Edward Welbourne
af4bccb562 Move special-case LDML value to a module global
Giving it a symbolic name is clearer (and saves me the need to
duplicate the comment when I add some more references to it).
This amends commit bcdd51cfae24731a73d008add23d3c1e85bbd8d0

Pick-to: 6.5
Task-number: QTBUG-115158
Change-Id: I7577e0cde783fcda840009c7aea46934964c6e4c
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit 0f770b0b34bcb5fa0a598b2ff76fe215fbc25f5c)
2024-04-19 16:23:50 +00:00
Tor Arne Vestbø
4d5aedac1d QWindow: Persist foreign winId to support destroy/create cycles
We used to set a private _q_foreignWinId property on QWindow when
creating foreign windows, and this was the mechanism which we then
passed the foreign winId to the platform plugin.

With c585802e946d97e7d177ea334a162dc7bc286b84 this was removed,
since we now were passing the winId through via explicit QPA
APIs, and since 0c6911e5cde24c45d6f2c08b6e71064bdd1eccfa removed
the ability to explicitly destroy() a foreign window.

But when closing a QWindow, we destroy both the window itself,
and all its children, including foreign windows. In this case
we still want to support recreating the foreign window, for
example when the parent window is shown again. To enable this
we restore the _q_foreignWinId private property, but keep
the limitation of not being able to explicitly destroy a
foreign window.

Pick-to: 6.5
Fixes: QTBUG-124160
Change-Id: Ia885ba9f043e64fb21eedd2b4c344679726f1b5c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 988039729f55a5e62e32b82c6f29ff7457e91d9d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 13:46:49 +00:00
Fabian Kosmale
7c4e1357e4 QStringConverterICU: Pass correct pointer to callback
Pass the pointer to the current state, not a pointer to a pointer to it.

[ChangeLog][QtCore][QStringConverter] Fixed a bug involving moved
QStringEncoder/QStringDecoder objects accessing invalid state.

Amends 122270d6bea164e6df4357f4d4d77aacfa430470.

Done-with: Marc Mutz <marc.mutz@qt.io>
Pick-to: 6.5
Change-Id: I70d4dc00e3e0db6cad964579662bcf6d185a4c34
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 39bbfce9b675c9085ef49c9b9c52c146eca55e4a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 13:46:49 +00:00
MohammadHossein Qanbari
869e46613d Convert "Color Editor Factory" Example to snippets
The color editor factory example is removed and part of the codes are
used as snippets.

Fixes: QTBUG-119985
Pick-to: 6.6
Change-Id: I421e473e7db09a5af7543b80b87a338d8ff2ab7e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4e1a1f3697563124588d7d00089b15084220ca42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 13:46:49 +00:00
Edward Welbourne
23b69855c0 Fix end-of-parse fixup of two-digit year in QDateTimeParser
When a date string contains day of the week, day of the month, month
and two-digit year, it was still possible to get a conflicting result
in the default century instead of a consistent result in the next (in
fact present) century.

The actual logic needed to get the right year has to take into account
all date fields. This is all worked out already in actualDate(), so
delegate to it instead of trying to make do with just the year info.

Pick-to: 6.6 6.5
Fixes: QTBUG-123579
Change-Id: Id057128d8a0af9f3a7708d0ee173f854bb1a2a8e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit 3e426182e2e8122d96b208702faaf3177f3a3081)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 13:46:49 +00:00
Volker Hilsheimer
c7b7d4e23f Replace expensive inherits with cheaper qobject_cast (2)
In the Windows 11 style, it's better to include the headers for specific
widget types at the expense of compile time, than to pay a regular
runtime cost from using expensive inherits().

Add const, fix style, and break excessively long lines related to this
change.

Change-Id: I2c8c6d98267d9ff3542decda71e08e462cf9807c
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
(cherry picked from commit 96fcb4ef84bb7486221f04e53be8ee7218385178)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 13:46:49 +00:00
Jan Grulich
3aa05a9481 QXdgDesktopPortalTheme: watch for color scheme changes on runtime
Subscribe to SettingChanged signal from xdg-desktop-portal to get info
when color scheme changes and update it on runtime.

Fixes: QTBUG-116197
Pick-to: 6.6
Change-Id: I7803ea76bc1ac0749d60ee55c1c0d9051dad210a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit a833d5682ac44571e13568336f2bd3ec7deb1d6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 13:46:48 +00:00
Shawn Rutledge
2d7972e059 Draw list bullets/numbers with CSS text color, not palette color
When CSS has been used to customize the text color, render the bullet
with the same color. This is consistent with web browsers, and with
Qt Quick rendering.

In QTextDocumentLayoutPrivate::drawListItem(), the pen color is the
text color, so use it instead of brush color.

Add a baseline test for lancelot: the background and general text
are customized, then some list items are customized further, and
some of them have colored text spans. Repeat with different styles
of numbered and bullet lists and checklists.

Fixes: QTBUG-2188
Task-number: QTBUG-213
Task-number: QTBUG-57833
Pick-to: 6.5
Change-Id: I71e84d00172e4b37aef57c8badd2ec43c10113d9
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
(cherry picked from commit 7f48c79627663f0777df9c10d06202aea5bedac3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 13:46:48 +00:00
Tor Arne Vestbø
ed27756274 rhiwindow: Set DPR on image texture to ensure DPR-agnostic drawing
Otherwise the 20x20 margins will produce different layouts depending
on the DPR, which is not what we want.

Change-Id: I4153d0843ef51c8e0f60d7d5166b153d45201c95
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit a78938e0f686263540e06d923f2949169f3219e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 10:57:57 +00:00
Tor Arne Vestbø
edc004ae7f cmake: Add opt-out for adding -no_warn_duplicate_libraries linker flag
The classic linker (triggered via -ld_classic) doesn't support this flag,
and we can't construct a genex that takes this into account, so add an
opt-out for Qt WebEngine.

Change-Id: I62418e0ff37fe8f5bdda2fa8d01b36a8fd44542a
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit b74369c03325e49132dc77f2a83af8fd25c81a8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 10:57:45 +00:00
Shawn Rutledge
e81212e01a Fix lance readme: tests/auto/other/lancelot is gone now
Amends e8f93e38debf4f46dbda4de198b9dd475df42d5c

Pick-to: 6.5 6.2
Change-Id: Icca7562e4773ed6caa542a99c2d45a5b06968b7e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 8d84f7643bb80902ea4fedb2686557b58be2b221)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-19 03:40:19 +00:00
Allan Sandfeld Jensen
d8dbe0f352 Copy image offset in copyMetadata
Making it be carried more consistently.

Change-Id: I8d2da1264a59febbd44bbcff798b647ec2813bb0
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 2d2fae48637d0aaa77cdd7dd413c40efec27a8a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 19:11:21 +00:00
Christian Ehrlicher
acff474a2b QStyleSheetStyle: Don't try to load a pixmap with an empty filename
QStyleSheetStyle::loadPixmap() might be called with an empty filename
but then it should not try to load a file with an empty filename.

Pick-to: 6.5
Fixes: QTBUG-123839
Change-Id: Ie01e9f75f025650b0802736bb589ebdc48e93696
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b773a4f5836b39e363899ad48a9f469e7f18db1a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 19:11:21 +00:00
MohammadHossein Qanbari
c226f2a3a0 Convert Group Box Example to snippets and screenshots
Remove the Group Box Example from the repository, eliminating the
associated example codes, screenshot, and documentation file. The
only relevant portion used in the QGroupBox class has been relocated
to the existing snippet file. Additionally, all references to this
example across other files have been removed.

Fixes: QTBUG-119980
Pick-to: 6.6
Change-Id: I66f9dd9dab1fe64f2d20424af3acd135201827d2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f371f8a64dc76ec9ff07b666577b7ab47b69751d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 19:11:21 +00:00
Marc Mutz
8d4d0cfaf4 HttpTestServer: pass std::function by value and move into place
Virtually all callers of this function (will) pass rvalues, so take
the std::function by value (reaping C++17 guaranteed copy elision) and
std::move() into the member variable ("perfect sink").

Like for many owning types, moves are much cheaper than copies for
std::function, because the external state is merely tranferred between
objects, and not copied.

Amends e560adef213301318dcc13d4db155624846e0420.

Change-Id: I269b54e51ba09ac595ac4e4f255209778819adad
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit a56461883830cecf281b1d6db5e7d6103154d3d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 19:11:21 +00:00
Marc Mutz
963e886c6f tst_QRestAccessManager: fix signature of server handlers
HttpTestServer::Handler is declared to take the first argument by
reference to const, not by value, so use the same parameter passing
for the lambdas passed to setHandler().

Avoids copying the (rather large) argument when invoked through the
std::function wrapper, and silences clazy-function-args-by-ref.

Change-Id: I726d0b98a7fcb3b1b33c5bde203035f593c39bdd
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5b6c6dab632a32a09963453b08731e9e33334e9a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 19:11:20 +00:00
Marc Mutz
2581730d88 tst_QRestAccessManager: leak less on failure
Move some deleteLater() calls to before the first QCOMPARE/QVERIFY
macros, so they get executed even if the macros return on failure.

This isn't an all-encompassing solution, but I lack the time to port
all this to smart pointers, and this is some improvement.

As a drive-by, port QVERIFY(opt.has_value()) to QCOMPARE(opt, nullopt).

Task-number: QTBUG-120307
Change-Id: Ia5a2cabd273a779938b22badc91b109fcc545203
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit d4aaf61b3333b48b4e79ad60b63bb50dbea72617)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 19:11:20 +00:00
Volker Hilsheimer
eed30ff352 Replace expensive inherits with cheaper qobject_cast (1)
The accessibility implementations require the type to be fully
defined anyway in order to call type-specific APIs, so there's no
need to use inherits(). Use qobject_cast instead.

Change-Id: I5c013be57f48272a748451f4888911fe6aa6574e
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 3973d6c529605fbce8457d7663d244ebadbe7160)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 19:11:20 +00:00
Marc Mutz
dca3837201 qrestreply_p.h: include what you need
QStringDecoder within std::optional needs QStringDecoder to be fully
defined ("in-size" (Lakos)).

QByteArray, used as a function parameter, can be forward-declard,
though ("in-name-only" (Lakos)).

This also makes the header comply with Qt's private symbol versioning,
which requires every private header to include some other private
header, or, eventually, qglobal_p.h.

Amends 4da14a67a6157c415f8228a8bae7d6b0f895df7c.

Change-Id: I35fed05955f1194299162b576834c1045672bcac
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 96f78cbdd9412e6043bb4eb0d0dd818c5d800151)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 19:11:20 +00:00
Santhosh Kumar
732962d604 Support rendering CSS 'border' property for html table
We supported CSS 'border-width', 'border-style' and 'border-color'
for HTML tables since 8a9bec35fb0c60a0e5990c1a12ffe6f39fdbf2d.
Now we also support the 'border' property, which is shorthand to
set all four borders' width, style and color.

Fixes: QTBUG-123167
Pick-to: 6.6
Change-Id: I5f29b94ab9facf412a9c230d554efb5c69368b6b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 26e75d452eeb2762fa3ece1c63e94d01587c6260)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 19:11:20 +00:00
Eirik Aavitsland
f02ccd86c7 Avoid overflows in gradient calculations
Avoid the optimized fixed-point function for vertical gradients if the
parameters are out of range for that. Fall back to the general
gradient function in that case.

Fixes: QTBUG-120331
Pick-to: 6.5 6.2
Change-Id: Idf116f0077403531d9ea414e3043fdc92b6fe4a9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ade33a91442f8085a7ddeb8e6fdf33463103b119)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 19:11:20 +00:00
Ahmed El Khazari
d77e099200 Android: Fix crash when selecting text on a TextField
The crash is due to absence of the helper class that manages the
selection in QtInputDelegate.
As a fix, updateInputDelegate() is introduced when setView(), where the
instantiation and clearance of EditPopupMenu is made. On the other hand,
the nullity of EditPopupMenu in QTEmbeddedDelegate is handled.

Fixes: QTBUG-122740
Change-Id: Iac5cded7be7530dde8c739265fc9402670714d39
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit a87764789feaa0575b9f4f0957bb7ec3e3b9a4d1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 19:11:19 +00:00
Lorn Potter
5f7324b20e wasm: fix linux touchscreen keyboard input
Fixes: QTBUG-124366
Change-Id: I9bd83ecb75b94efbf12b13055e292a74e6e9edcd
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit d374dd6f84c74e6e0adf441f19af31a31074f7ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 19:11:19 +00:00
Piotr Wierciński
d40f29353e wasm: Abort network request on destruction of QNetworkReply
Deleting QNetworkReply is a common way to cancel pending request.
Wasm implementation was not treating it properly.

Task-number: QTBUG-124111
Change-Id: I46d8624e323fca0932411c575922415d9f9d7986
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 655b98482e8339b287fb040fd25013dc1232a43d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 19:11:19 +00:00
Volker Hilsheimer
5519bf0cf9 Baseline tests: improve focus setting and clearing
Set focus on the test window so that the tested widget doesn't have it.
Remove the "PublicWidget" hack, we have public QWidget APIs to find the
next widget in the focus chain that we can use to transfer focus
reliably. Use TabFocusReason to maintain existing behavior, and to
test that widgets that handle that specifically appear correctly. Clear
the focus on the test widget by setting it back to the window after
taking the "focused" snapshot.

Add QCOMPARE and QVERIFY to assert that the test is in the right state
before taking screenshots.

Change-Id: Icef6ce1bb1c63c9f6cde7d0ddca82e693cace420
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit bf2ed624091d0239bce91a84df59b7afc843298a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 19:11:19 +00:00
Marc Mutz
76807bdfb7 androiddeplyqt: fix more missing pclose() on early returns
Found by Coverity.

This code predates the move of androiddeployqt to qtbase.

Pick-to: 6.6 6.5 6.2 5.15
Coverity-Id: 378442
Change-Id: Icc24918159132c55a3817eaf19c96ea212dfa6dc
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
(cherry picked from commit db240d99cffbc3af2eb39a5f7d48e68e57b85271)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 15:55:31 +00:00
Marc Mutz
950123bfbc androiddeplyqt: fix missing pclose() on early return
Found by Coverity.

Amends 5bb178c479a247720fbc3fbb7f06a32b725193ac.

Pick-to: 6.6 6.5 6.2 5.15
Coverity-Id: 378357
Change-Id: I8839280ce15d8e7d9e1f4024ca796c2d8b4ed930
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
(cherry picked from commit c64b30129d7c6c7f99b6abc3f42d32fb61e27f76)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 15:55:26 +00:00
Marc Mutz
5b3143fce6 QEglFSKmsGbmScreen::framebufferForBufferObject: release() at the correct time
It's the gbm_bo_get_user_data() function that takes ownership of the
FrameBuffer object, not the caller of the function, so release() into
gbm_bo_set_user_data() not into the return. This threw Coverity off,
which complained about a leak of the return value in the caller.

Amends 2f0fa59d5903d4c9596ed42dcbaa9da0f77c78da, but not picking
through all the refactorings the code has since seen.

Pick-to: 6.6 6.5
Coverity-Id: 444117
Change-Id: I5f058e4a42942349193eecfd8c00ec9499ef4886
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1cfe42235c4496f68195385507dbaa553d04aee5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-18 15:55:23 +00:00
Thiago Macieira
f84f752864 CBOR: Remove dead code: len[12] are not used with UTF-16
The lengths are only needed to check if one of the two strings is empty
and in the direct 8-bit comparisons with memcmp(). So we don't need this
division by 2, which was here since the initial commit.

Amends d4c7da9a07dc1434692fe08a61ba22c794574c4f.

Change-Id: Ie28eadac333c4bcd8c08fffd17c5ecbce564ccd1
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit a7b9ec7f6f465ce0d90edfe7154a4837b1fb9c00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 21:08:58 +00:00
Tor Arne Vestbø
3e3bfcc731 QWidget: Remove un-needed nullptr check for oldtlw
Added in 1bd755465efa27294362925f55306f88f1800936

We already access oldtlw and oldtlw->d_func() in other places,
and the source of oldtlw is a call to QWidget::window(),
which returns the widget itself if it doesn't have a parent.

This should also fix a CodeChecker issue where it thinks
that the other unchecked accesses to oldtlw are suspicious.

Add assert just in case, so we catch it explicitly if for
some reason this assumption doesn't hold in the future.

Pick-to: 6.5
Change-Id: Iefa9b2df6b25a993afe87e4ee90fe9d2075ebbd0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 0533d1d5444c204c029ab8fbc2df1fb9f9fd6ec2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 21:08:58 +00:00
Edward Welbourne
ab712f226d Revise CLDR-generated data header files to use Unicode-3.0 for SPDX
This is the correct license for the data they contain. The types that
are used to package them can be made available under the same.

Pick-to: 6.5
Task-number: QTBUG-121653
Change-Id: I7fb5f332f9e7f4f6db0f1f0c3964a36ce03bccb2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 880d1aef99a6826c8dd690b13e1ca6ea5574f403)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 21:08:58 +00:00
Mårten Nordheim
acdef87d1c QSaveFile[win]: only use SetFileInformationByHandle when opened with DELETE
SetFileInformationByHandle only works when we have opened the file with
DELETE access. Since the code is shared with QTemporaryFile it is not
necessarily always a given. Since it was anyway falling back to the old
way of doing it it was not a problem, but it is cleaner to only use it
when we know it will work.

Change-Id: I3c744734d45272c41e49bb6971adf4f82213d97d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b26ec1f5dde6ee77fbf6b96d3ec54cf93d18197e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 21:08:58 +00:00
Mårten Nordheim
c52120b7fb QSslConfiguration: add documentation for HTTP/2 alpn variable
It was missing for a long time

Pick-to: 6.5
Change-Id: I209838a3c7b45c8c2e8da21efea306fafddea891
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit fad8d7126260b30bd9437f2e19b5460dcf14b46a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 21:08:58 +00:00
Ahmad Samir
3f0bc3c52a QCompilerDetection: move qsystemdetection.h to inside the include guard
Pick-to: 6.6
Task-number: QTBUG-124120
Change-Id: Ia3ca4392945a793289fb9c75f50fba1bca1c691c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 785a4a7149f08fb32107e478588aeab6666d2a29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 21:08:58 +00:00
Mårten Nordheim
d3ed6f02bb QSaveFile[win]: remove const from nativeRenameOverwrite
I accidentally copied const from another signature.
It's not changing any members so it's technically fine,
but it leaves a bad feeling and we will change members soon.

Change-Id: Ib0236d7e7dda84834ba35907d75c52cf77fb3843
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 171ac8aa4ef107a7c06163aaeba9a37abffccb09)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 21:08:57 +00:00
Milla Pohjanheimo
4931ee6e00 Add binary compatibility file for 6.7.0
Binary compatibility file added.

Task-number: QTBUG-123281
Change-Id: I9fa0f828edc810d1523eb75e242590253c7d7d35
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
(cherry picked from commit 067e3ec1bf3f18a1ca79f7241241d3cf021c3715)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 18:01:51 +00:00
Christian Ehrlicher
67372f31ae Doc: don't use deprecated function in QMenu snippets
QMouseEvent::globalPos() is deprecated - replace it with
QMouseEvent::globalPosition().toPoint()

Pick-to: 6.6 6.5
Fixes: QTBUG-124343
Change-Id: I6f862a9a640da11d756dae58ffae8c6d7fc24e02
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
(cherry picked from commit 001d88ae38435a2d108178c5d396839986985bc4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 18:01:51 +00:00
Christian Ehrlicher
74563f95ae SQLite: Update SQLite to v3.45.3
[ChangeLog][Third-Party Code] Updated SQLite to v3.45.3

Pick-to: 6.5 6.2 5.15
Change-Id: I8a58699f10cada8b33d47c3032861fa6ef1b6cc9
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit b6624877c61e8eef45956d62ee9229dc52ffa89a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 18:01:50 +00:00
Volker Hilsheimer
a4b55f66c9 Baseline testing: use a full screen background behind the test window
Some tests are flaky on macOS because the background desktop shows
through the rounded corner of the test window. We cannot reliably
control this on each platform, so instead make the test window a
secondary window with a second, fullscreen and frameless window as the
transient parent. This way, we have full control over the background
pixels that might show through (semi-)transparent parts of the test
window.

Change-Id: I44b7e834797b46fa8b44d776f6b91c99536a6cc9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a623293a13c9a0c80ae4a5111b92f00ba70d1edf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 18:01:50 +00:00
Even Oscar Andersen
5869e4b024 :wasm Fix not possible to type tab character in TextEdit
qinputcontrol refused to accept the character since
text part of key was empty

This caused the tabkey to always switch focus instead

Fixes: QTBUG-124232
Change-Id: I9ea7f02831cc88479b4e15d25eac278547f6f711
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit e794894ece0bcfc78fa4155cb01d825791ea102b)
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2024-04-17 18:01:50 +00:00
Volker Hilsheimer
980cd76e65 QTableView: fix infinite loop when resizing rows/columns on model reset
When a slot is connected to the modelReset signal before the model is
set on the view, then such a slot might try to resize the columns or
rows to fit the contents before the view had a chance to perform layout
work.

In that case, the while-loop that calculated the size hint of a rows
(or column) by checking the size hint of each cell might not exit, as
cached information about visual indexes would be invalid.

To prevent this, don't loop over the cells if the actual last row/column
of the model (after the reset) is less than the first (cached) visible
row/column. Also, make sure we increase the counter for number of
rows/columns processed with each iteration.

Add a test (that loops infinitely without the fix, resulting in the
test being killed by the framework), and make the 'actual' variables
constant for clarity.

Fixes: QTBUG-124301
Change-Id: I0adb2f1e8a1e78760ef7c19e9686c9572eca8be6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 960867566a75931c338f67cfe429c0756f41ad89)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 18:01:50 +00:00
Fabian Kosmale
1a1b1669fa moc: Treat number + characters as Identifier, not Number
While <DIGIT>+<Character> is not a valid identifier by itself in the C++
language, it might become one when using it with the token pasting
operator.

This risks confusing some number literals with suffix as Identifiers,
but those are currently not supported anyway, so this shouldn't break
anything that is currently working.

Fixes: QTBUG-87219
Fixes: QTBUG-124288
Change-Id: If73255cc0e6649bc90c52b1d177aac8ff975ae69
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 62d02c1d509780eca7d3a4c35ac64a0d475d0fe7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 18:01:50 +00:00
Laszlo Agocs
4553b20f58 Correct the internal signatures in the GL 4.5 func wrappers
There are 9 functions in the 4.5 API that were initially specified
to use GLsizei, but later "magically" became GLsizeiptr (i.e.
64-bit or 32-bit depending on the arch).

The current gl.xml, unlike old ones, uses GLsizeiptr, as do the
extension headers and most of the online docs, except some that of the
reference pages are stuck with GLsizei.

Assuming that today's OpenGL implementations expect GLsizeiptr, fix
the the internal signatures, so that calling into the GL implementation
is done using the correct argument sizes.

In addition, add GLsizeiptr signatures in the public API guarded with
>= QT_VERSION(7, 0, 0).

Pick-to: 6.6 6.5
Fixes: QTBUG-67807
Change-Id: Ifc7e97b0479a186000a56709c37ba7f77b6f1ff2
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
(cherry picked from commit 7aaa6a60448f5be05373367abaa37a1fa56ab5c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 12:15:42 +00:00
Samuli Piippo
b70745bc8b Revert "Always destroy OpenGL context when the window is destroyed"
This reverts commit 220afb358f6056a6fc091b48a38878fb98aba979.

The change caused segfault after menus or dialogs were closed.
The global raster compositing context is still being used by root
window and cannot be deleted from child window.

Fixes: QTBUG-123962
Change-Id: Ie88925052f0f424617382388c587ae47570d13a7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit a030795bc956ce4274e3562e963d59e74f2e6fd7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 05:42:04 +00:00
Thiago Macieira
f88091c190 tst_QVariant: fix stringification of char16_t and char32_t
QVariant::toUInt() cannot convert from those two, so we always ended up
with 0, producing lots of duplicated test rows.

Fixes: QTBUG-124349
Change-Id: Ie28eadac333c4bcd8c08fffd17c5a3e39a2cc3f6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 8381a4b44fbd9528035af5e6d7458a2d5b9b7e7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 00:50:13 +00:00
Thiago Macieira
29213f2546 tst_QVariant: remove duplicate rows from compareNumerics
Task-number: QTBUG-124349
Change-Id: Ie28eadac333c4bcd8c08fffd17c5a3d824fe76ec
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 848451095bb81647c750417f156888778f8bd988)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 00:50:12 +00:00
Thiago Macieira
4e7f906b03 tst_QVariant: fix copy & paste error in double-float comparisons
We wanted to test the (min,max) of each of the two types, but one of the
four combinations wasn't correctly done.

Task-number: QTBUG-124349
Change-Id: Ie28eadac333c4bcd8c08fffd17c5a3ccb4205139
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit d204ea98730baeeb55d2da229f2ce743df8c583e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-17 00:50:11 +00:00
Ivan Solovev
c5759c962d Skip tst_qcomparehelpers_cpp23 on Linux arm
Because it causes issues in the CI
As a drive-by, also backport the NOT VXWORKS check.

Change-Id: I8cd232abf1c4ee1d9417a8bff9aa3bcf5f893e8f
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4f6600ee6554f04ac5dac0e547488432c13630a6)
2024-04-16 20:41:55 +00:00
Volker Hilsheimer
771cfca2ab Android: don't call JNI_OnLoad for libraries opened with QLibrary
JNI_OnLoad gets called automatically by the JVM when it loads a shared
library. A native library that is loaded by native code shouldn't have
it's JNI_OnLoad entry point function called, as that would indicate
that the plugin is loaded by the JVM, which it is not.

If framework or application code requires that function to be called
(and wants to perform error handling, such as closing the library again
if the function returns JNI_ERR), then that can and should be done
explicitly.

[ChangeLog][Android][QLibrary] Loading a shared library with QLibrary
no longer implicily calls a JNI_OnLoad implementation.

Fixes: QTBUG-92007
Change-Id: I9aa71ec73b950029e0ae1be7d54e1c8576f356ab
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 359df32300f5472f2fddbc83c3fe0851b5547ff6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-16 20:41:45 +00:00
Joerg Bornemann
169f53535a Revert "CMake: Fix *-metatypes.json creation, take III"
This reverts commit 654f3c5634ac9efc2257177351c8dea7c8d8875a.

That commit enabled a work-around for CMake upstream issue #19005 for
Visual Studio project generators. It turns out that this is not actually
needed, and that the work-around causes unnecessary rebuilds.

Fixes: QTBUG-121046
Pick-to: 6.6 6.5
Change-Id: Ie502e2df999a204ab09d28322017be3c7ed8ebc5
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit aeaaff1d5c3e3246d9cbf02499f1b952e9af8450)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-16 19:28:57 +00:00
Vladimir Belyavsky
363878499c QTextLayout: keep strong reference on font engine in a layout loop
This is speculative fix for the crashes in QTextLine::layout_helper()
we're observing on users side.

The possible reason is in that fontEngine and previousGlyphFontEngine,
which are stored in LBH, became invalid during the layout cycle
(destroyed by trimming font cache?).

To prevent this we need to handle font engine's ref-counter
gracefully, so just wrap them into QExplicitlySharedDataPointer.

As a drive-by change, use in-class initialization for LBH members.

Task-number: QTBUG-117500
Pick-to: 6.5 6.2 5.15
Change-Id: I6987a2b5618bb4ba8762f2ef01b4ce0dd60cb232
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit d914c58c7ee07f0d7598cee3491b815bd8d8bc23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-16 19:28:56 +00:00
Tim Blechmann
2955a25f01 CMake: qt_internal_add_test - fix BLACKLIST file handling
Not all tests have targets that we can attach the BLACKLIST files to.

Change-Id: Ie0a2d72859877a8803802a4f7dc996944f002656
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit edc2d414562ece8b139b1cd1fcf77df245d0573f)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-04-16 08:49:01 +08:00
Tim Blechmann
b686cae50c CMake: qt_internal_add_test - add BLACKLIST files to IDE projects
Tests can be blacklisted via BLACKLIST files. This patch adds these
files to the generated IDE projects automatically when available.

Change-Id: Icef2c397ada823e7b1c380dbb224694f059891ff
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 191dbbdea7151ca7177174f2de74b8279a7b12d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-16 00:48:56 +00:00
Jaishree Vyas
29a7560041 Doc: Qt Data Types Documentation
Updated the list

Fixes: QTBUG-73386
Pick-to: 6.6
Change-Id: If913a26d32a39c71fb7fba815bdafa924da69457
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit a3fae5faa01f9591f445890b63b9db3a6a2a71b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-14 10:08:22 +00:00
Eskil Abrahamsen Blomfeldt
b62b6094dd Implement aliased text rendering with DirectWrite
This creates aliased glyphs using the DirectWrite engine when
requested.

Note: There was previously a fallback to GDI to support aliased
text, which ignored the hinting settings. This patch also removes
that fallback.

[ChangeLog][Windows] Support QFont::NoAntialias with the DirectWrite
font engine.

Pick-to: 6.6 6.5
Fixes: QTBUG-97645
Change-Id: I587f56ace468cfdd57debe7bc8492a96587a4e05
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 421e7621faa50bf9007076d6be4e0da9514edc59)
2024-04-14 12:08:22 +02:00
Axel Spoerl
a225fb5d89 XCB: Suppress leave event, when mouse leaves with button pressed
Fixes: QTBUG-124003
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I232f731b4b5f9e332b1297e5fdae2cadbdf2db1a
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Błażej Szczygieł <mumei6102@gmail.com>
(cherry picked from commit 80bfeb4e793c673d540bd7641fc159338f64af1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-14 07:46:07 +00:00
Laszlo Agocs
cce7f89532 rhi: d3d: metal: Improve docs for importing existing resources
The struct members were not described. Add something for each in the
docs.

Change-Id: I75d0a5a6efee4d7b4a415b5282a9e44950ed3894
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit e12791b05759819708d2b466362dc4a1df75b686)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-14 07:45:57 +00:00
Lauri Pohjanheimo
793a568ebc Android: runAction can now be run past queue
On vulkan implementation it was possible that when going background
destroySurface was queued and then run when coming back foreground
that caused vulkan not being able to draw.

Fixes: QTBUG-118985
Fixes: QTBUG-118840
Change-Id: I5957b74b89384ea84fc09d9b55afcccf5c82e390
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b2c648c57261550474308aee09bfc1054818fb60)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-14 07:45:40 +00:00
Axel Spoerl
69c68571db Revert "QStyleSheetStyle: Propagate CE_ItemViewItem drawing to baseStyle"
This reverts commit f39f2bfe0b216252980c082b1771540dd00e6bd6.

Reason for revert: Breaks styling of treeview indicators.

Pick-to: 6.6 6.5
Task-number: QTBUG-123632
Change-Id: I7922f58a9a1ace40ba788571a297443c1900baf2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3e049f06557d0e3483b7fa40ecf8c9a918d8ac3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-14 07:45:25 +00:00
Volker Hilsheimer
a49960be79 macOS: support shortcut for Ctrl-modified Tab
Ctrl+(Shift/Option/Cmd)+Tab presses are not handled as a regular key
events, and are not seen by our NSView.keyDown implementation. But
they are delivered to a performKeyEquivalent implementation, so if we
see a Tab key being pressed with the Ctrl modifier down, then send
a shortcut event and stop processing if that event got accepted by Qt.

Fixes: QTBUG-113492
Task-number: QTBUG-8596
Change-Id: Id3aa7021a689b94d97eb881b19ddf7cb039e1bd2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 285294b684ac973efcf2c8ff92b427db3fb75948)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-14 07:45:12 +00:00
Tim Blechmann
418827f7cb CMake: split _extra_files targets
Separate config.tests, coin, cmake, licenses and changelogs into
independent targets to keep the IDE projects more organized.

Change-Id: Ie33d45799621c2d7ec6f022ffcfac132ac4c7b94
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit bd2dc0c3ed750eca9a3b87f1f99069a2d4e954f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-14 04:03:19 +00:00
Tim Blechmann
2939e22570 cmake: add _extra_files IDE target from heuristics
Lots of files in the repos are not included into the generated IDE
projects. Therefore we add utility targets (custom targets), which are
populated by glob patterns, which should fit most files that are found
in qt's subprojects.

Change-Id: I1b731e65f8db319d3cec817eea5c23a1eeaefb22
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 003a19115279e44bf8af96e0f588f5cc34725353)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-14 04:03:19 +00:00
Christian Ehrlicher
35450cde82 QTableView: fix cornerWidget connection
A click on the corner widget should select all items, not reset the
selection. This was accidentally added with
3e144bdc7484968dcccbda8f35ad802c7fd7a42e.

Fixes: QTBUG-124267
Change-Id: Ie20b7cf0ff730214dca80116ad888f42c2b7a670
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 56ec0f94b3f9db19d5fe78d78dc7597a92a5c52f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-13 19:21:28 +00:00
Axel Spoerl
2425bce76d Stabilize tst_QComboBox:popupPositionAfterStyleChange()
Wait 2x double click interval, to make sure a double click is safely
avoided.

Use QTRY_COMPARE at the end of the function, to cover cases where a
synchronously delivered mouse click causes posted events.

Wrap the test implementation in #ifndef QT_NO_STYLE_FUSION, as is the
declaration.

Skip the test on QNX.

Fixes: QTBUG-123798
Pick-to: 6.6 6.5
Change-Id: I73f4acb241a8c77a542152288c65f3d07582e075
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit f7a809ab73182ef25578eb8fd200c223fa3eb0f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-13 11:02:36 +00:00
Thiago Macieira
2cd1cd1541 QCborValue: fix sorting of UTF8-to-UTF16 strings
We must compare the raw string length in UTF-8, not the UTF-16 one.

[ChangeLog][QtCore][QCborValue] Fixed a bug that caused certain
non-US-ASCII string comparisons to produce results not in line with the
CBOR specifications.

Pick-to: 6.6 6.5
Change-Id: I5f663c2f9f4149af84fefffd17c05d1c0f1bbc3a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 394788c68efacdec2676988b4b4ff207b20557f2)
2024-04-12 17:16:41 -07:00
Gary Wang
ba37ed8e8d WindowsIconEngine: Use the correct icon for document-properties
Currently the icon used by document-properties is a gear icon, on
Windows, the actual icon used by explorer's context menu for the
properties menu option is the wrench icon. This patch change the icon to
the wrench icon.

Fixes: QTBUG-124085
Change-Id: Ife49ad64d23b73b7676bc39330887e2cb320dcf9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5a775fc5f73ec3a39d17c261e4ea7e715eff44d1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-12 22:43:10 +00:00
Jarkko Koivikko
ff5bda7e11 print: windows: Fix setting page orientation
Previously when PPK_Orientation property was set, updateMetrics() was
called before doReinit() and updateMetrics() used physical dimensions
of the DC initialized with previous orientation, which resulted in
miscalculation of m_paintRectPixels, origin_x and origin_y variables.

This bug manifested itself as all sorts of weird behavior, such as
unexpected margins when changing paper size and printing beyond paper
margins.

Pick-to: 6.5
Change-Id: I2d0e104bee11165e3541e7f3119b29edd4b882c8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 223b92490edfd4e3e75e634831258c54d5b0a501)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-12 22:43:08 +00:00
Mårten Nordheim
164363e186 QSaveFile[win]: Use SetFileInformationByHandle for atomic rename
With our previous setup we would CloseHandle the file handle and then
MoveFileEx the file to the final destination. This opens up the
opportunity for other processes to open the file in the meantime and
cause the MoveFileEx to fail.

With SetFileInformationByHandle we can, without closing the handle,
rename the file to the final destination.

Fixes: QTBUG-122208
Change-Id: Id3c8e0b5703da280c84e466ed88287e99788d077
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9d8e233284aa9cd0757e1181451f4220473c71fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-12 18:08:01 +00:00
Christian Ehrlicher
206e99516c SQL/ODBC: Don't allow default argument for SqlStmtHandle
To avoid usage errors like fixed with
7e5a0b54f0737986b6716bfce0a43eba2e62aae0

Change-Id: I33af9721a04e80541c027fa6da8630070a5957ac
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c7c8b8f25d3d90c8197501d81f3947228cdbf441)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-12 18:07:59 +00:00
Christian Ehrlicher
ef6d7c9af4 SQL/ODBC: convert QVariant to QDateTime only once
... instead three times in a row.

Change-Id: If08b4c092cfb5b7d224f9a94afb7d395ce2b2eca
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit efd6786e52639ef1ceab819265b0c33d7ef8294e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-12 18:07:57 +00:00
Axel Spoerl
9fef654cc1 uic: use qOverload for ambiguous slots
qOverload was used only for ambiguous signals and slots with no
arguments. Connections to ambiguous slots made in widget designer's
signal/slot editor, lead to an unresolved ambiguity when compiling
the generated code in ui_xxx.h. One example is QLabel::setNum(), which
can either take a double or an int.

Always using qOverload is not an alternative, because signatures are
normalised. E.g. const QString & / QString can't be distinguished.

Add a map with all ambiguous signals and slots to customwidgetsinfo.cpp.
Hardcode the map, because uic lives in QtCore and can't access meta
objects of gui/widget classes.

Use this map in isAmbiguousSignal() and add isAmbiguousSlot().

Change OverloadUse enum into an enum class in language.cpp. Change
enum values to reflect the new condition for slots to use qOverload.

Rename existing enum values and remove default argument in
language::formatMemberFnPtr() to improve code readability.
Apply const T& syntax for all types starting with Q, except QSize and
QPoint.

Revert 94c16517b3f8f01309a89598e698931ef77d60db, which was a hack
forcing for QLCDNumber::display() to a string based connection.

Add a new baseline to tst_uic, to test the above.

Fixes: QTBUG-93413
Task-number: QTBUG-124241
Pick-to: 6.6 6.5 6.2
Change-Id: I49ccc1688cfc08970cce3e56adf18e5ac49a77e1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 2ec2c54e05656e04070ef1dc4b1e136a466c686c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-12 18:07:56 +00:00
Mårten Nordheim
e38e517dfc QHash: Add note about reference/iterator invalidation
It is mentioned in the porting docs, and in the class description
of the _iterators_, but none of those are really natural places to
look for the behavior of the container.

So, let's add a general note/warning to the functions in question.

Fixes: QTBUG-124195
Change-Id: Ic95e56f166df2c8067232dfb6b9cb5b05d6a4361
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4c286d6f6c746d41ad7a95ef1f28d1cccf244649)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-12 18:07:55 +00:00
Rym Bouabid
c304f45b54 PRNGLocker: disable copy and move
Axivion (SV61) points out based on Qt-RuleOfThree the lack of copy and
move constructors and operators.
We don't need them, so tell the compiler not to create them.

As a drive-by change mark the constructor as explicit and not
discardable.

Task-number: QTBUG-122619
Pick-to: 6.5
Change-Id: I466f5cedea427608b434b71fda0d1e50619b9b20
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7d44817fc06e2eb4f5ff1fbce8e1905652825c05)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-12 18:07:53 +00:00
Hatem ElKharashy
8aae3bd438 Tweak the margin value of QOutlineMapper clip rect
The original change was introduced to fix performance regression due to
the increased value of QT_RASTER_COORD_LIMIT. The optimization was done
by clipping anything outside the device rect plus a small margin.
However, setting the margin to a small value caused a regression, where the
rasterization became slightly different from the previous implementation.

Fixes: QTBUG-123054
Pick-to: 6.5 6.2
Change-Id: Ic4fddea89cd5f6e5760dc4a91b1f2f59527e8e5c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit aabb133d07ff99157ae2070e16594eba035cca08)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-12 17:12:31 +00:00
Assam Boudjelthia
ba94dc0ce6 Android: blacklist tst_QWidget::setParentChangesFocus
This fails on Android 8, and we want to get Android 8 bump into the CI.

Task-number: QTBUG-124291
Change-Id: I179880c38d155df82bcb772f546104d956326647
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 44072f43eda689fe1f60c57ff833d5b1dcb3b594)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-12 17:12:30 +00:00
Lauri Pohjanheimo
7aeffcebbd Android: fix 180 degree orientation issue
On android documentation orientation changes are sent via
onConfigurationChanged callback. Previous implementation
based orientation detection to onSizeChanged callback.
That callback is not called when orientation turns 180 degrees.
i.e. between landscape and inverted landscape.
This fix adds detection to on onConfigurationChanged to catch
those cases.

Fixes: QTBUG-118887
Fixes: QTBUG-118236
Pick-to: 6.5
Change-Id: Ie2f81798de97e460de839f7ebfde9a9efa25909f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 6209079c7a34c4656e6e110ae5194feb19f6134a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-11 23:21:02 +00:00
Rym Bouabid
61885e26e4 QCborMap::ConstIterator and Iterator: Add missing destructor
Axivion (SV403 and SV404) points out, based on rule of three,
the lack of destructors for ConstIterator and Iterator.
So add them.

Task-number: QTBUG-122619
Pick-to: 6.5
Change-Id: I4d4abf9be8be529492bf13069052ae4a8d8a90de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b9cb2f30f1568e6cbf8e13d61501babcb90d46b2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-11 19:54:14 +00:00
Mårten Nordheim
36059bfa36 QHttp2Connection: fix handling of replies on locally initiated stream
It was overlooked in testing, but it would emit a signal for new
incoming stream even if the server was just replying with HEADERS on a
stream the client had initiated. Or vice-versa.

Change-Id: Ie7b3a45729a78106da1d8c058e15705cc7dcc53b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 1d03e1851bcaf80700f19c8c583e6b9abc2059a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-11 19:54:12 +00:00
Dennis Oberst
0cf3244939 ResultReporter: fix uninitialized int member
Fixes Axivion(SV70842): Qt-Generic-InitializeAllFieldsInConstructor

Task-number: QTBUG-122619
Pick-to: 6.5
Change-Id: I8ee378246df4767122ca91d65170cae82232044b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit cf420dc98e45123ff305c1a74b060909fac2d2e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-11 19:12:24 +00:00
Sergio Martins
9e4e2ea2ad QToolButton: Don't crash if deleted while in event handler
If QToolButton::mouseReleaseEvent triggers its deletion then it
will crash when dereferencing its d pointer.

qabstractbutton.cpp already uses QPointer guards in many places but
qtoolbutton.cpp was missing this one.

While deleteLater() is still our recommendation, we shouldn't crash.
It's not always obvious what led to the button's destruction,
as the chain of indirections can be long.

Change-Id: I4a33447fa4e90953370277eb57a161398ded9a9c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 97d227acc74c6034615dc05d9d94ee5cad7c5f50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-11 05:05:56 +00:00
Dennis Oberst
50c49a6979 QOCICols: fix warning for -Wdangling-reference
.. by playing it safe and taking the QVariant by copy

Pick-to: 6.5
Change-Id: I24e0507a912388b7fb17e838a22e8d4c449bcf5b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d4f2a5aa401c14dd8dc122bbf25fce9cd7f41cba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-11 05:05:54 +00:00
Wladimir Leuschner
917a0bf265 QComboBox: Revert recreation of ComboBox Container on style change
In commit 9da8d67b3bca1d40ae221a9c6be218fe57759724 a recreation of the
ComboBox Container was introduced, since QWindows11Style depends on
WA_TranslucentBackground flag, whereas the other styles don't set this
flag. This leads to the destruction of user supplied views we don't own.

Fixes: QTBUG-124191
Change-Id: I4a693f612ddc299696b9de0d87c94d88c04d9b39
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 61b71ffb3b2b34aea67306c973ee751335733433)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-11 05:05:53 +00:00
Volker Hilsheimer
6c67572181 Mac style: draw MDI window title bar without gradient
Use a solid fill with the "button" color of the palette also for active
title bars, which is then the same color as the frame, and gives the
window a consistent look in both dark and light mode.

Fixes: QTBUG-123162
Change-Id: Iac26fdb1518ffe4f8255e01bedf7329be40ac258
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 19b38ede7804e23a1abe7ddabb447c7f5a907a7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-11 05:05:51 +00:00
Volker Hilsheimer
3a0ed76c57 Mac style: draw dock widget titles and status bar without gradient
Fill with the "window" color of the palette as passed in through
the style option, which takes care of active vs inactive color
selection.

The title bar of a docked dockwidget is a bit lighter than the
main window title and unified toolbar background, but identical
to the color of the title of an undocked dock widget. This is now
the case for both dark mode and light modes.

Also remove the gradient fill from the status bar, just fill it
with the window brush.

Remove the now unused helper functions for the title bar
gradient.

Fixes: QTBUG-92855
Change-Id: Ia04c630201b288c0107567d3f459f66129693c82
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 0d91cc866f2799d56911bcdadabebb137eafcea8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-11 05:05:49 +00:00
Volker Hilsheimer
294a2646db StyleSheet: respect a font weight set for header sections
QCommonStyle sets the font for a selected header section to bold.
This overrides the font weight a calling style might already have set,
e.g. when a style sheet is applied to explicitly set a weight for a
checked header section:

QHeaderView::section:checked {
   font-size: 20px
   font-weight: normal
}

Since setting the weight on a font sets the respective resolve-mask
bit, we can avoid overwriting a weight that is already set explicitly.

Add baseline test coverage using a QTableWidget.

Fixes: QTBUG-122180
Pick-to: 6.5
Change-Id: I8c6279ad2fd8c5718ebea26e27c64ae823625748
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 74e0ed217fdec8e32227f9f845eccac7f1552297)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-11 05:05:48 +00:00
Alexey Edelev
9dd7e09c9b Suppress the warning about unused QT_INTERNAL_CALLED_FROM_CONFIGURE
Add the dummy check if the variable is defined to suppress the warning.

Change-Id: If3bb0ef6a2587693c0ec898ceb3080ebfc1e82a7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 6760bae2fa7a758ac8eb70c0009c80a715ea1c54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-11 02:24:46 +00:00
Martin Storsjö
3890c487e9 CMake: Fix a misplaced > in pkg-config files
The Qt CMake routines for generating pkg-config files don't
handle all sorts of generator expressions, see
qt_internal_set_pkg_config_cpp_flags in QtPkgConfigHelpers.cmake
which hardcodes handling of some specific expressions. In this
case, they don't handle the semicolon within the generator
expression expansion.

For the UNICODE and _UNICODE defines, this means that the pkg-config
file ends up containing "-D_UNICODE>" with the trailing ">". (The
pkg-config generator tries to parse out the generator expressions,
but the semicolon gets handled as a higher level separator, leaving
the closing bracket ">" behind.)

This issue only shows up for mingw targets, because pkg-config files
aren't generated in MSVC style builds.

Escape the semicolon as $<SEMICOLON> to make it not break the
surrounding generator expression, as parsed by the pkg-config file
generator.

The generator expressions aren't fully correctly evaluated for the
pkg-config files though; the UNICODE and _UNICODE defines don't
end up in the resulting pkg-config file even though they're used
during compilation (both before and after this change).

Fixes: QTBUG-103019
Co-authored-by: Martin Reboredo <yakoyoku@gmail.com>
Pick-to: 6.5 6.2
Change-Id: Icdb380e3b42be2a47372a8ee2b61378a33c685f7
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Li Xinwei <1326710505@qq.com>
(cherry picked from commit f35b9530b9acf954f8741d0ee2b4b68fc90a4afc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-11 02:24:46 +00:00
Alexey Edelev
cd93a8dc8e Avoid using PACKAGE_PREFIX_PATH for configure-time executables
PACKAGE_PREFIX_PATH is not defined in cmake versions 3.29.x.
We should avoid referring the internal CMake variables.
Use the calculated reverse relative path to the prefix path
instead.

Fixes: QTBUG-124186
Pick-to: 6.6 6.5
Change-Id: Iefae132e61a3f8e8f5525c0abd6a2d41631c2fb0
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 2d19f09b577f72290328d90ba85145362676ea92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-11 02:24:45 +00:00
Chris Lerner
37d8317638 Don't add any entry whose name doesn't start with a letter
In the Addressbook example, any entry whose name doesn't start
with a letter will not appear in any of the categories,
but it will still exist. These entries would make the
"There are currently no contacts in your address book" page
disappear even when no entries could be found in the categories.

Check if a new entry has a name that doesn't start with a letter,
and if so, don't add it as a contact. Also, notify user that names
must start with a letter when this happens.

Fixes: QTBUG-124254
Pick-to: 6.6 6.5 6.2
Change-Id: I7f25711785ec7a82852a0f37d9f096cc3af41576
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c3fa43513e32c5bd8c0ee9d703119a545a5b8bc6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 22:33:45 +00:00
Tor Arne Vestbø
79cb221f96 macOS: Send key press as QKeyEvent if input context doesn't consume it
If IM is enabled we send key events through the macOS text input system,
and we do this for all key pressed, including the ones with modifiers
pressed. The latter allows the input method to respond to shortcut
key combinations to switch its own mode or do more advanced operations
on the text.

We were relying on the IM to call doCommandBySelector with a noop
selector if the shortcut didn't match any of its own internal key
sequences, but this fails for key events with more than one modifier
pressed.

Instead of using [NSView interpretKeyEvents:] to pass the key event
to the system IM we now go directly to the NSInputContext, which the
former method is just a wrapper for. This allows us to use the result
of [NSInputContext handleEvent:] to determine if the system IM consumed
the event or not. For key events with multiple modifiers this will be
false, which we interpret to send the event as a regular QKeyEvent
instead.

Fixes: QTBUG-123848
Fixes: QTBUG-106516
Pick-to: 6.5 6.2
Change-Id: I14a43c2029149514515dd9ece881aed3f6500a4e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 085d5db90dd4c148fe5dea6a3435166f6bdeedac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 22:33:44 +00:00
Martin Storsjö
3162f7a6ad QStringTokenizer: Add a missing include
This header uses std::forward_iterator_tag, which requires including
the <iterator> header.

This fixes building with libc++ with
_LIBCPP_REMOVE_TRANSITIVE_INCLUDES enabled.

Pick-to: 6.5 6.2
Change-Id: Id2ce97e158c87dab1efe30e54a93f0bc9351de5a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit aa896ca9f51252b6d01766e19a03e41bd49857f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 22:33:44 +00:00
Friedemann Kleint
b55cbd1a49 uic: Write QIcon theme enums
Split out some helpers to write the theme code with path fallback
checking for the enum case (identified by a fully qualified icon) or
the old XDG/filename case.

Task-number: QTBUG-121823
Change-Id: If2755483ab899f04e372cf95443f7e03970f6e7f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit b79cb3dd659c71560dd0324893cbdfe41a42f9dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 22:33:44 +00:00
Axel Spoerl
8f27ca2346 QLayout: Consume ChildRemoved event, when layout is disabled
QLayout::widgetEvent() returned early, when the layout was disabled.
That suppressed ChildRemoved events and lead to a crash, when the
layout was enabled again.

Don't return early on ChildRemoved events.
Add an autotest in tst_layout::removeWidget().

Fixes: QTBUG-124151
Pick-to: 6.5 6.2
Change-Id: Ib0a0bb73978d9fc2c9777d300cf38a8c4496b702
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Chris René Lerner <chris.lerner@qt.io>
(cherry picked from commit ef8e548cf1adf8032c030df04e69988f238c77fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 22:33:44 +00:00
Lucie Gérard
8cb7b906a6 Correct wording in licenseRule.json
Change-Id: I5bb718547a1c853e0f6c12bb8c93f7d874046a48
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 541a602e1d0605689ed7f14c8250d929255e7c34)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 22:33:44 +00:00
Liang Qi
be15c9c610 tests: update info for mouse move events in device_information
Pick-to: 6.5
Change-Id: I390aee8c17d971781e7e243cd7bf98e10212f648
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 73948d782a17d291c8095c45dfd4c1f4228a4e6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 22:33:44 +00:00
Assam Boudjelthia
a4e8281537 Revert "Android: skip vulkan tests for tst_qrhiwidget"
Amends feff219aadd649c41e6ed349da3a740a0a21435f which didn't really
do the revert for some reason.

This reverts commit bba26d72207304e02098d1436232357dd452de2a.

Reason for revert: Latest emulator update fixed the issue.

Change-Id: I0bc4263eae36c3ff81f235dcfe3bad9b30afd5d8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 5994def6aba46772b28650945ba7b5ea4b036cee)
2024-04-10 22:33:43 +00:00
Thiago Macieira
bce02faa5f QProcess: build forkfd as C code
forkfd_qt.cpp was originally created so we could use the Qt atomic
classes back when we couldn't rely on C11. We now can, so that primary
reason is gone. We only need it now to set NDEBUG, which the Qt build
doesn't set by default, and _GNU_SOURCE to match forkfd.c itself (GCC
and Clang define it by default in C++ mode because libstdc++ apparently
needs that).

Amends 993db5a12227b1e4067714ddc626d64a14474a54 and thus avoids a new
Clang 18 warning about using VLAs in C++ code:

 forkfd_linux.c:160:50: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension]

Pick-to: 6.6
Change-Id: I5f663c2f9f4149af84fefffd17bed82d39be4d78
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 05408055d52f3fe014fef3c550820011fa8b89f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 18:41:14 +00:00
Wladimir Leuschner
6aedc439c6 QStyleSheetStyle: Propagate CE_ItemViewItem drawing to baseStyle
Currently the drawing of CE_ItemViewItem is propagated to QWindowsStyle,
which leads to ignoring alternating rows in ItemViews. Propagating the
drawing to baseStyle honors the set base style.

Fixes: QTBUG-123632
Pick-to: 6.6 6.5
Change-Id: I656ee1c44029abf7233551303d469d38b6c848e3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f39f2bfe0b216252980c082b1771540dd00e6bd6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 16:48:27 +00:00
Assam Boudjelthia
4444167c16 JNI: check for pending exception first in getCleanJniObject()
returning early if the object is null will not clear pending exceptions
from the previous failed JNI call, and that will crash the app on the
next jni call if an explicit exception clearing is not done, wish mostly
the case. Checking and clearing for exceptions has to always be done
under this call.

Fixes: QTBUG-122135
Change-Id: I0d42d012a4d1305fa07147fd22860d7c005f9b83
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 0a4599637657375517fcaf35177d8c7bac302556)
2024-04-10 09:46:09 +00:00
Volker Hilsheimer
32270a1276 QFileSystemModel: Wake file info gatherer thread up before waiting on it
Amends 0786c17bbc556a0f494fc825af47c604a9dc0241, which added a number
of attempts to gracefully shut down the QFileInfoGatherer thread while
shutting down a QFileSystemModel. This introduced a 1-second wait upon
destruction of the model when the QFileInfoGatherer thread is waiting
for an unset wait condition.

Instead of QThread::requestInteruption() to make the thread exit, use
QFileInfoGatherer::requestAbort(), which calls requestInteruption() but
also sets the wait condition afterwards to make sure that the thread
wakes up and checks the abort condition.

Pick-to: 6.6
Fixes: QTBUG-124164
Change-Id: I560f2131f226e0bb59f72e558cbab55b89cfb144
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit a79ca35abef38f882a1ab574063eb9ed6ffe6846)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 09:35:49 +00:00
Wladimir Leuschner
8b193397f5 QWindows11Style: Check for nullptr after qobject_cast
Fixes: QTBUG-123791
Change-Id: I050196bdf45754509a223c89652e0be7e0160a98
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit a35f57d4290c898cda686fccfa7a7a3e08beffd6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 08:48:31 +00:00
Edward Welbourne
84d5754a81 Pass trivially-copyable types by value, not by const ref
The LikelyPair and QLocaleId types are small enough to pass by value.

Pick-to: 6.5
Task-number: QTBUG-122619
Change-Id: I1502efcf69ac82d9c49b673975502882c59a4fd0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 738914e787c5a2de57f40753b665e2a49f9536d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 08:33:08 +00:00
Edward Welbourne
db7b707d81 Initialize QTextBoundaryFinder::pos to zero
One constructor neglected to do so. Use NSDMI to make sure all
constructors do, if they don't override this with something else. Also
remove fatuous setting, by constructors, of member attributes to its
default.

Task-number: QTBUG-122619
Change-Id: I9b726898b85e21d841b9af5b4dc72ee322829d50
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 35205ef1654f2ee0aca80010acdbb469cf1cf8e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 08:33:00 +00:00
Edward Welbourne
644eca89ed Pass QVariant to QSystemLocale::query() as rvalue reference
QVariant is rather big for passing by value; and no caller has any
further use for the QVariant it's passing in.

Pick-to: 6.5
Task-number: QTBUG-122619
Change-Id: I2751745e715aacfa8982ac97b4ae777fde5e88de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b68f1009187fee473f4c6477ec64300650e29904)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 08:32:52 +00:00
Edward Welbourne
a07c718c17 QSystemLocale(): disable copy and move
Axivion (SV546) points out (based on a clazy "rule of three" that
might be rule of five by now) the lack of move and copy assignment and
construction. We don't want those anyway, so tell the compiler not to
create them.

Pick-to: 6.5
Task-number: QTBUG-122619
Change-Id: Ie951a2c3d60d76ad3448310d3f9bbda22190015b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 21ef6d930ad3eb2fb435cd601692cb5cc1726bd8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 08:32:46 +00:00
Edward Welbourne
4c25cb76eb QLocale: pass 64-bit LanguageCodeEntry by value, not const ref
Probably makes no difference, since it's all in lambdas being passed
to a standard algorithm, but the static analyser noticed this would be
cleaner.

Pick-to: 6.5
Task-number: QTBUG-122619
Change-Id: I23093254e4857131b7be87aeff1e7ba79ea2b674
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e1da249be602322c3e4b84ba23748c1c1c8db888)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-10 08:32:38 +00:00
Giuseppe D'Angelo
5ba6f77f8c QTypeInfo: remove docs about how Qt's autodetection works
I don't think we should document *exactly* how we autodetect
primitive/relocatable types: we've been changing the detection across
Qt versions because sometimes we realized that it was wrong.
Moreover, no one else but us should be using the traits in question (in
other words: QTypeInfo itself isn't public API).

Pick-to: 6.5 6.2
Change-Id: Ie6e763f152e7dc0f6ce58869dbbd529240d2a546
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ae361f00b3f4827e62a19cc451227c9892b51f2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-09 09:29:07 +00:00
Piotr Wierciński
bc9d2230d8 Revert "wasm: Proxy emscripten_fetch() to the main thread"
This reverts commit f2f2b6ef18907a76461b54e110618e7840971fa7.

Reason for revert: There are couple of issues introduced. Lets revert to base revision and go with fixes from there.

Pick-to: 6.6 6.5
Change-Id: I8341de42ef3e4a609bfbffdb763dd5c28794473c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
(cherry picked from commit 157c9eef48916c3e11f43ffb0fe8e8030bed8d06)
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2024-04-08 13:24:10 +02:00
Assam Boudjelthia
a4be920e1c Revert "Skip Vulkan on Android in QRhi autotest"
This reverts commit 0d413506a1b019efecff41318a9134d79f2abcd1.

Reason for revert: Latest emulator fixed the issue.

Task-number: QTBUG-118220
Task-number: QTQAINFRA-5971
Change-Id: I0d4792ef68a3ad840c8c353f55cb96d0be7cd66e
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 471098918db21597c4c570ece5a64ce2f8aa1c30)
2024-04-08 10:15:42 +00:00
Assam Boudjelthia
34d856be26 Revert "Android: SKIP cases failing on Android 12 CI with 16GB RAM"
This partially reverts commit eb0d7b5dcf834c856d58637ada8745aee2b040ee.
Leaving tst_QRhi::tessellation() skipped because it still fails.

Reason for revert: The latest emulator fixed the issue.

Fixes: QTBUG-111235
Fixes: QTBUG-111236
Task-number: QTQAINFRA-5971
Pick-to: 6.5
Change-Id: I9a624be6ba219a4175c0e84ba68d882953422cba
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit 772fd609c6eff09bdaa44cb2ac5f913e58788fa3)
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-04-08 10:15:27 +00:00
Marc Mutz
b131310273 QSignalSpy: use NSDMI for m_waiting
One step closer to DRYing the ctors.

Pick-to: 6.6 6.5
Task-number: QTBUG-123544
Change-Id: Iff73fe70e3d2de52548d10b2f38a7ba2bd7029cd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b97bcdd7743485418c26cf37d6ed6ea31ce94376)
2024-04-07 21:34:34 +00:00
Tor Arne Vestbø
e25a60599f cmake: Only enable warnings on/off flags for C/C++/Objective-C/C++
The flags are not valid for e.g. Swift

Change-Id: Ie5b46dc9147d8c024e7e27712c7b8632abd727d9
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ce23c9083f4d06054eb59781c3309b1fcc807a1f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-07 20:44:34 +00:00
Alexey Edelev
5737ae3ccf Set the CMP0159 to NEW where applicable
The policy controls the file(STRING ... REGEX) behavior. This
suppresses warnings produced by  CMake versions >= 3.29.

Pick-to: 6.6 6.5
Change-Id: I6067bb719b7d35aa2464a91ed198399ff9b1c9af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 4fcf6f5164be0c7cdc56b0a37dcadc42fac4f344)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-07 13:36:18 +00:00
Assam Boudjelthia
21ff70afb4 Revert "Skip QVulkan autotests on Android"
This reverts commit c6138bf9de411450cbadf9576a256296b5917e01.

Reason for revert: latest emulator version fixed the issue.

Task-number: QTBUG-118234
Task-number: QTQAINFRA-5971
Change-Id: I7137851baf2b71e760af4bfab7726d761b7f59ff
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 4244b4194c34df1b473b279e20b332e97f3e17fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-06 07:25:50 +00:00
Mark Brand
63395dda39 QNetworkInfo[win]: Explicitly link with oleaut32 for MINGW too
Following up on 2 commits that fixed static linking for MSVC but left
out MINGW:
    230c53ad9d7046e61b37ce63a6bc68449393bb7b
    d9820b02072b27f830b389e503467c8220679cba

Pick-to: 6.6
Fixes: QTBUG-114243
Change-Id: I12853355ffa1a62acce15ff660478f618c42e0a6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 938bdccb897db85396e96215281d66f64cb2a9ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-05 14:17:31 +00:00
Matthias Rauter
67fffbaff1 Fix range-loop-detach warning in qhttp2connection.cpp
Change-Id: I0b02e2f79ab7828858da3b4ca9840ad07d39a70a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 7d5646c02e25a81f7b2e2c76b39505fba3c2c043)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-05 11:32:26 +00:00
Matthias Rauter
d0d83694c1 Remove unused variables in QHttp2Stream::internalSendDATA
Change-Id: I13c546c7dc4cc3d15d8d92b62f053e438b5d6b64
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 88f034e55636105cca379172c0136a19077d3da2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-05 11:32:20 +00:00
Matthias Rauter
c64edf53dd Fix fully-qualified-moc-types clazy warnings in qhttp2connection_p.h
Change-Id: Ia5cda794989757a501e83c15d1ad348a48ac4923
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 5e19f4a8b218ae88494b3db157ce6415fd4dc1eb)
2024-04-05 11:32:13 +00:00
Mark Brand
477a7c6aa7 SQL/ODBC: QODBCDriver::record Unable to allocate handle
Seems to have been left out by 874f5c1f463cad61f49e0ff7007852a73fd93e7c

Fixes: QTBUG-123478
Change-Id: Ic028c3786203cbc1c3d7316c1ae22c12a928b170
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 7e5a0b54f0737986b6716bfce0a43eba2e62aae0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-05 11:12:35 +00:00
Martin Storsjö
efea1f981f QTypeInfo: Add a missing include
This header uses std::is_trivial_v, which requires including
the <type_traits> header.

When building with PCH enabled (which is the default), this
dependency does get satisfied via the PCH, so no issue is
visible.

This fixes building with recent version of libc++ when configured
with _LIBCPP_REMOVE_TRANSITIVE_INCLUDES (which removes unnecessary
transitive dependencies between the libc++ headers, a configuration
which may become the default in the future), with PCH disabled.

Pick-to: 6.5 6.2
Change-Id: I5e3ae20e366ed3028b1156cee05bcf2908d6e845
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit adb49d65e0774fa6be0b0d9d490c6f1fc5066a1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-05 08:24:27 +00:00
Tinja Paavoseppä
29436d1290 Android/QtView: Move resizing of the QWindow to Qt thread
Since any window resize events originating from Qt side are ran in the
Qt thread, having the one originating from Android run in the Android
thread can lead to race conditions especially during orientation changes.

Change-Id: Iebebec2fffdaf9181b01fc1e8f539c7bc232996d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 02bab22fde5de84c62e3eb86fde03248851d11dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-05 05:56:52 +00:00
Tinja Paavoseppä
f3b91c0dae Android/QtView: Set also x and y of the wrapped foreign QWindow
Previously, we have set the size of the QWindow to match the QtView.
Also set its x and y coordinate to match, just to keep the window and
the view in sync.

Change-Id: I0ea89a11e4526a0a996e7b62ac126808358b6bc7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit d45ce587784427c4ff72d306811eb63baa53cb3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-05 05:56:48 +00:00
Tinja Paavoseppä
939bfb838e Android/Embedding QML: Resize also parent window
The parent window created from the QtView had an
empty size. Also set its size when creating the window,
and when resizing the QtView. Replace parent window show()
call with showNormal() to avoid switching it to a fullscreen
window.

As a drive-by, use setGeometry() instead of setting the width
and height separately to trigger only one geometry update
for the platform window.

Change-Id: I91e350c1748a9e76879faa8bfcab7575f6155f02
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit e9edd3db524e0c9c77925ae5bea98017a6220ecf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-05 05:56:44 +00:00
Tinja Paavoseppä
7da0c6f83e Android: Make QtView extend ViewGroup instead of QtLayout
QtView should only have one child, the QtWindow, and that should always
match the QtView's size, so the handling for absolute layout is
unnecessary.

Task-number: QTBUG-121516
Task-number: QTBUG-123306
Change-Id: I77024ab9619e68ab98357518ad07535a2ff9614c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit c4a98a729898b7bf2244675f8ba91933f9ae8b93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-05 05:56:40 +00:00
Tinja Paavoseppä
46c639d81f Android: Make QtLayout support MATCH_PARENT layout params
QtLayout did not properly handle resizing child views to the parent's
size when their layout params width or height were MATCH_PARENT. This
was mostly visible when embedding QML to a normal Android app, as
there the Android view hierarchy is responsible for setting the size,
instead of Qt setting it every time the QWindow size changes.

Task-number: QTBUG-123306
Change-Id: I08cbfa8e352d0cb2ca5b6e5aa40e891a62b82eb4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b3685743f31daef71021d9948deaf20ce34ce57a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-05 05:56:35 +00:00
Tim Blechmann
16b93bb04f QLocale: silence fallthrough warning
clang doesn't seem to consider `Q_ASSERT(false)` as empty statement.

Change-Id: If99c7d4874450d781182491ef3963f1ee96285a6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 93f87326f2a69ddbbb8d82fcc2b506a486aece1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-05 02:29:53 +00:00
Christian Ehrlicher
8f25cdc94e SQL/ODBC: don't escape a driver string
We must not try to escape a driver string, the user has to make sure
that everything is correctly escaped when passing a complete driver
string. This fixes a regression from QTBUG-122642.

Fixes: QTBUG-123444
Change-Id: I43316c7a09060f5c8117fdc3c464d239e37d9cdf
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
(cherry picked from commit 9873f4b283dcabefc20b1720bef1958c2b1ccc02)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-04 21:43:13 +00:00
Tor Arne Vestbø
81581819c7 widgets: Invalidate RHI swapchain when window moves to new top level
When a QWidget with an associated RHI swapchain (via its QWindow) is
moved to a different top level window, that top level window has its
own backing store, and QBackingStoreRhiSupport, which doesn't know
anything about the fact that the window already has an associated
swap chain in the original top level window's QBackingStoreRhiSupport.

As having multiple swap chains for the same window is not supported
on all RHI backends (Vulkan and DX in particular), we need to throw
away the swap chain when detecting that the window is moved to a new
top level.

We do this by hooking into the existing WindowAboutToChangeInternal
event delivery to renderToTexture children, which now delivers the
event both to renderToTexture QWidget children as well as QWindows
in the hierarchy. The condition of when to deliver the event has
been updated to reflect whether the top level uses RHI for flushing,
instead of only including renderToTexture children, as the former
also includes setting QT_WIDGETS_RHI=1 explicitly.

The event is then caught by QBackingStoreRhiSupportWindowWatcher,
and handled the same way as for SurfaceAboutToBeDestroyed.

Renaming qSendWindowChangeToTextureChildrenRecursively would make
sense at this point, but to make cherry-picks easier we keep the
current name for now.

Fixes: QTBUG-120276
Pick-to: 6.5
Change-Id: Ic4c60e89be985f12a84e9f893c299e602b70851a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 1bd755465efa27294362925f55306f88f1800936)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-04 19:42:25 +00:00
Shawn Rutledge
ab597b84b3 doc: Remove deprecation of the supported QTouchEvent ctor
Amends 111115bf8862b7cd1197c2ef8a4b475c882776d4

Change-Id: Ibc557fdde9c894a3a58bb58835e11be9180e6e6d
Pick-to: 6.6 6.5 6.2
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 14610fb1749a22abbd203f42e3edb3f4425cb215)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-04 18:05:24 +00:00
Axel Spoerl
913bd8d19b Android notification example: Correct connect statements
The example breaks building 6.7 with examples on Android, due to
QObject::connect() to a lambda without context object.

Add context object.

Fixes: QTBUG-123989
Pick-to: 6.6 6.5 6.2
Change-Id: Id3994e577a8a676220ac8d9f95d01c054839c143
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit f54953a0abfe7db796a294c9239b943ebec91a2f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-04 17:29:34 +00:00
Volker Hilsheimer
1d9ff052fa Font icon engines: reverse implementation to avoid pixmaps
Draw the glyph directly in the paint() override, and use that
from the scaledPixmap implementation. This avoids a pixmap
creation just for drawing an icon with an existing painter.

Change-Id: Iece0083a3a9f3625d843bc6e9d836baf9b5d84f8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1752405f44eb6d5cbd8f8147b78263461092e676)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-04 00:52:04 +00:00
Volker Hilsheimer
51c0378798 Fix warning: remove unused parameter
Pick-to: 6.6 6.5
Change-Id: I5794e38e1e9871f14c9a8df6483e57c1922dace2
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
(cherry picked from commit 8424a6401469fdfb9fbaad488fdd5fe65050f34a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-04 00:51:59 +00:00
Volker Hilsheimer
2a1bdbf730 Apple icon engine: reverse implementation to avoid pixmaps
Instead of implementing scaledPixmap() to rasterize the
vector image we get from App/UIKit, and calling that from
paint, implement paint() to draw the vector image directly
through the painter, and use that in scaledPixmap.

Change-Id: I2c62826f29406543bc8d8c7fa71199e91586d83b
Reviewed-by: Amr Elsayed <amr.elsayed@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9d8c5bc7186b0553c47ddabc9ad6c9d509b35f81)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-04 00:51:58 +00:00
Tor Arne Vestbø
c198f7124c Decouple rate-limiting of paint-on-screen widgets from top level widget
As part of eacd58d4e78e7238ba5fcca90ba960aaf3ebd263, a mechanism was
added to prevent posting redundant UpdateRequest events to the top
level widget, managed by QWidgetRepaintManager. The mechanism relied
on a boolean that was set when posting an update request event, and
reset when processing the event for the top level widget, as part
of QWidgetRepaintManager::sync().

However, for paint-on-screen widgets, we don't post an update request
to the top level, we post it to the paint-on-screen widget directly.
And when processing that event, we don't paint the widget though the
normal QWidgetRepaintManager machinery, but instead call the paint
event via QWidgetPrivate::paintOnScreen().

As a result, an update() on a paint-on-screen widget would result
in never receiving updates for non-paint-on-screen widgets, as
we assumed there was no reason to send further update requests.

We could fix this by clearing the updateRequestSent flag as part
of the paintOnScreen() code path, but that's incorrect as the flag
represents whether the top level QWidgetRepaintManager needs an
update request event or not, and would lead to missed updates
to normal widgets until the paint-on-screen widget finishes its
update.

Instead, we only set updateRequestSent if we're posting update
requests for non-paint-on-screen widgets, which in practice
means the top level widget.

The paint on screen logic in QWidgetRepaintManager::markDirty
still takes care of rate-limiting the update requests to the
paint-on-screen widget, by comparing the dirty area of the
widget.

There is definite room for improvement here, especially in the
direction of handling update requests via QWindow::requestUpdate
instead of manually posted events, but for now this will have to
do.

Fixes: QTBUG-80167
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ib5685de7ca2fd7cd7883a25bb7bc0255ea242d30
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 697e1b0397259959e3f555296f87a0d9d923e4b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-03 23:27:12 +00:00
Tor Arne Vestbø
007507b576 cmake: Selectively enable -no_warn_duplicate_libraries for Xcode 15+
We can't make the choice of whether to enable no_warn_duplicate_libraries
or not based on the Xcode version Qt was built with, as the target flags
will propagate to our cmake integration tests, which we run on platforms
where we don't have Xcode 15.

Change-Id: I241a950a3d2e70652a3a6386e5dd86c681d1c13f
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>
(cherry picked from commit 2e97906593bca028e5a173264c05edb18427381f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-03 23:27:06 +00:00
Thiago Macieira
410b57f9a6 QLibrary: fake RLTD_NODELETE by not calling dlclose()
On systems without the RTLD_NODELETE flag, simply don't call dlclose()
and leak the handle. Amends ef5ab6e00664caf0af23b21593f809d718c9dfc7.

Change-Id: I01ec3c774d9943adb903fffd17b76673562daa8a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 60417a265a152aaa21081d8b4f2ad28c9730ca0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-03 21:16:03 +00:00
Thiago Macieira
2626a5bf1f QStorageInfo/Linux: remove dependency on linux/mount.h
It was introduced in December 2018, which is apparently too recent for
some Linux distributions. So remove the dependency that was there only
to give us MS_RDONLY and revert to the old statfs.h / sys/vfs.h flag.

We still don't include <sys/vfs.h> because it is absent on some old
Android versions.

Amends ea6abe583f8534495c3c43e2b6aab95742b102a3.

Fixes: QTBUG-123932
Change-Id: If1bf59ecbe014b569ba1fffd17c29cc448d16358
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 73003f3b41edb7f363a2492ad349899c54a2b890)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-03 21:16:02 +00:00
Thiago Macieira
716bf5dd58 XCB: remove dependency on QtOpenGLPrivate
We don't use that in the XCB library or plugin anywhere.

Change-Id: I5f663c2f9f4149af84fefffd17be8c7f3bd7bd14
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 43cefd882e15f1b3b99d25a17db2057411ff465c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-03 21:16:01 +00:00
Thiago Macieira
9c1752d7b1 QObject: add check for Q_OBJECT macro to findChild(ren)
We can't fix the underlying reported problem, but we can warn that the
user has made a mistake.

[ChangeLog][QtCore][QObject] The class template parameter passed to
QObject::findChild() or findChildren() is now required to have the
Q_OBJECT macro. Forgetting to add it could result in finding children of
the nearest ancestor class that has the macro.

Fixes: QTBUG-105023
Change-Id: I5f663c2f9f4149af84fefffd17c008f027241b56
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ce2585d0e950ff0d81adbcf5463ddfbcb1367900)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-03 21:15:58 +00:00
Fredrik Ålund
149d5ae3ed Fix data() with long datatype for Mimer SQL
Calling data() for parameters of the type bigint
failed in combination with stored procedures with
output parameters. Cast the result to qlonglong to
fix it.

Pick-to: 6.6
Change-Id: I84ef04ed26821b92ef7c5bcdf12b778e91450e0b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit ad84754b5888971074a44ec698d20a32aebeec14)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-03 15:17:27 +00:00
Tor Arne Vestbø
fa92448dd6 macOS: Remove popup mouse and app activation monitors on app shutdown
We're not guaranteed to get into any of the code paths that call
removePopupMonitor() before the app goes away. In a plugin-scenario,
this may cause crashes when our monitor then gets a callback and
we try to access QGuiApplicationPrivate::instance().

Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-123959
Change-Id: I287b91ff261a8aab74adbbad8c63a042daf944d5
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 8bb93bf8ee59b3e31e7353d6683dbb0aa890f7e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-03 15:17:27 +00:00
Albert Astals Cid
6810220218 Use ifdef instead of if for __cpp_lib_span
Like the other times it's used in this file

This is causing compilation errors in projects that use -Werror=undef

Fixes: QTBUG-123937
Change-Id: I0cdd2910755dc9079890011dd8dbc27a6e64793e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 699ddcb15b5e981d32ea65d1c1a12f8fa0b06e0d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-03 13:51:52 +00:00
Bartlomiej Moskal
01c11c3006 Android: Choose correct icon for QMessageBox
QMessageBox contains an icon that can be set using icon type. Before
this commit, android.R.attr.alertDialogIcon was used regardless of the
expected icon type. Only if setting failed, the icon from
android.R.drawable was set (depending on the expected icon type).

Previously, usage of android.R.attr.alertDialogIcon was the way to
consider Theme in choosing icon view. Since
31a0d99fa565d39bf39f0c3ae5ed00859679a969 commit, getDrawable(id, theme)
is used with second parameter: Resources.Theme.

Because of that we can start to use only icons from android.R.drawable
and remove usage of android.R.attr.alertDialogIcon

Fixes: QTBUG-123334
Pick-to: 6.6 6.5
Change-Id: I6cfdaf30aea5d132e38ba5d78054089b51cf5f13
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 229cadb7a36694b7ab639047dceb73cf2dfce858)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-03 10:54:01 +00:00
Mårten Nordheim
45b90af43c QRestAccessManager: fix syncqt generation
Apparently it has trouble with multiple attributes between the
class keyword and the class name, looking only for the EXPORT
macros.

As a quick band-aid we can add the #pragma to tell syncqt
to generate the header explicitly.

Fixes: QTBUG-123875
Change-Id: If155a5b667b9e71d43dfac04ad19caee0ff23793
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit f2159d71313cca1d27a9c30da8e7709ea23320e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-03 10:54:00 +00:00
Marc Mutz
bed03c10be QRhiVulkan: fix random values in pipelineCacheData() result
The QVkPipelineCacheDataHeader::reserved field wasn't initializaed by
the code, but then memcpy()ed with the struct into the result
QByteArray. At best, this contains random data, at worst, it leaks
information.

Initialize it to zero.

Found by Coverity.

Amends df0e98d4080f50de7ecacdc4cae079ab31280481.

Pick-to: 6.6 6.5 6.2
Coverity-Id: 444147
Change-Id: I398c9a1e99483f2f9887d768319b20ecc11e2c86
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 2913e7de5186fc4fd3576167304c214d30f78d2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-04-01 09:31:58 +00:00
Alexey Edelev
41ecbdf467 Add the note about data size to QByteArray::operator=(const char*)
Add the note about the way the str size is determined when using
QByteArray::operator=(const char*).

Pick-to: 6.6 6.5
Change-Id: I39b2d0fc2967832622fbf0c11b3ff6c7ff99b8f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 32e2386b157effa5f253ffd669ed52471863823b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-28 09:56:17 +00:00
Axel Spoerl
137706fc31 QMenu: clear popup screen after exec()
8cd7a3d4723ca414f3fe544704a0ccb752da94b8 remembered the current screen
in QMenuPrivate::popupScreen. This QPointer member is not reset, after
QMenu:exec(), which makes a re-used menu remember the wrong screen, if
its next usage happens on another screen.

Reset the member variable at the end of QMenuPrivate::exec().

This amends 8cd7a3d4723ca414f3fe544704a0ccb752da94b8.

Fixes: QTBUG-118434
Pick-to: 6.6 6.5
Change-Id: I7457ca72166346f01cf71b2706ebc20ecd71173c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 7aedcdefb81004f57e664409c0fb9f9b371ff4f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-28 07:28:03 +00:00
Shawn Rutledge
662dbcb8a9 QTextMarkdownWriter: escape all backslashes
A literal backslash needs to be doubled so that the parser doesn't treat
it as escaping the following character when the markdown is read back.
In ca4774131b9b8ee40b4d7f5c1ba296af4700207f we tried to limit it to
backslashes that were not already escaped. In case someone really needs
a longer series of backslashes, it's more correct to escape them all;
but this comes with the risk that if they do not get un-escaped by the
markdown parser in some scenario, repeated round-trip saving and loading
could multiply them excessively. So we also add a lot of tests to try
to verify that this is safe.

Task-number: QTBUG-96051
Fixes: QTBUG-122083
Change-Id: I64f610d24e99f67ebdc30d5ab5c6cf3985aec5ec
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 0281005a711c3635114ba92f778d0e9c8a89027d)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-03-27 09:14:12 +01:00
David Faure
12c69ad04d qErrnoWarning: downgrade from critical to warning
The name says it's a warning, it's pretty unexpected that it should
lead to a critical message.

One case where this is a problem is QTBUG-48488
where merely printing with "Microsoft Print To PDF" and canceling
the file dialog leads to "QWin32PrintEngine::begin: StartDoc failed"
as a *critical* message. Some Windows applications have a message
handler that shows a msgbox in case of a critical message,
and getting such a msgbox after canceling the file dialog seems very
wrong.

Task-number: QTBUG-48488
Change-Id: I1c842340dd2faf2be6e64e0522f9e2b33547d3cf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 30225da91f89f7c0356bbc930896ee3e14319aae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-26 23:14:12 +00:00
Thiago Macieira
113ecff9f2 QPolygonF: delegate QDataStream marshalling to QList
Like the QPolygon code. This fixes a mistake in failing to clear the
list before de-marshalling in operator>>.

Updated most of the QDataStream tests to have data in the objects
they're streaming into, to ensure that the stream overwrites everything.

Fixes: QTBUG-122684
Task-number: QTBUG-122704
Pick-to: 6.6 6.5 5.15
Change-Id: I01ec3c774d9943adb903fffd17b6920c72f5042b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 1ebee8980ba31514079a01989168914bfd1e9f4f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-26 22:20:41 +00:00
Marc Mutz
59072e9916 QMainWindowLayout: rewrite validateToolBarArea() to return by value
Coverity complains that QToolBarAreaLayout's
addToolBarBreak(QInternal::DockPosition) could access
QToolBarAreaLayout::docks out of bounds if passed
QInternal::DockCount.

That is correct, but a valid pos seems to be a precondition for this
function, judging from its sister functions, e.g.
addToolBar(DockPosition, .) or insertItem(DockPosition, .), which also
don't validate `pos`. All in-module callers of addToolBarBreak() only
pass valid positions, and use validateToolBarArea() to ensure that. So
it seems that Coverity doesn't grok the pass-by-in/out -parameter used
by that function. That, or it doesn't track back far enough.

Before attempting more drastic measures, first try rewriting the
function to return-by-value instead, and see what Coverity has to say
afterwards.

As a drive-by, make validateToolBarArea() constexpr.

Pick-to: 6.6 6.5 6.2 5.15
Coverity-Id: 444141
Coverity-Id: 444135
Change-Id: I5fcc664c3cea608429036cad75c37f5c38059733
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 19aeb431cf1bd4e864356ff02db6337dc59b2835)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-26 19:27:00 +00:00
Marc Mutz
de8d62589d QStorageInfo: fix use-after-move
Coverity complained about a use of the moved-from (in the first line
of the loop) `info` object in subsequent lines.

This specific instance is harmless, because the field being accesssed
is a scalar and the move SMFs are the default ones, so the field isn't
actually changed when the struct is moved from.

Still, to silence Coverity and to guide other attentive readers of the
code, take a copy of the field before moving from the struct, and use
the copy's value after the move.

Amends ddc39eb3a46d699c23d39f0e914978199eb98cc6.
Amends 3e330a79ec8d273630660eefae42995018421c0c.

Coverity-Id: 444199
Change-Id: I26ea8669f27124fb2567b16d803d47ab439f1e41
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit ae8031b5e72032f9e2884c18cd72639acfd0d1a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-25 22:29:48 +00:00
Wladimir Leuschner
251bddc661 QWindowsVistaStyle:Revert polishing of QAbstractScrollArea/QGraphicsView
Revert the polishing for QAbstractScrollArea and QGraphicsView
introduced in a1f12273b2e355033ab2a9478d1e9702210a0733

Fixes: QTBUG-123722
Pick-to: 6.7.0
Change-Id: I9db9079c672f4bf70ce3401382a5843855df2c4a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit f5d5a42dc3fba2a3a9d911e8ddc589d191f7d247)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-25 19:00:47 +00:00
Alexandru Croitor
d899a9abd5 CMake: Add deployment API to our examples
Projects were modified using the tool at:
https://git.qt.io/alcroito/cmake_refactor

A couple of examples had to be adapted manually, due to them including
more than one app per example subdirectory.

The INSTALL_EXAMPLESDIR and INSTALL_EXAMPLEDIR assignments were
removed.

The install(TARGETS) calls were modified according to our
documentation snippets for qt_generate_deploy_app_script.

A qt_generate_deploy_app_script call was added for each executable
target.

Note that the deployment step will be skipped in the CI for now,
because we enable QT_DEPLOY_MINIMAL_EXAMPLES and thus
QT_INTERNAL_SKIP_DEPLOYMENT, and also because standalone examples
are not enabled yet, and deployment is disabled for in-tree (so
no-standalone-example) prefix builds.

The install(TARGETS) calls for each example will still run,
installing the examples into an installed_examples directory, that
will not be archived by the CI.

Task-number: QTBUG-102056
Task-number: QTBUG-102057
Change-Id: Ida389bbad41710b2ae5da4d95e2d85be9e0cd9ce
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3b30b0fc2e1cda30b83bd2de1f70b3ee0c83ba46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-25 15:49:46 +00:00
Alexandru Croitor
2fb9ac0de8 CMake: Move various rcc generated files into .qt subdirectory
So we have a single central location for all generated files.

[ChangeLog][Build System] Generated resource files (and supporting
files) will now be placed into the .qt/rcc subdirectory of a project
build dir. The location is an implementation detail that might still
change in the future, so it should not be relied upon.

Change-Id: Id21df22cac832b618e98c25e0e134f4cf70ed9bd
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit b84e7a6bb094e931810627d40c46faf897795655)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-25 15:49:44 +00:00
Marc Mutz
aecc4b1aba QDebug: fix copy-instead-of-move issues
Coverity correctly complains that we're copying the QDebug object when
calling print*Container() when we could have moved it into the helper.

So do move it.

Pick-to: 6.6 6.5
Coverity-Id: 406803
Coverity-Id: 407406
Coverity-Id: 408523
Coverity-Id: 408562
Coverity-Id: 418431
Coverity-Id: 424788
Coverity-Id: 425106
Coverity-Id: 426537
Coverity-Id: 427163
Coverity-Id: 428925
Coverity-Id: 444463
Change-Id: Ic80247f315a09fffe9363577dff1d1c781859304
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 7e8196510df88bc956492593c27da1af7b31b8ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-25 15:22:25 +00:00
Marc Mutz
406c0d3464 syncqt: remove dead code
Either the code in the try {} block

- doesn't throw, then the return within the try {} block exits the
  function, or it
- throws fileystem_error, then we rethrow in the catch, or it
- throws any other exception, then we leave the function by exception

In no case can control reach the trailing 'return {}'.

Found by Coverity.

Amends 7aecb189d544613ad13c7e7d1207bd7767225a71.

Pick-to: 6.6 6.5
Coverity-Id: 444466
Change-Id: I1c1bf752453076724c2fa9367ea5309e741d84ac
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 73d00d05477fb6da25164b37135bb19a300bea8d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-25 15:22:18 +00:00
Assam Boudjelthia
655600c35e Android: add core-private to use private permissions API
Amends 7fa6d09ca20b27b8350e6e26040372ba70e6244d.

Pick-to: 6.7.0 6.6 6.5
Fixes: QTBUG-123353
Change-Id: If79498d28b890772f23963621e6e7bd263a56aca
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 990746096e21955fbb2b06e2848b3795eab6b328)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-25 15:16:57 +00:00
Alexandru Croitor
c0428aa210 CMake: Fix semicolon warnings for generated resource init code
Fixes clang warnings when -Wextra-semi-stmt is enabled.

Sample warning:

 warning: empty expression statement has no effect; remove
   unnecessary ';' to silence this warning [-Wextra-semi-stmt]
   resourceReferenceKeeper() { QT_KEEP_RESOURCE(qmake_foo); }

Amends 11259972a3c5d1918f889f145a1f223bf7d876a8

Fixes: QTBUG-123588
Change-Id: I7ffc23cf00d8e2741e91c4d0b4056b0c89057dc2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 51aa9c6163c90fecdf54012819750d14c36da5d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-22 17:50:50 +00:00
Paul Wicking
b346a0f5e2 Doc: Replace obsolete <acronym> with <abbr> html tags
The html element <acronym> is obsolete in favor of <abbr>.
Replace the use in Qt's documentation templates.

Task-number: QTBUG-81209
Pick-to: 6.6 6.5
Change-Id: I19817fb7f3ab3c23aefeae480f270123d2253569
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit 34b15dcc8a34d356386e79a5f2a836271c7c8aaf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-22 15:28:24 +00:00
Timur Pocheptsov
8e0bb88d96 Clarify the priority in selecting TLS backends
In case a custom TLS plugin is provided, the order can be unclear
(next after OpenSSL is either Schannel on Windows, or Secure Transport
on Darwin, then a custom plugin, if any, and the last one is 'cert-only').

Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-123092
Change-Id: I02bcc1fa5448f64846d561a72b2522af3286c66c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 128645d02338029858dd3e03defeff9f16d80172)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-22 15:28:22 +00:00
Liang Qi
ed96f3bd2f xcb: try to repopulate xinput2 devices when needed
And try to not call Q_ASSERT() to avoid crash.

Fixes: QTBUG-123554
Pick-to: 6.6 6.5
Change-Id: I9443c5f0ab4ca7a858df9b328f517b48ab8f122d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 2862cdb7ba22cc99d1db158888ba0bb32c47e8e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-22 14:31:52 +00:00
Venugopal Shivashankar
c21dc81e15 Doc: Remove table for listing images
Task-number: QTBUG-122580
Pick-to: 6.6
Change-Id: I7ca3d677262b48ce9e1d85bd9347ad5b15d1598f
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit f3b73645a80086b1fb81b3d5554e9edb3500fce7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-22 13:16:09 +00:00
Thiago Macieira
bccbdc2255 CMake/ELF: allow using Qt's full version number in the private tags
We added the feature to tag private symbols using the Qt major version
only, because us developers often move between versions and need to keep
compiled code working, even when using private API (we're supposed to
know what we're doing). Linux distributions, however, want to be told
that something used private API and therefore needs to be rebuilt. See
[1][2][3].

Distributors will learn about this feature when updating Qt causes the
existing patch to fail to apply.

[1] https://build.opensuse.org/projects/openSUSE:Factory/packages/qt6-base/files/0001-Tell-the-truth-about-private-API.patch?expand=1
[2] https://src.fedoraproject.org/rpms/qt6-qtbase/blob/rawhide/f/qtbase-tell-the-truth-about-private-API.patch
[3] https://github.com/clearlinux-pkgs/qtbase/blob/main/tell-the-truth-about-private-api.patch

Change-Id: I5f663c2f9f4149af84fefffd17bed69026f4038d
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit e0940081bc7439d87d9ca41402a543a9c17fb857)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-22 04:14:07 +00:00
Liang Qi
d96653f559 gui: fix build against gcc-14 (-Werror=calloc-transposed-args)
src/gui/painting/qpaintengine_raster.cpp:3811:42: error: ‘void* calloc(size_t, size_t)’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
     3811 |         m_clipLines = (ClipLine *)calloc(sizeof(ClipLine), clipSpanHeight);
          |                                          ^~~~~~~~~~~~~~~~
    src/gui/painting/qpaintengine_raster.cpp:3811:42: note: earlier argument should specify number of elements, later size of each element

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I41ec3dd5c439e5cd51dd917741125ce50659500e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 12a432c80feba60ced4c67b496ac0762bacb8777)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-22 00:57:36 +00:00
Keith Kyzivat
41e943aeda Don't accept QFileDialog when disabled item is activated
On macOS, entries that do not match the filter are shown in the
directory listing.

Do not accept the dialog when these entries are double-clicked
(activated).

Pick-to: 6.6 6.5
Fixes: QTBUG-120768
Change-Id: If8ff6c56f1d21861b4e30051c212c9497042ed0f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 0f77aff05fa6eb059d7f8517c94c88f889b44e6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-22 00:57:32 +00:00
Alexandru Croitor
0e75b141b8 CMake: Consider NO_UNSUPPORTED_PLATFORM_ERROR for non-bundle mac apps
Currently if qt6_generate_deploy_app_script is called on an executable
target that does not have the MACOSX_BUNDLE property set, it will
error out with a message about not supporting non-bundle apps.

This error is shown even if NO_UNSUPPORTED_PLATFORM_ERROR is passed
as an option which looks like an oversight.

Change the code not to show the error if NO_UNSUPPORTED_PLATFORM_ERROR
is passed. This means user projects can call
qt6_generate_deploy_app_script for non-bundle apps without having to
wrap the code in a if(NOT APPLE) check, and deployment will simply not
run for that target on macOS.

[ChangeLog][Build System] The qt6_generate_deploy_app_script
NO_UNSUPPORTED_PLATFORM_ERROR option will now have an effect when
calling the API on non-bundle macOS executable targets.

Change-Id: I932d6bfa2d3c7e2aaf8be967fea1f682eacf0112
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ecdbc40d4041590ae6d6ceef2e82ec25f522da01)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-22 00:57:31 +00:00
Alexandru Croitor
3f1ddd1068 CMake: Reconfigure whenever module EXTRA_FILES are touched
Otherwise the touched files will not be re-copied and re-installed
until an explicit rerun of cmake.

Change-Id: I5abb752b45d8b33885a59363fe987225a89e713a
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 07e7340c0d82a33b7b112cb7c3a2a719ad2ec9c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-22 00:57:31 +00:00
Wladimir Leuschner
382505e22f QWindows11Style: Add offset for decoration in QComboBoxPrivateContainer
Pick-to: 6.7.0
Change-Id: Ib9043e1b3041c88d757ddd5ada6c0edcf2bb6129
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 587003c3ccf6f8abab9aa6e8131f5ff6ce368d8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-21 21:36:34 +00:00
Mårten Nordheim
39e8c72c67 UDP: Protect call to UDP API based on feature
Fails to compile in some qtlite setup

Pick-to: 6.6 6.5
Change-Id: If04c1ca3f1b4eb59517902b8caab167f4627391b
Reviewed-by: Jari Helaakoski <jari.helaakoski@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 505e7ec37d98da2010981ed17c39dd934edf47d1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-21 19:46:40 +00:00
Ahmad Samir
e86f223eba QFileInfo: checkAttribute should take lambdas by value
So that they are moved.

Pick-to: 6.6 6.5
Change-Id: I3d1767944200962be90d3eb8695c92a766c4c744
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 08cb919aa5b4fcd950e9f3a6e41c00c01f0632ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-21 19:46:40 +00:00
Ahmad Samir
22d1a437cb QAbstractFileEngine: remove member FileTime and use QFile::FileTime
This is probably a remnant from when QAbstractFileEngine was public API
since it's been changed to private API, just use QFile::FileTime.

Change-Id: I60d3d4ff811f95434b81d5ca115f5d43cfff8b15
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fd295f4bf6002b499f1f238efa5a7c8d9c90be39)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-21 19:46:40 +00:00
Alexey Edelev
1e3c0e4395 Add the error output for syncqt normilizedPath function
Task-number: QTBUG-123438
Pick-to: 6.6 6.5
Change-Id: If718d774daac2fd4a9e27ad4725a74362d1c78f3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7aecb189d544613ad13c7e7d1207bd7767225a71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-21 15:23:13 +00:00
Alexey Edelev
539c6b6f76 Use the correctly versioned variable when resolving ABI-specific cmake directory
Use the QT_CMAKE_EXPORT_NAMESPACE prefixed INSTALL_LIBS variable when
resolving the cmake path of the ABI-specific cmake directory.

Pick-to: 6.6 6.5
Change-Id: Ibc4a1b152135d840de104c15a183b13fca0739ea
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit df8c3d40c85465027de375f656684badc6247121)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-21 11:50:36 +00:00
Marc Mutz
9f14d0a288 QMetaMethod: document that fromSignal(nullptr) is ok
... and add a test.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I907899d7c54349d2fc23ea5ab58a1e67826b622b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 78db468f4895911e50849223899abf2c5fb1c72e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-21 10:21:09 +00:00
Marc Mutz
d272374203 tst_QNetworkReply: don't leak on failure in emitErrorForAllReplies()
The old code allocated QSignalSpies on the heap and stored them in a
non-owning container, so if one of the many check macros trigger,
those objects would be leaked. Ditto QNetworkReplies. The code also
used dynamically-sized containers for statically-sized data; a common
anti-pattern.

Hold the sample QUrls in a C array instead, QSignalSpies in C arrays
of std::optional (to delay initialization) and QNetworkReplies in a C
array of std::unique_ptr with the existing QScopedPointerDeleteLater
deleter.

Change-Id: I7305115af15c079abba6d45c5de8db2198ea7a6d
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 20eba275d836e071c1ad8a5e4d1ef88fc5b23fca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-21 10:21:02 +00:00
Marc Mutz
0c343c4c85 QSignalSpy::appendArgs(): move-append the QVariantList
Using the rvalue overload of append() is more efficient, since we skip
the alias check and the appendee's atomic ref-count ping-pong inside
lvalue append().

Task-number: QTBUG-123544
Change-Id: Ia76fdf28cba13d524fbbe894658a86a45a1ebe79
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit d5d2688acb5b67b41149db3332fa9bad11b39808)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-21 10:21:02 +00:00
Marc Mutz
9932a2f647 qtversionchecks.h: hide Q_OBJECT macro in C-style comment from automoc
Due to https://gitlab.kitware.com/cmake/cmake/-/issues/25770, the
presence of the Q_OBJECT macro here triggers automoc rule generation,
followed by moc's "No relevant classes found. No output generated."
warning.

Comment the macro out until the issue is fixed, leaving a comment to
avoid a helpful soul commenting the macro back in again.

Amends 32a1151245034e4d5d3162df21518e38b6f81fcd.

Task-number: QTBUG-123229
Change-Id: I5387128f8fcd2793f0d4b9ff73a551999fea84b0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit c07a47cbf0972578f066f0085eb857dba210aae1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-21 09:40:41 +00:00
Marc Mutz
b17025e889 QTest::qWaitFor(., int): remove superfluous static keyword
The static keyword prevents the linker from reusing the executable
code of one TU's instantiation of this function in other TUs.

There's no reason for this restriction, so remove it.

Amends 292cb12e024e63f17c501611e021b6f8da7d6dcc.

Change-Id: Ide60ce0bf4b7118295fad98a25bd438fc1da2039
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 8e504bfeb7872e6d604cd19719f84a5794091386)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-21 09:40:39 +00:00
Ahmad Samir
11b2047d4c tst_qtemporarydir: refactor a test
Instead of using ~/Downloads, which we have no control over (OK for
the CI, but not locally), create a parent temp dir, then another temp
dir inside it.

Also rename it to nestedTempDirs, the issue from the bug report wasn't
tested because it relied on a dir being created, then failing to set
permissions on it. The code has changed a lot since then.

Pick-to: 6.6 6.5 6.2
Change-Id: I2b03d5d761117aaf436041c13c0dc394b106bf89
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 56ef55eda0b197e975de155815885f310dc2e661)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-21 03:50:05 +00:00
Marc Mutz
b7dd49682b tst_QNetworkReply: don't use deleteLater() on QSignalSpies
Turn the QSignalSpy deletions from deferred (via deleteLater()) into
immediate ones. This is ok: QSignalSpy is using itself as a context
object in QMetaObject::connect(), so the connection thus established
to the monitored signal will be atomically severed if either sender or
receiver are destroyed. There never was a need to defer deletion of
the signal spy, so don't.

Found by making QSignalSpy's inheritance from QObject private.

Pick-to: 6.6 6.5
Change-Id: I962d28c3a78f356d234324fed68716f2f1052100
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit eefd8ab1e8e4d6afa64e15c017e1e78fd30c7382)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-20 23:54:17 +00:00
Marc Mutz
2f7cdec2c9 tst_QNetworkReply: use QtCore's QScopedPointerDeleteLater
... instead of rolling your own.

Pick-to: 6.6 6.5
Change-Id: I4fee2218eb874bfee34bd3a0abac3f85b0746540
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 17d2550ed09c564977d4e9414f60c5514ce4f76a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-20 23:54:10 +00:00
Marc Mutz
2ec659b175 QSignalSpy: fix indexed loop (int instead of qsizetype)
While a signal with more than 2Gi arguments is only a theoretical
possibility, still use the correct index variable for the indexed loop
over this QList<int>.

Pick-to: 6.6 6.5
Change-Id: I2ed33238c2cd9d2d1c39cd29c988a2adfd821897
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a90c3cc3c7ed24c83b9ffa4020cb3652678b36bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-20 23:54:06 +00:00
Marc Mutz
beabcc5436 QObjectPrivate::Signal: initialize all members
A recent change in that area triggered Clang-SA to rescan the code and
complain about this pre-existing bug: If receiver == nullptr, then the
`previous` member was never initialized.

Fix by null'ing it using NSDMI. This is a trivial type, the compiler
will be able to avoid the redundant write.

Amends ab92b9e40025dcf08c14232de762a268201a78b4(!).

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ideed71f0f36d5f896fb6a4614f233757c1371ee3
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 40714c1ddd886f6d0bde53e05f27d6b3e9e6649b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-20 23:54:04 +00:00
Paul Wicking
611366f1ba Doc: Fix QDoc syntax in bindable properties overview
Drop the \c command when in front of \l commands as that doesn't work.

Pick-to: 6.6
Change-Id: I0aa092461807e068e9c2368f5d6f04e77b56c910
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: James DeLisle <james.delisle@qt.io>
(cherry picked from commit c8fb376de50683c81cbf64b4422058d4dd2e9f07)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-20 16:56:25 +00:00
Lucie Gérard
8d1d4f9479 Rename files for header generation
Task-number: QTBUG-121039
Change-Id: I45eec26e93e5aa3e4a08ef4b326427338f63e3f2
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 402e47745636a36419b021385f137f5ceaa65f48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-20 15:33:12 +00:00
David Faure
67487f004c 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.6 6.5
Change-Id: Ifd605e65122248eb08f49e036fdda6e6564226bc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 75d82afa0d3aad9b4f9857e439535fc49c4616bc)
2024-03-20 13:22:16 +01:00
Alexandru Croitor
665fd3848f 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.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Task-number: QTBUG-102057
Change-Id: I2efcda455b400c27fe1efd1bcf81b133137fa2d1
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 224b7c6b6a2a425487df19643709d105e8f3cdd5)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-20 09:57:16 +01:00
Alexandru Croitor
bc227037b8 coin: Add instructions to build standalone examples
If a qt5.git configuration is marked with the StandaloneTests feature,
tell CMake not to build the examples in-tree, and instead use
qt-internal-configure-examples to build the examples out-of-tree.

This brings a couple of improvements:
- higher chance of building examples as ExternalProjects without
  issues
- ability to use deployment api in examples, without installing the
  examples into a main install prefix

The new coin instructions files use a copy of the standalone tests
instructions as a base.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: If89e6da0b327a38b9c2738f58aa1b5b5fb9fda37
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit d644f2e02ce36520b4d101ea03fbbcf1b72e7e6f)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-20 09:57:15 +01:00
Alexandru Croitor
7b4c6ff81d 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 62905163bf887c2c2c9ba7edcd64c96d237a6e95

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I8902381afa4267e40dfb2ad47e44285a806a35e2
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 270315e019a569bebf83e7c293b44f36c555fb3c)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-20 09:57:13 +01:00
Alexandru Croitor
4b63662c45 CMake: Allow building all examples as standalone just like tests
Introduce a new libexec/qt-internal-configure-examples script that
allows to configure and build "standalone examples" just like
"standalone tests".

This is a prerequisite for using deployment api in examples for prefix
builds, otherwise deployment api gets confused not finding various
information that it expects from an installed qt.

Because the various conditions in the build system for standalone
examples are similar to standalone tests, introduce a new
QT_BUILD_STANDALONE_PARTS variable and use that in the conditions.
The variable should not be set by the user, and is instead set by the
build system whenever QT_BUILD_STANDALONE_TESTS/EXAMPLES is set.

Unfortunately due to no common file being available before the first
project() call, in qtbase builds, per-repo builds and top-level builds,
we need to duplicate the code for setting QT_BUILD_STANDALONE_PARTS for
all three cases.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ia40d03a0e8f5142abe5c7cd4ff3000df4a5f7a8a
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 62905163bf887c2c2c9ba7edcd64c96d237a6e95)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-20 09:57:11 +01:00
Alexandru Croitor
5f242ab804 CMake: Adjust QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES for EP examples
Make sure to consider all qt_prefixes for adjusting
QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES with locations where qml plugin
config files might be present.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I5a7eec434635db1953871d735e2420c331ccee48
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 06fef6219e992489dae15e9851725e1675ff0bf6)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-20 09:57:09 +01:00
Alexandru Croitor
97ec9e9742 CMake: Allow specifying additional glob paths for QmlPlugins.cmake
Currently we hard-code to look for qml plugin Config.cmake files
in the current list dir, whether the Qt6Qml directory is.

This is not sufficient for finding qml plugins in a prefix build of a
repo that has not been installed yet.
For example qtquick3d plugins will be in
qtquick3d_build_dir/lib/cmake/Qt6Qml/QmlPlugins, which
won't be picked up by the Qt6Qml Config file in the installed Qt
location.

Allow specifying extra qml plugin glob prefixes via a new
QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES variable.
This is similar to QT_ADDITIONAL_PACKAGES_PREFIX_PATH.

Any path specified via QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES
will have the
 QmlPlugins/${INSTALL_CMAKE_NAMESPACE}*Config.cmake
glob appended to it, and then used for globbing files in that
location, after processing the main location wherever Qt6Qml is.

This will be used by ExternalProject example machinery.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I469863c965b8b13cf007c611976a64fbff6e9111
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 40fa36db22b67363a4a05a4d74b0fcfc2f4833b8)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-20 09:57:07 +01:00
Alexandru Croitor
ec9b70c561 CMake: Disable ExternalProject examples for -debug-and-release builds
Unfortunately when using CMake <= 3.27 together with
-debug-and-release, it's not possible to reliably build examples as
external projects due to clobbered files in the same build dir.

Disable building examples as EPs in such a case.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Icea9fdab47986c2608e1952a0bbae72365ac7a62
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c668dd4044283b6eac86f7ab8177595e207567d7)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-20 09:57:05 +01:00
Alexandru Croitor
0c38013c71 CMake: Adjust CMAKE_MODULE_PATH for ExternalProject examples
When building EP examples for a repo that defines a bundled library,
we need to make sure the relevant FindWrapBundledFooConfigExtra.cmake
file is found when looking up dependencies.

For a prefix build, that file is placed in the build dir of the repo.
Use the list of qt_prefixes that includes the build dir of the repo,
append lib/cmake/Qt6 to it and pass that as additional values to
the CMAKE_MODULE_PATH variable of the external project.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I85d5f360380856fcfb8be7235b8365dcf15aa0c0
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 31c5d50e84b210843ccdec58a86c4fce3125b679)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-20 09:57:03 +01:00
Alexandru Croitor
a94fef3e04 CMake: Fix syncqt IMPORTED_LOCATION path for multi-config builds
When building examples as ExternalProjects as part of a multi-config
qtbase build, syncqt can not be located with the following error:

CMake Error at Qt6CoreToolsAdditionalTargetInfo.cmake:10 (message):
   Unable to add configure time executable Qt6::syncqt
   qtbase/libexec/syncqt doesn't exist
Call Stack (most recent call first):
  qtbase/lib/cmake/Qt6CoreTools/Qt6CoreToolsConfig.cmake:44 (include)
  qtbase/cmake/QtPublicDependencyHelpers.cmake:65 (find_package)
  qtbase/lib/cmake/Qt6Core/Qt6CoreDependencies.cmake:34
      (_qt_internal_find_tool_dependencies)
  qtbase/lib/cmake/Qt6Core/Qt6CoreConfig.cmake:42 (include)
  qtbase/lib/cmake/Qt6/Qt6Config.cmake:165 (find_package)
  CMakeLists.txt:13 (find_package)

The Qt6CoreToolsAdditionalTargetInfo.cmake file is used both for
install(EXPORT) Config files as well as export(EXPORT) Config files,
and in the latter case, the path that syncqt is looked up in is not
correct because syncqt is not yet installed.

In addition to checking whether syncqt exists in the install path,
also check if it exists in the build dir.

Ideally the additional path would be stored in a separate file that
is not installed, but the current code infrastructure does not provide
such a feature. Because we store a relative path instead of an
absolute path, the build path does not leak, so the situation is
bearable.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I16ad5c280751e050bc9b039ebd38ec9a66a6554c
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit cc537d927b23a34296767fec8d3885a95f714255)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-20 09:57:01 +01:00
Alexandru Croitor
a33732ab74 CMake: Pass CMAKE_MODULE_PATH to external project examples
Some examples depend on FindWrapFoo.cmake scripts that are part of
a repo. An example is qtgrpc with FindWrapProtoc.cmake.

These need to be available when building external project examples in
a prefix build where the repo is not installed yet, and thus the
source dir FindWrap scripts need to be used instead.

Make sure to pass the value of CMAKE_MODULE_PATH to the external
projects to ensure these scripts are found. CMAKE_MODULE_PATH is
populated by qt_set_up_build_internals_paths as part of the
qt repo build.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I3e977919bc137ed60e8eb9300625e5d8b87b373e
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 20bd9fad1cf6d41c773056949e334c3ab75e8b1c)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-20 09:56:59 +01:00
Alexandru Croitor
e67704c40f CMake: Allow passing extra variables to external project examples
In some repos we need to be able to pass extra cache variables to find
3rd party packages when building examples as external projects.

Introduce QT_EXAMPLE_CMAKE_VARS_TO_PASS to allow passing vars like
OpenSSL_ROOT or Protobuf_ROOT if they are set in the repo project.

It should be noted that QT_EXAMPLE_CMAKE_VARS_TO_PASS expects a
special syntax for its values, of the from VAR_NAME:CMAKE_TYPE, due
to the pre-existing implementation on how we pass variables
to ExternalProject.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ie3e74d4fde106f947d12e51d27e41a310157aab6
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 43d0c5ed6ef666b4ef9f33c018240f551fb6ebae)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-20 09:56:57 +01:00
Liang Qi
167287e11a xcb: Avoid recreating xcb window in QXcbWindow::requestActivateWindow()
12203e94f5a34b59b6a7389402c854e823135a35 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.6 6.5 6.2 5.15
Change-Id: I6da4f3e64a9d7a92a2aab714591986c5d128fbd4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 23a906335e0d8a03388bbd73db43682c724d04a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-20 01:24:06 +00:00
Tor Arne Vestbø
5195c6683d 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.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>
(cherry picked from commit 2da738f03589b2bb53e921b5fec347bdd6b68b16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-20 01:24:06 +00:00
Ulf Hermann
24cc41f77f 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.6 6.5
Change-Id: I77fcd871724ce7f81b9567603dc5b4cb31f121c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4662e80755b3002585280cfe9076d2c6c14f1e5b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-19 21:26:34 +00:00
Marc Mutz
a6fba61545 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.6 6.5
Change-Id: Ia0ba888cce83529217642be0e7e321d9406ba386
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ce913bff5df668787dc904469fca09763acf0f27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-19 20:09:59 +00:00
Marc Mutz
24c2b8f8ab 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 6fc7d76e7309c01a364b0f72d253735366674f29, but not picking to
very strict LTS branches, just in case someone has a
QTest::ignoreMsg() installed on it.

Pick-to: 6.6 6.5
Change-Id: Ia1f6b7001f38202ac72f9945c4a822d81562cdbf
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 7565034aadf955537be908a94e4cef16096a041f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-19 20:09:52 +00:00
Alexandru Croitor
cf932db57f 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.

Task-number: QTBUG-102057
Change-Id: I931e5f2d683ab94a940e20a2bdfeaa4ac5d8c5f8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit c5d0e93199beea314e4e4607c8ef5f7c29162666)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-19 19:41:43 +00:00
Alexandru Croitor
c7be15e717 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.

Task-number: QTBUG-90820
Task-number: QTBUG-96232
Task-number: QTBUG-102057
Change-Id: If5a4102137e9dfc4a8bfde7b26d511ed1700340e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit c90964788cb1d6ffbfde6e9dc930bbb3e915fb98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-19 19:41:43 +00:00
Alexandru Croitor
d7b4937e24 CMake: Evaluate genexes for extra deploy file paths
Since d08fa86e63448377dde4297bc94680a9d7daaaeb 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 d08fa86e63448377dde4297bc94680a9d7daaaeb

Task-number: QTBUG-117948
Task-number: QTBUG-118153
Change-Id: Ia3898c31d80b82bdb25fe733fc73b45c6d689ed0
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a6965441d72a1e453d80d0083c1a3fd6803d96bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-19 19:41:43 +00:00
Chris Lerner
ed8b651143 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.6 6.5 6.2
Change-Id: Ib4d0991d314cd300a56def8797cac604fa88ea35
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 379f23cfdc5f28557de516d837895b27364354df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-19 13:28:01 +00:00
Tor Arne Vestbø
8ee25c66d9 Reparent QWindow children when reparenting QWidget
When a QWidget was reparented, we would take care to reparent its
backing QWidgetWindow as well, into the nearest QWindow of the
new QWidget parent.

However we would only do this for the reparented widget itself,
and not any of its child widgets. In the case where the widget
has native children with their own QWindows, the widget itself
may not (yet) be native, e.g. if it hasn't been shown yet, or
if the user has set Qt::WA_DontCreateNativeAncestors.

In these scenarios, we would be left with dangling QWindows,
still hanging off their original QWindow parents, which
would eventually lead to crashes.

We now reparent both the QWindow of the reparented widget (as
long as it's not about to be destroyed), and any QQWindow
children we can reach. For each child hierarchy we can stop
once we reach a QWindow, as the QWindow children of that
window will follow along once we reparent the QWindow.

QWindowContainer widgets don't usually have their own
windowHandle(), but still manage a QWindow inside their
parent widget hierarchy. These will not be reparented
during QWidgetPrivate::setParent_sys(), but instead
do their own reparenting later in QWidget::setParent
via QWindowContainer::parentWasChanged(). The only
exception to this is when the top level is about to
be destroyed, in which case we let the window container
know during QWidgetPrivate::setParent_sys().

Finally, although there should not be any leftover
QWindows in the reparented widget once we have done
the QWidgetWindow and QWindowContainer reparenting,
we still do a pass over any remaining QWindows and
reparent those too, since the original code included
this as a possibility.

We could make further improvements in this areas, such
as moving the QWindowContainer::parentWasChanged() call,
but the goal was to keep this change as minimal as possible
so we can back-port it.

Fixes: QTBUG-122747
Pick-to: 6.7.0 6.6 6.5
Change-Id: I4d1217fce4c3c48cf5f7bfbe9d561ab408ceebb2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c956eb8eddb1b3608d7e3d332fbe55df5ec41578)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-19 13:28:00 +00:00
Tor Arne Vestbø
51ef5b0d65 cmake: Propagate Apple platform build requirements to qconfig.pri
So we don't have to maintain the requirements in two places.

None of the variables removed from the qmake configs are
referenced before we do load(qt_config), so this should
be safe.

Change-Id: Iabd5884a2fd1c4b1cd7b44416bebb2624050229e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 640a3f24741dbd50cc5aff425c81d09f908054b4)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-19 09:56:22 +00:00
Mitch Curtis
78b7b0472c 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.6 6.5
Change-Id: I4170e9ade40c4b54dbc2bd73d124b2ade4d8c939
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit ce9f06c1579efda7ae0d259bfaa565f99d89e4f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-19 06:44:13 +00:00
Yifan Zhu
56247e4a32 qxkbcommon: fix isKeypad
This amends a34e81ab8be6445877e040b1afb85deeaa725f86 .

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.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>
(cherry picked from commit daa5f7bd5f3951e459f10666a8001c8a0076e827)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-19 00:52:42 +00:00
Tor Arne Vestbø
eefb27bb3f iOS: Remove NSView.safeAreaInsets wrapper
The API is available on all iOS versions we support nowadays.

Pick-to: 6.6 6.5
Change-Id: Ia58c5ad1649e7e6b22f9c56a809e2455586a8e5a
Reviewed-by: Amr Elsayed <amr.elsayed@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit a89a916377f774ea55b43afc56cb89070097883f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-19 00:52:40 +00:00
David Faure
3b428d6f28 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.6 6.5
Change-Id: I141d47b0ea0b63188f8a4f9d056f72df3457bda5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c837cd75936cbeeb898dd5808edb9dfaf716a76e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 23:55:25 +00:00
Thiago Macieira
9ffed81b15 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.6 6.5
Change-Id: I6818d78a57394e37857bfffd17bd69bb692dd03b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 5401a9a6cd3263eda15911c3fbfc81ebea2e798f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 23:30:17 +00:00
Øystein Heskestad
fbdcae954e 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
Change-Id: Ib14e4610692dc4832b1f3e99dca497d9baf3d9d3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 89467428f8173524083fd7d2cca9c2985141d567)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 20:39:06 +00:00
Marc Mutz
bf7eff0188 QTest::qWaitFor: scope std::chrono using directive tighter
... moving it away from between a comment and the C++ code the comment
pertains to.

Change-Id: I56b3ded01d1800bae19121e4b9340d0c43f1da85
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit c1d1437b4a8609f4b6e7eb5f39352d4951b4f507)
2024-03-18 21:39:04 +01:00
Marc Mutz
449551eea1 QTest::qWaitFor: move ceil<> to after the check
There's no reason to check whether the timer has expired after
rounding the timer's native nanoseconds up to milliseconds, so delay
the ceil<ms> operation to after the timer expiry check.

As a drive-by, protect the std::min call from Windows macros with the
parentheses trick and employ C++17 if-with-initializer.

Remove the break-if-expired, as it now obviously duplicates the while
exit condition.

Change-Id: If30421012143640c75a9a44fe711d0c1c7cd23b9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 59549657a3699b5ea963b7cdc0bd69f08ab6513a)
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-18 21:39:04 +01:00
Liang Qi
2a6015914c Fix dangling references - GCC 14
This amends 18def77d27f88ce26b6af29fe56a80429fed555d .

Pick-to: 6.6 6.5
Change-Id: Icadf46326f1fda1bdbcd40d101170581e510b87a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8a6750475410629741de0417c28f574c25c65338)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 20:39:04 +00:00
Thiago Macieira
fa601afd52 qfloat16: further disable the -Wfloat-conversion warning
It shows up in our headersclean mode.

Fixes: QTBUG-123374
Pick-to: 6.6
Change-Id: I6818d78a57394e37857bfffd17bcf9e350dc493c
Reviewed-by: Simo Fält <simo.falt@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 58796ac177cde3f558aec92c00e7ee8e174ba228)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 20:39:04 +00:00
Mårten Nordheim
305deaca22 Http/2: fix active streams counting
We were looking at all active streams, but that also includes promised
streams.

By the RFC the limitation that our peer specifies only applies to the
number of streams _we_ create, not the total amount of active streams.

More importantly, for the qhttp2protocolhandler it could mean that we
could end up having a few promised streams push the active stream count
over the limit, which could lead us to start more streams than intended
(then bounded by the number of queued requests).

The worst case in this scenario is that a **non-compliant** server
doesn't track how many connections we open and the user has queued
a ton of requests, so we open a ton of streams.

But on the upside: server-push is not widely used.

Change-Id: I2a533472eb9127fd176bb99e9db0518f05c3fffe
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 5ed736b053eb9d04ecd1a6f2f375cce7fcefe4e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 16:42:41 +00:00
Ulf Hermann
933d695ecb QProperty: Destroy binding when refcount is 0
This has to be done from all places where we deref it. Otherwise we leak
memory.

Pick-to: 6.6 6.5
Fixes: QTBUG-116086
Change-Id: I57307ac746205578a920d2bb1e159b66ebd9b2cc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 717dc9450ffc13ef8209a10073552ac4574a4160)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 16:42:35 +00:00
Mårten Nordheim
fb5ff98d32 Http2: fix streamsToUse logic
The settings frame with the max streams might be received late
or be revised later, so we cannot assert something on the
relation with the max streams allowed.

Amends 22c99cf498103c86baa5a415ca34630396e5b6aa

Change-Id: I973dfcf91541becc8c3d6363f9065bb1b9183062
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit b0b2b7d39d9689dfdcb69394d2c1b3a3e20f9999)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 16:42:35 +00:00
Mårten Nordheim
50af22aa8d tst_qnetworkreply::httpConnectionCount: tentatively increase timeout
It is failing a bunch on macOS in CI, but not locally.
So just assuming the timings are too tight in CI and increasing
them.

Amends 8de1ed89797cabc883b5651673daa747f6ee9c0e

Change-Id: Icb44fdbd2aa117de7350c5df2e8351bb19c865c4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 88763730cc9bc5929e0ff2af0a78276636bc91ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 16:42:29 +00:00
Eskil Abrahamsen Blomfeldt
cdee812bdb Fix default hinting with dpr scaling on Wayland
When high-dpi scaling is enabled, we default to HintNone
currently, since otherwise text layouts (and widget layouts
and anything depending on text size) will have to be updated
when the window is dragged onto a screen with a different dpr.

The check for whether scaling is enabled was based on
QHighDpiScaling::isActive(), which is technically incorrect
since this does not return whether there is a scale on the
painting, rather whether the coordinate system in Qt matches
the one of the platform.

Now that we support agreeing on fractional scale factors with
the Wayland compositor, this issue has become visible, since
QHighDpiScaling::isActive() will now return false for these
compositors, even for fractional scales. For integer scales,
the issue existed before as well, but the kerning issues are
less noticeable in that case.

Pick-to: 6.6
Fixes: QTBUG-122910
Change-Id: Ic82b07d57a06a351255619f9227dd60396903ade
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
(cherry picked from commit e7ddd490cf44ecd1c59b3798294ed2812fc5a940)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 14:19:16 +00:00
Axel Spoerl
359b648280 Documentation: Clarify palette/font/stylesheet inheritance/propagation
Palette and font changes made by a style sheet are propagated to
existing widgets and their children at change time.

Palette and font changes made by setPalette() and setFont() are
inherited by all existing and future children of the widget to which the
call was made.

Clarify this in the documentation.

Fixes: QTBUG-122588
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ic40d96fc1e5e4507f84a33138303b7193948d3fe
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit f2b681dc590c7fd3cd19cbde20363339ceae15f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 14:19:14 +00:00
Edward Welbourne
28911a81d4 Condition inline fromString() definitions on datestring feature
Amends commit 41f84f3ddb780ec751e3fc706dd242fc4a99de7a - QDate and
QDateTime declare fromString() methods only when feature datestring is
enabled. So their inline implementations should also be conditioned on
that feature.

Pick-to: 6.7.0
Change-Id: I84fc877001d3fc97c6ca149864e4ad5a2dbabe87
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1618ff825c2198705fedde9c284a0c52bcce5b89)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 13:59:42 +00:00
Mårten Nordheim
a3ee0db4bf tst_qfuture: Update EXPECT_FAIL msvc condition
It is passing on my machine with Visual Studio 17.10 Preview 1.
But only with C++20 enabled.

Pick-to: 6.6 6.5
Task-number: QTBUG-101761
Change-Id: Ia5af3d75d35dda1df9b39bdc94f07dd746ff60af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6c0be8acc44df9eec2c64527696bb137650124ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 13:59:40 +00:00
Øystein Heskestad
b71a4b9a2f QHttpConnection: Create new streams returns error when ids are exhausted
CreateStream returns a new error code, StreamIdsExhausted, when next
stream id counter exceeds max stream id instead of assert.

Task-number: QTBUG-122375
Change-Id: I653b20c24c1429fe88d476beb1ca952aa1bbb320
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9b386127a091ff12229709b4a60ad6d4e8b05512)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 13:17:29 +00:00
Eskil Abrahamsen Blomfeldt
5b3fd5e9d2 Revert "Don't do font merging for PUA characters"
This reverts commit fc33fea999365c36ed446eee0db0d59d94be306b.

The change caused issues with system-wide PUA fallbacks on
platforms where this is supported. It needs to be replaced by
an approach which still falls back, but only for fonts which
are explicitly categorized as PUA fallbacks.

Pick-to: 6.6 6.5
Task-number: QTBUG-110502
Change-Id: I985a1f8076645593c50e81759872b4227d0fcd0d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 4913511d3bf8ec7838f80fbfe92c0fe900b2f003)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-18 11:12:02 +00:00
Ahmad Samir
8e8b300337 QCommandLineParser: remove redundant #ifdef from unittest
C++11 has been required for a long time.

Pick-to: 6.6 6.5
Change-Id: Ib6c1571b100dd4eb8194d515f2180ca26481b556
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 66dd00dcfd8a715ff6bc736e6beb5f2d3b2c69cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-16 14:41:15 +00:00
Shawn Rutledge
091ce6477c Revert default FlickDeceleration to 1500
At the time of bb1f616ff19586225cd712195ca78bfc64944103 the
Flickable.flickDeceleration property still applied to both touch
flicking and mouse wheel scrolling. In qtdeclarative
b1766d9d629f61d824146e69f1f3b319cbee3d11 we decoupled them. Switching
from the traditional 1500 logical pixels/sec² to 5000 was not enough to
satisfy those who complained about the mouse wheel "not being linear"
and at the same time made touch-flicking feel too sluggish. So let's
restore the traditional default deceleration value.

The flickDeceleration property is still adjustable, and the default
can still be overridden in any QPlatformTheme subclass.

[ChangeLog][QPA] The default value for the platform FlickDeceleration
hint is reverted to 1500 (rather than 5000 as in Qt 6.6). This sets
the default value for Flickable.flickDeceleration, which can be
overridden directly; and the default can also be overridden in any
QPlatformTheme subclass.

Task-number: QTBUG-35608
Task-number: QTBUG-35609
Task-number: QTBUG-52643
Task-number: QTBUG-97055
Fixes: QTBUG-121500
Change-Id: If52b61dfcd0c08a7c6e753f39dbe01f417e94bf4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit ed66cf8a045cc65e13d951b0ff41abff634935bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-16 04:47:14 +00:00
Alexandru Croitor
9eb01b5364 CMake: Avoid dsmyutil warnings on shared libraries using libjpeg
We link object files with the same names into the BundledLibjpeg
static archive.

This caused warnings when running dsymutil on shared libraries using
that archive:
 skipping debug map object with duplicate name and timestamp
 could not find object file symbol for symbol _jpeg_start_compress

Avoid that by creating copies of the source files with different
names, so that all object files are unique.

Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-123324
Change-Id: I1d4ebdd111b4172cde793671fbe059957f102871
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit b72158daf502e1f7f0d8c585df6923b4d958cb94)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-16 04:47:14 +00:00
Alexandru Croitor
06ab1d3630 CMake: Check for qtpaths6.exe existence during windows deployment
A qt installation might not contain the non-versioned the qtpaths.exe
installed, but keep the versioned qtpaths6.exe.

Try to use the versioned version before the non-versioned one.
If none exists, show a warning at deployment time.

Amends 571201603acc731330c9af42a3aca9cda41d38fd

Pick-to: 6.6 6.5
Fixes: QTBUG-122664
Task-number: QTBUG-119619
Change-Id: I23caf9ed3c7928fbab9657b0c0c64517dfc7d68e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit bcdc9d7059b6ecd4e0bfb44cf5a42d87c49e3edc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-15 21:45:18 +00:00
Paul Olav Tvete
c9b5b40d14 Fix QTextEngine regression with large-ish texts
Change 997fd3b88ede8078af286da6ecc197e83a8cbb46 fixed integer overflows
with huge texts. This was done by using qsizetype for size calculations
instead of int. However, that change introduced a serious regression
due to an itermediate imultiplication result being "promoted" to unsigned,
and therefore a negative value being converted to a large positive.
The solution is to make sure all values in the expression are signed.

Fixes: QTBUG-123339
Task-number: QTBUG-119611
Change-Id: I3f9189f77b383c6103cf5b35981cdb607b065f6f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 7a84c58f55ab56c5d77be80e43783d0b5302a749)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-15 21:45:17 +00:00
Timothée Keller
32ce7fa8d2 Windeployqt: prevent output for --list option
Some outputs weren't guarded with the optVerboseLevel which caused them
to occur even with the --list option. Add a guard to prevent for that.

Fixes: QTBUG-122257
Pick-to: 6.6
Change-Id: Ide060cda4ac6f9b4470ca608120e2b8aa4819de5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit ad2da2080c8b99665cd32237ab365fee5461cf66)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-15 19:10:45 +00:00
Jarek Kobus
933b606af5 QFutureWatcher: Fix race for initial emission of resultReadyAt()
When connecting a QFutureWatcher to the QFuture it will connect to the
output interface, which will queue up events to notify about the current
state. This happens in the thread of the QFutureWatcher.

Since 07d6d31a4c0c17d8c897d783a9b0841df6834b02 unfortunately the sending
of those events was done outside the lock, meaning the worker-thread
could _also_ send events at the same time, leading to a race on which
events would be sent first.

To fix this we move the emission of the events back into the lock
and because it is now inside the lock again anyway, we will revert
back to posting the callout events immediately, so this patch also
partially reverts 07d6d31a4c0c17d8c897d783a9b0841df6834b02

Fixes: QTBUG-119169
Pick-to: 6.6
Change-Id: If29ab6712a82e7948c0ea4866340b6fac5aba5ef
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 63b2cf8a457f0eea861fa060c610a74b35450ba6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-15 19:10:43 +00:00
Christian Ehrlicher
e2e0bfd238 SQL/PostgreSQL: cleanup usage of QT_CONFIG(datestring)
Creating a QString from a QDate/QTime works even when
QT_CONFIG(datestring) is not defined, so no need to ifdef it out.

Change-Id: Ib3594036f309393b612d3fbf21f51be9c36a9391
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f813b76fb2b4189fc18d0b5a75faf1eea2bb1de2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-15 19:10:19 +00:00
Christian Ehrlicher
9478e25284 SQLite: Update SQLite to v3.45.2
[ChangeLog][Third-Party Code] Updated SQLite to v3.45.2

Pick-to: 6.6 6.6.3 6.5 6.2 5.15
Change-Id: I3b841bc009f2e0ed6dcfa1b93cbb8bce0cd9ad47
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 91f8d1de37aa3a74af83ed997c1686f10e2fed72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-15 19:10:18 +00:00
Lucie Gérard
acf8a0e173 Correct license for qbatchedtestrunner.in.cpp file
File is is part of the internal test infrastructure.
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: Ia5bc4e0abeea210ee501596330b2b63216e9e9c7
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 0886035bcdd7bb1c74d3119354d1311377ebc0dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-15 08:09:30 +00:00
Lucie Gérard
cebcc638c0 Correct wasm util file
License is set to that of the other files in the directory

Task-number: QTBUG-121787
Change-Id: I9922feb2a520a549ab9cc1d82a85417202ad83c3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit f9136fd0dbdbc4f5d61b50b7fcffece6faa2ac4a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-15 08:09:10 +00:00
Wladimir Leuschner
8ffd1adfef QWindows11Style: HighDPI aware qDrawPlainRoundedRect
Change-Id: Ic9562a20bce59c265c539a1378f5f8fd8e9e9a17
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
(cherry picked from commit df24438e6a2adb344d78628e7a79432f88fab5e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-15 03:59:36 +00:00
Timothée Keller
e831b220d9 Revert "Windeployqt: remove unused library list"
This reverts commit a05abede682db4ab20a7c1d9eb45a487e91d6a78.

Reason for revert: Causes QTBUG-123325

Change-Id: I251b67798af3d768db6f2836b52ded558c0c8211
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit c6fff128d7ca3f8296c805aca7212f7bea48f5a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-15 03:23:33 +00:00
Thiago Macieira
10c7706656 SQL/MySQL: merge toMySqlDate (which returned MYSQL_TIME) into exec()
It was the only place that called it. Makes the code slightly uglier,
but removes a function that returned a raw pointer. More importantly, it
gets the actual type from QVariant, without relying on it internally
converting from QDateTime to QDate and QTime, or failing to do so in
some cases. This is going to be needed for the next commit.

Pick-to: 6.6 6.5
Change-Id: I6818d78a57394e37857bfffd17bbcd3f5057eadc
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit b5d73636d27f1bba87980cf1bac6feb1ebd6360b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 22:01:27 +00:00
Thiago Macieira
af41847af5 QFutureInterface: fix build with GCC14/C++20: template-id not allowed
When declaring a constructor, you must use the injected name, not a
template.

qfutureinterface.h:472:37: error: template-id not allowed for constructor in C++20 [-Werror=template-id-cdtor]

Pick-to: 6.6
Change-Id: I6818d78a57394e37857bfffd17bbbf2313001cbf
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 111c08d0eaa134652f1f1e602ead1a539614258f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 20:44:19 +00:00
Piotr Wierciński
9a59f6bc57 wasm: Dont access QNetworkReply header data through dangling pointer
Fixes: QTBUG-122893
Pick-to: 6.6 6.5
Change-Id: I3768fdffaec7be4ec0b559fdb365600220e648d1
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit a5b00cefef12999e9a213943855abe6bc0ab5365)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 20:44:19 +00:00
Mårten Nordheim
4b7e8af859 tst_QNetworkReply: cleanup changed state from timeout test
It was not setting the value _back_ to 0 when the function ended
and this caused qtbug68821proxyError to fail fairly consistently
on Windows when it was running in the same run.

qtbug68821proxyError was always succeeding when ran by itself so
it was quite odd.

Change-Id: Ifa4982f1b10128674081136a30bdab4b0ce7004a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 5e102a792c4ee0db180defe480cb96c197871508)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 20:44:18 +00:00
Thiago Macieira
513a5d074c tst_QHostInfo: increase the timeout to 15s
That seems to be enough for me when trying to reverse-resolve host names
inside the corporate network.

Change-Id: I6818d78a57394e37857bfffd17bc6b0ebd39f51b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d18d8a7ad1f69b2e65de114d9a3edc23d56da30e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 17:21:08 +00:00
Thiago Macieira
15c96b4172 tst_QHostInfo: don't use the test class to store results
Because QHostInfo is threaded, so if the look up times out and we exit a
given test, the results may still be delivered to the next test.
Especially if the next test is also about to time out -- in which case
it doesn't and prints a nonsensical output.

Before:

FAIL!  : tst_QHostInfo::lookupIPv4(WithCache:literal_ip4) '!QTestEventLoop::instance().timeout()' returned FALSE. ()
   Loc: [tst_qhostinfo.cpp(220)]
FAIL!  : tst_QHostInfo::lookupIPv6(WithCache:aaaa-single) Compared values are not the same
   Actual   (tmp.join(' ').toLower())     : "192.0.2.1"
   Expected (expected.join(' ').toLower()): "2001:db8::1"
   Loc: [tst_qhostinfo.cpp(281)]

Now:

FAIL!  : tst_QHostInfo::lookupIPv4(WithCache:literal_ip4) 'helper.waitForResults()' returned FALSE. ()
   Loc: [tst_qhostinfo.cpp(278)]
PASS   : tst_QHostInfo::lookupIPv6(WithCache:aaaa-single)

Change-Id: I6818d78a57394e37857bfffd17bc66e241cab24d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 78cf5740a95d2dbf985cc137240a11f0c4ebfde0)
2024-03-14 10:21:08 -07:00
Marc Mutz
b75704a519 QTest::qWaitFor: make a comment terser
...and adjust it to its presence in the new QDeadlineTimer overload,
which sports nanoseconds granularity.

Change-Id: Ifa9658ca32c5dc4bef5cf36dec2e452174eebe1c
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit dd5925fedb19c8fdb2601ec9eab6fb916341ff47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 17:21:07 +00:00
Marc Mutz
ffe0f48f52 QTest::qWaitFor: remove superfluous qthread.h include
Amends 1abea5f5f13b4b8ec2a1c282e643b791cea12f30.

Change-Id: Ic4be7ed9508ae07eaa0f1d618090c8f44bb431fc
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 710eda7da859bd278b62b1739ee7317f330ce8a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 17:21:07 +00:00
Marc Mutz
f75c76fac0 QTest::qWaitFor: remove superfluous check for isForever()
When a QDeadLineTimer::isForever() then its remainingTime() is
chrono::nanoseconds::max(), which is exactly representable as
chrono::milliseconds, and greater than 10ms, so the following code
would have done the right thing already.

Let it.

This also removes the duplicate mentioning of the 10ms sleeping
timeslice.

Amends fa296ee1dcf4c16fb6f242cf08949485e499fec3.

Change-Id: Ibc32d6069b78cd4583df07d0707d98645440b36c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e102edfbf8db3a0a541de2a8a3e3782b7e5b234b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 17:21:07 +00:00
Marc Mutz
d46f88c049 QTest: add missing <chrono> to qtestsupport_core.h
Don't rely on transitive includes.

Change-Id: I350922a47842ad5bdad0dc3f8349b0c82dd4bd0d
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit f38ba1827c1d488642b08df5982bb9dbba710e2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 17:21:07 +00:00
Alexey Edelev
285bbe03c5 Ensure that per-ABI builds are sequential
The current approach doesn't work correctly because external project
steps that we run on per-ABI build directories look as
'cmake --build <abi/build/dir> --target <target_name>'. When the
project has a single APK this works perfectly fine. But when building
more than one apk this leads to the simultanous build in the same
'abi/build/dir' which causes undefined behavior and concurrent access
to the build artifacts. This is especially sensible when APK targets
have the common dependencies.

The solution is split for two usecases:
- Ninja-like generators, that support job pools.
- Other generator.

For Ninja-like generators we now create job pools per-ABI with job number 1,
this convinces ninja to run only one 'cmake --build' command in single ABI
scope.

For other generators the solution is not that good. We create the dependency
chain between all APK targets and this leads to the build of the unwanted
dependencies. For example if project has apkA and apkB targets, then
apkB_x86 will depend on apkA_x86(assuming x86 is not the main ABI). This is
the only way we may ensure that 'cmake --build' commands won't be running
simultanously.

Fixes: QTBUG-122838
Change-Id: I6f48fae57047a29129836168c28e14cde4eaa958
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 31a91d2e932a123836b5862bf43a8e79c3071245)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 17:21:07 +00:00
Tor Arne Vestbø
cbdd820398 macOS: Forward application{Will,Did}FinishLaunching to reflection delegate
If a custom application delegate is installed prior to creating the
Qt application delegate we will forward callbacks to the delegate,
but this has to be done manually for any callback we implement.

Fixes: QTBUG-122996
Pick-to: 6.6 6.5
Change-Id: Ia25e2c4b8cac37130d604c772c875c5d76c66764
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit d8371ebbd2b405bb1361836523a2b15a54780607)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 17:21:07 +00:00
Tor Arne Vestbø
8a8481f7eb QMessageBox: Respect explicit accept/reject after closing dialog
If the dialog is closed by pressing a button, the button will be
reflected via clickedButton(), and the result() will reflect either
the QMessageBox::StandardButton value, or an opaque value for custom
buttons.

Depending on the role if the buttons, the accepted or rejected
signals are emitted.

If the user called accept() or rejecct() on a dialog that had
already been closed by a button, we would as a result of
1f70c073d4325bc0eb9b0cec5156c3b89ce1b4df emit a signal based
on the original button that was clicked, instead of respecting
the newly triggered function.

It's a questionable use-case, as the clickedButton() is still
the original button e.g., but we should still avoid regressing
this, so we now emit the signals based on the newly stored
result code instead of using the clicked button as the source
of truth.

To allow this we had to change the opaque result() value for
custom buttons to stay out of the QDialog::DialogCode enum,
but this should be fine as the documentation explicitly says
that this is an opaque value.

Fixes: QTBUG-118226
Pick-to: 6.6 6.5
Change-Id: Ia2966cecc6694efce66493c401854402658332b4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b30121041c07b1b8613eaf624c9aa55a51001aef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 17:21:06 +00:00
Liang Qi
fe71df81a8 tests: blacklist tst_QIV::focusNextOnHide() on Wayland
Task-number: QTBUG-107153
Pick-to: 6.6 6.5
Change-Id: I8b79e74369689a549c5481b44830374215acf59b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b0d9b2278b4060185e6bcba25d91a6ed12e5f023)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 17:21:06 +00:00
Marc Mutz
40a11d7eba QRestReply: fix "No relevant classes found." moc warning
QRestReply is no longer a QObject, so remove the includemocs line from
the .cpp file.

Amends 9ba5c7ff6aa42c5701cf950d2137467a2d178833.

Change-Id: I6c0ba6b9e3b82f84f3b509755e7da5b33e607776
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 2ff93ea0eeddc9c4c01c194e5af2a2c4506a9d9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 13:48:27 +00:00
Alexandru Croitor
77ec2ccc59 CMake: Move most of CMakeLists.txt into QtBaseHelpers.cmake
Change-Id: I19761dbeebdd2529ef0c493a9a61a1c6fe58667b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit d298a05ed1f86d4789c81877990dfd8965457d74)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 13:48:27 +00:00
Timothée Keller
12039bcff4 Windeployqt: improve multiple directory warning
The multipleDirs warning was added to avoid surprises related to where
windeployqt would deploy files when using binaries from different paths.
To do this properly, make the warning message more meaningful, and
suppress the warning when the --dir option is specified, i.e. when the
user is already explicitly choosing where to deploy.

Pick-to: 6.6
Change-Id: Ie2984f4af740776c568610370d49ad4ff85ffff0
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit a88b6bca21498f367908feedf660243eaf1d613d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 10:20:20 +00:00
Tor Arne Vestbø
c24ab294ba Delete QComboBoxPrivateContainer while the combo box is still alive
Destroying the QComboxBox will, once it reaches the QWidget destructor,
close all popups, including the QComboBoxPrivateContainer, which emits
signals on behalf of the QComboBox, that is now gone.

Regression after d8e110054876b1cbf186e95bac5561a237ee1c13.

The old-syle signal-slot syntax had the advantage of not delivering
signals to slots in derived classes after that derived class's
destructor had finished running (because we called via the virtual
qt_metacall). The new syntax made no checks, so a conversion from the
old to the new syntax may introduce crashes or other data corruptions
at runtime if the destructor had completed.

See 0e72a846d379ba02ff80ecac2526640a05b872b6.

We also need a QPointer for the QComboBoxPrivateContainer, as the
container may be deleted from outside QComboBox, as seen in the
tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget() test, where
the QGraphicsProxyWidget proxies the QComboBoxPrivateContainer.

Pick-to: 6.6 6.5
Change-Id: I7590cc2821c73a6762f281504aa62f0c2b472252
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit fde358dd9069d0695f113ec6ba98efebedd1e520)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 10:20:20 +00:00
Marc Mutz
1b37133aca QTest::qWaitFor: scope a variable tighter
When fa296ee1dcf4c16fb6f242cf08949485e499fec3 ported this function
from int timeout to QDeadlineTimer, the need to keep this variable
outside the do-while so it could be checked in the loop exit condition
fell away.

Moving the definition of the variable to the first (and only)
assignment makes the code clearer and the variable a constant.

Amends fa296ee1dcf4c16fb6f242cf08949485e499fec3.

Change-Id: I7a0fe01dc68ff140beeb0e76b141c84d4bd28458
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit ef7b641a3cf267e256468f9a6269a9bcf7656aa9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 10:20:19 +00:00
Alexandru Croitor
a7be16764d CMake: Make a few more auto tests standalone
Change-Id: I80988114bd906447a2ab712d5432a489e095a5c1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit fb69efb9c9ea2f96c1fe534274e94697c2092c2f)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-14 11:20:19 +01:00
Alexey Edelev
a14e80ee05 Fix the condition for creating of the plugin init target aliases
Make sure that plugin_init_target is not empty. It's empty when
creating qml plugins.

Amends 566b726b8400d473861a62b4b9de87d1f0958d6d

Change-Id: If23998d50d8d31e20b3966730afb8b4b46b9990c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit e7d7eded4ce64896d98dbc92ac1c1f21aae52b06)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 07:15:14 +00:00
Thiago Macieira
e5b3dca681 QTimerInfo: correct CoarseTimer beyond the [20ms,20s] range earlier
Simplifies some code.

Change-Id: I83dda2d36c904517b3c0fffd17b3d18f2dfbc2b3
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit afa86c60e6b6513c5c34b3832a5ece526c071c3f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-14 02:45:59 +00:00
Tinja Paavoseppä
dc5894b865 Android: Resize QWindow when its QtView is resized
If the Android View is resized, the QWindow instantiated by it
should be resized accordingly.

Task-number: QTBUG-122626
Change-Id: I7bfbca149f927718d1e28cdabfa8759afbd06039
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7942f7eedf4a8d7fac82737ea490f3c443e82149)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 17:15:30 +00:00
Tinja Paavoseppä
589529e728 Android: Synchronize window creation in QtEmbeddedDelegate
Qt window loading is initiated either when the QtView is attached
to its Android window, or when the Android QPA plugin has been loaded
and is ready, depending on the order. Since the window attachment
happens in the Android UI thread, and the Android QPA plugin callback
happens in Qt thread, add synchronized block to make sure the execution
stays ordered.

Fixes: QTBUG-122626
Change-Id: Id476032f02aa8990432a02f62b6bf6237a17e7ac
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit d899cdb3a4dc9eb1ad489f7541244110e7e80f61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 17:15:30 +00:00
Thiago Macieira
a2d67a2671 QProcess/Unix: fix close() on invalid file descriptor
Commit 90bc0ad41f9937f9cba801b3166635f6f55e0678 ("QProcess/Unix: add
failChildProcessModifier()") added this line that set childStartedPipe
so that the failChildProcess() callback had something to write to. But
we left it set on exit from QProcessPrivate::startDetached(), which
caused the QProcess destructor to try and close it.

Noticed when debugging the issue for QTBUG-123083.

Pick-to: 6.7.0
Task-number: QTBUG-123083
Change-Id: I6818d78a57394e37857bfffd17bbc41c8400270f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 0f56502fb6f062c6d2308198c93412c34525125b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 17:15:30 +00:00
Kai Köhne
a7a2cf8746 Use canonical capitalization of Unicode-3.0 SPDX tag
The SPDX database lists the license as 'Unicode-3.0', and 'Unicode
License v3'. Now, the SPDX standard actually says that

   License identifiers (including license exception identifiers) used
   in SPDX documents or source code files should be matched in a case-
   insensitive manner.

But the website at https://spdx.org/licenses/ doesn't treat it this way,
so the link we generate out of the identifier actually gives a 404. So
it's just easier to use the 'original' capitalization.

Amends 063026cc503

Pick-to: 6.6 6.5
Change-Id: I826077a914721b7b9499ad62c08fdf20be94e88d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 39c4c868a4c1acb5cceb00418b2bb0ca3836d0a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 17:15:29 +00:00
Assam Boudjelthia
2ba01c7ace Android: don't add lib prefix to loaded libs unconditionally
Some libs don't necessarily have the lib prefix in their names,
3rd party libs and Qt for Python might have that, so no need to
always add that prefix to loaded libs is the lib name already
contains a .so suffix.

Fixes: QTBUG-123286
Pick-to: 6.7.0
Change-Id: Ib65215d9b4410c5c9e00aa0642f48ab45c92fe03
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 4bb4d015f7e855015f8dc32d658518d5ec3556bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 17:15:29 +00:00
Paul Wicking
d224becf72 QDoc: Drop default arguments from some \fn documentation strings
In the \fn commands for a limited number of methods in the
documentation for Testlib and Widgets, `= 0` is passed as default
argument instead of `= Qt::KeyboardModifiers()`. Until QDoc with Clang
17, inclusive, QDoc generated the correct signature. However, with
Clang 18, QDoc outputs `= 0` in the documentation. While strictly
speaking still correct, this change impacts the documentation
negatively in terms of readability.

Dropping the default argument from the \fn command ensures that QDoc
generates the right signature with both Clang 17 and Clang 18.

Task-number: QTBUG-123130
Change-Id: I94ccec2f2c9a02241095fb5b18feb74aa55f97e1
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 08e6d4b43d7959e87c4bd6e13165025f24eafd13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 17:15:29 +00:00
Mikko Hallamaa
d33437c4f9 OpenGL: Add parameters to choose FBO grab orientation
We want to be able to pass as an argument whether the texture grabbed to
an FBO is supposed to have a flipped y-axis or not. This is required for
screen capture on the EGLFS platform.

Task-number: QTBUG-121835
Pick-to: 6.6 6.5
Change-Id: I6dddc879a4be7ff2c2c189747193423644be55a0
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
(cherry picked from commit 342ae435a198acdd794e575dc54ccab1d33b320b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 17:15:29 +00:00
Alexey Edelev
2a0d34373e Collect CMAKE_MODULE_PATH from QT_ADDITIONAL_PACKAGES_PREFIX_PATH
This is sensitive for the 'include' calls that expect cmake scripts
to be found in some staging prefixes. In yocto
QT_ADDITIONAL_PACKAGES_PREFIX_PATH points to the package image
path(installation snapshot). If repo provides bundled 3rdparties
the 'include' statement that includes 'FindWrap<3rdparty>ConfigExtra'
is unnable to locate it, since it's expected to be found in Qt
installation, but the file didn't land there at ptest stage.

Fixes: QTBUG-122205
Pick-to: 6.6 6.5
Change-Id: Idd03f44efd2e3fdaa476873068c73ac28cd0a7b5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 8db0a12e84075e0e41f6a92027df74fe2b2d2182)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 17:15:29 +00:00
Wladimir Leuschner
b79cd66130 QWindows11Style: HighDPI aware scrollbars
Draw scrollbars and scrollbar handles on sub-pixel coordinates to be
HighDPI aware.

Change-Id: Iab7c8566f31a58f83d03ec6644be68bf130682ce
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
(cherry picked from commit 91df9d1bbf05e69348953ff6b53a7d060d4a987d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 14:05:15 +00:00
Wladimir Leuschner
0ce2ed6f60 QWindows11Style: HighDPI aware progressbars
Draw progressbars and progressbar handles on sub-pixel coordinates to be
HighDPI aware.

Change-Id: Ib4f39c3b3a05d9f47c045dd6032d7544b7add175
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
(cherry picked from commit a1d18276a84f0f72af48c3b899c80d4b9407ef4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 14:05:15 +00:00
Mårten Nordheim
518ce19c75 Http: fix issues after early abort()
There were a few issues to deal with. One of them was that we would
print a warning about an internal error if we tried to *set* an error
on the reply after it had been cancelled. That's kind of unavoidable
since these things happen in different threads, so just ignore the
error if we have been cancelled.

The other issue was that, for a request with data, we will buffer the
data to send, and _only then_ do we start the request. This happens
asynchronously, so the user can abort the request before it has finished
buffering. Once it finished buffering it would set the state of the
request to "Working", ignoring that it was already marked "Finished".

Fixes: QTBUG-118209
Fixes: QTBUG-36127
Pick-to: 6.6
Change-Id: Idbf1fd8a80530d802bee04c4b0a6783cba4992d3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit be6644c1f254cce796c43d7c1eae3ae794bb77be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 14:05:14 +00:00
Mårten Nordheim
3789e5972e tst_QMutex[qnx]: increase system timer resolution
I don't know what it is but it's not 1, because it is quite
often flaky in these tests. A single failure leads to deadlock
that takes 5 minutes to fail. Then a rerun might do another
5 minutes and fail the integration, or it will pass but take
longer to do so.

Pick-to: 6.6 6.5
Change-Id: I188276df7800b00a20dbe39edee91c582f0a82a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6aee3342e9d0829bb113583c2b6ecc6c94492d2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 14:05:14 +00:00
Mårten Nordheim
1fd6f41eb2 tst_QFactoryLoader: includemocs
For some reason android in CI failed to include the
moc file through the mocs_compilation file.

It's an issue that needs some investigation, but
in the interest of time just include the moc file
directly.

Pick-to: 6.6 6.5
Change-Id: I079588598a6f4137ef1fccc482795d703b59bc6e
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c468dfedd6413994a72c41a53eadd1944eb52e6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 14:05:13 +00:00
Mårten Nordheim
f500429ace QHttp2ProtocolHandler: prevent truncation in arithmetic operations
On 64-bit systems, both the requests.size() and the
activeStreams.size() were truncated to uint32_t values from int64_t
ones. While extremely unlikely that either will contain more than 4Gi
elements, avoid the truncation by verifying that the `max` amount of
streams is larger than the activeStreams, and then using size_t for
the range.

Change-Id: I50644cb634bab0f020acf9aea1d03744b11dbe51
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 22c99cf498103c86baa5a415ca34630396e5b6aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 14:05:13 +00:00
Mårten Nordheim
d97be285dd tst_QNetworkReply: update and speed up httpConnectionCount
Because we will do a small wait after the final connection (to see
if there are any unexpected extra connections) we can save some time
by reducing _how long_ we wait for it.
In general we only need an extra long wait for the first connection,
subsequent connections are faster.
So we change the loop structure from looping until we hit 20(!)
connections, when anything larger than 6 will fail the test anyway!
And use qWaitFor instead of repeatedly calling enterLoop and checking
the state of an ElapsedTimer, the total wait time is not super
interesting, and made it a guarantee that the test would take 10
seconds.

While we are here, update the attribute we use to test HTTP/2
connections. We were previously enabling http/2, but this is the new
default so it's not needed. We do, however, need to enable h2c if we
want to see it trying to upgrade to http/2 over cleartext.

Not a big issue, so we don't pick it very far back.

Change-Id: Ia314ae2827ab8a8baaa4af2c5136c5e531bcb1f8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 8de1ed89797cabc883b5651673daa747f6ee9c0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 14:05:13 +00:00
Lucie Gérard
0b71dbd1ad Correct license for statically compiled helper file
Task-number: QTBUG-121787
Change-Id: I19222cbe8a45a27853933191677f433dd0a60771
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 05ed4a85bfb7afa2643c6fe8263cadf66ef783b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 14:05:13 +00:00
Marc Mutz
4247cbf2b2 QLibrary: fix Clazy warning about QString(const char*)
Wrap dlerror() in QLatin1StringView(), like we already do in
unload_sys().

Amends a6a56814702612d8981f594a6158d70a7928cb99.

Change-Id: Ia8c91d6962c74d5916c47b2abbb3920f051c8e5e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 097f0edc9ff2a53c55395a5ef9dd20f7763d84b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 10:24:05 +00:00
Marc Mutz
d9da7c9362 QTest::qWaitFor(., int): restore lost Qt::PreciseTimer'ness
Before the qWaitFor() port from int to QDeadlineTimer, the
implementation constructed a QDeadlineTimer internally, passing int
timeout and Qt::PreciseTimer. The int overload that was retained for
source-compatibility, however, constructs the QDeadlineTimer without
the PreciseTimer flag, which is a behavior change.

Restore the Qt 6.6 behavior and pass Qt::PreciseTimer.

Amends fa296ee1dcf4c16fb6f242cf08949485e499fec3.

Pick-to: 6.7.0
Change-Id: Ib8e5b912c74b70d32a77195edb0d2a30cd7c241d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 73c52ba2687c2035a40141f2a5236399f8331f4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 10:24:03 +00:00
Alexandru Croitor
651c0fd223 CMake: Use qt_internal_add_example for bindableproperties
bindableproperties is the actual project, not a subdirectory with
separate examples. It should use qt_internal_add_example.

Pick-to: 6.6
Task-number: QTBUG-90820
Task-number: QTBUG-123096
Change-Id: I409d20e035956e6c236f84721b3c6882893cd547
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit a2e0f3dfbd9f54e20221dbc04360f838b5fa5343)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 09:42:40 +00:00
Thiago Macieira
571c71407d tst_QStorageInfo: try harder to make the free space change
This merges the tempFile and caching tests, which had been updated in
commit ae03ffaffdcc8b2a0589b846e16ad016691dec29 to attempt other
filesystems than APFS and btrfs.

Instead of adding yet another item to the list (xfs), let's insist by
writing more and flushing the OS buffers. Local testing says that btrfs
usually updates after the first write(), no later than the second, and
that APFS and XFS "just works" now (without the fsync() even).

Fixes: QTBUG-123151
Change-Id: I6818d78a57394e37857bfffd17bbe7427307efc4
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 025c45d628ae42989f50df10ca6c75ad1007614f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 00:19:52 +00:00
Dennis Oberst
532e562b91 qstringalgorithms: include <iterator> in favor of <string.h>
The switch from <string> to <string.h> dropped the definition of
std::size. Include <iterator> since <string.h> is no longer used to
pull in std::size.

Amends: dc2ae08e02730ab795445bc047221aa56914f723.

Change-Id: Ib742538eb5d21c77fcae7ee9abb6d5329bbcfd63
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit dea548ef040c95d6fd6796051b12f148372b0f22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 00:19:50 +00:00
Ahmad Samir
b6a5528369 tst_qfile: fix GCC 13.2.1 compiler warning [-Wenum-compare]
By using "wt" for all OS's; according to Thiago the 't' is ignored
everywhere except on Windows.

tests/auto/corelib/io/qfile/tst_qfile.cpp:2846:70: warning: comparison
between ‘enum QOperatingSystemVersionBase::OSType’ and ‘enum
QOperatingSystemVersion::OSType’ [-Wenum-compare]
2846 |     const char *openMode = QOperatingSystemVersion::current().type() != QOperatingSystemVersion::Windows
|                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Amends 3446313c7a5cd6005089866a7b20c9f28e132a0a

Pick-to: 6.6 6.5 6.2
Change-Id: I310d7d6ce3833756ffdc47b000e052ef3afdfdef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d7340d5c31c8ce79724af9592453d3cf55262fa4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 00:19:48 +00:00
Alexandru Croitor
cac3d31988 CMake: Create alias targets for plugin init targets
When building tests in-tree targeting iOS, we run
_qt_internal_finalize_executable via
qt_internal_add_test_finalizers.
This in turn calls __qt_internal_apply_plugin_imports_finalizer_mode
which tries to link to versioned plugin int targets.

Because the linked plugin init target is built in-tree as well, and
did not have versioned alias targets created, configuration fails
with:
 Target "tst_baseline_qsvgrenderer" links to:

    Qt6::QSvgIconPlugin_init
 but the target was not found.

Make sure to create versioned alias targets for the plugin init
targets.

Amends 6c9f4f5ebcd35dc1a68c442d9fbf3ec48f30baca

Fixes: QTBUG-123186
Task-number: QTBUG-122181
Change-Id: I0048b724d465dc3c176d238d144feb072262d76e
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 566b726b8400d473861a62b4b9de87d1f0958d6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-12 20:51:54 +00:00
Ivan Solovev
287cff7169 QCborStreamReader: rename toStringish() -> readAllStringish()
Amends 8af346c1f66f813c3c8fe4d8b892ecfbe96eacfb and
1d9137e13f9eb3f183c967e9e911c5b260f93dc0.

Found in 6.7 API review

Task-number: QTBUG-123115
Pick-to: 6.7.0
Change-Id: I98d79274f26f3439302a59181401b6e244fe5202
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1c9e155b0571ece99ca350cc5f43af4fa8d64e4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-12 15:39:25 +00:00
Ivan Solovev
2d101abed4 QCborStreamReader: rename appendToType() -> readAndAppendToType()
Amends ff034ebbfa7c1cc47cdcc15bc854972cd960db1a.

Found in 6.7 API review

Task-number: QTBUG-123115
Pick-to: 6.7.0
Change-Id: Id5e95aacffcb633701d4d635d2bf8af70984903e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cc911328648929552664707d7beccaa87fc96564)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-12 15:39:19 +00:00
Thiago Macieira
2b13207c2e QProcess/Unix: fix improper restoration of signal mask and cancel state
By just moving the handling of the child process' desired target
directory below the initialization of either the signal mask and PThread
cancel state, without that "return".

Commit 52ed6af5277100ed5b9a4f4231b94013ce539a2c ("QProcess/Unix: merge
some code from startProcess() and startDetached()") introduced
QChildProcess and merged the functionality of PThreadCancelGuard into
it. But it added that "return;" to the code path failing to opendirfd()
the target directory, meaning that the QChildProcess constructor could
exit without calling disableThreadCancellations(), but the destructor
would still run restoreThreadCancellations() every time the opening
failed. And we have tests for that: setNonExistentWorkingDirectory and
detachedSetNonExistentWorkingDirectory.

For the cancel state, the uninitialized variable we ended up passing to
pthread_setcancelstate() was probably harmless, because the cancellation
state is almost always active and the variable would have been non-zero.
And we don't test pthread cancellation, so we would never notice the
problem.

But commit bd32c7d7055b436b8c33486a5b5ce1c29db77fd4 ("QProcess/Unix:
block all Unix signals between vfork() and exec()") introduced a block
of the Unix signals with the same uninitialized variable problem. Unlike
the PThread cancellation state, the original signal mask would usually
be empty, so the "restoration" would actually mask signals we wanted.
And one such important signal is SIGCHLD, used by QProcess/forkfd when
*not* using vfork semantics. This meant that tests that had a child
process modifier (meaning, they wouldn't use vfork semantics) would end
up timing out because we'd never get the SIGCHLD that told us the child
had exited.

Fixes: QTBUG-123083
Pick-to: 6.7.0
Change-Id: I1362eb554b97dc012d02eab2dbca90b06728460e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 418dcf88f827effb2981dcd1699b395e2aeaac2f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-12 15:33:48 +00:00
Mårten Nordheim
58991ca2ae Schannel: fix handling of empty ciphers list
Contrary to OpenSSL the new ciphers support in Schannel
would disallow all ciphers when the list was empty.
The pre-existing behavior was to use the default list.

Amends f7792d2b6d3d1e5dd47a8f6429b817b793bcfb9b

Change-Id: I0e79013ac86261c4afa4affb28cb1838177c12de
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 2d521002ca024b71525036a0a6f5d02bb09b3ed7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-12 15:33:09 +00:00
Jani Heikkinen
e537c88234 Bump version to 6.7.1
Change-Id: I87a3bc8e4d8a42a9812884d08bf6b5619a32573a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2024-03-11 08:25:45 +00:00
Christian Ehrlicher
da59bc3434 QStyleSheetStyle: don't draw check indicator twice
When the styled check indicator is smaller than the one from the base
style, then the clip region was to small and the check indicator from
the base style was also drawn. Therefore add both check rects to the
clipRegion.

Pick-to: 6.6 6.5
Task-number: QTBUG-102820
Fixes: QTBUG-122821
Fixes: QTBUG-122825
Change-Id: I1b5b8d70d66475bbfa4a40652dc3fdd4cc670c32
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1ac58f4ba343d0de74cfc879a13a751bcb49c316)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-10 14:02:37 +00:00
Christian Ehrlicher
d100f591f1 Don't show mnemonics in dockwidget titles
Dockwidget title accelerators doesn't work in dock widgets, so don't
show them.
This amends cc67b25579c1bb5ea9f5c1ca4c9b7997e66f19b9.

Fixes: QTBUG-86407
Pick-to: 6.6
Change-Id: I83fb2da1304d1e2b5eedfc127e5db3d322756d06
Reviewed-by: Sune Vuorela <sune@vuorela.dk>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e68c3f025ecc7cf1fa86e5e773cee8d61a816f61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-10 14:02:35 +00:00
Giuseppe D'Angelo
712eb47886 PNG: preserve ICC profiles that QColorSpace does not handle
QColorSpace::isValid() returns true if QColorSpace can handle the
profile. When called on a QColorSpace obtained via
QColorSpace::fromIccProfile, this doesn't necessarily mean that the ICC
profile itself was invalid; it could be that the ICC data was valid, but
QColorSpace didn't know how to use it. This is especially true on Qt <=
6.7, where only XYZ/RGB matrix profiles were supported.

We don't fully parse ICC v4, and we're lacking an API to differentiate
between "ICC data was valid but QColorSpace doesn't handle it" vs "ICC
data was invalid".

Still, an invalid QColorSpace will still the original ICC data, so it
can be saved again without loss of information.

So: 1) when loading a PNG with embedded ICC data, keep the loaded profile
even if it's "invalid"; 2) when writing a PNG, check if we have ICC data
to save, and unconditionally write it if it's the case.

This avoids data loss in the two directions.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Pick-to: 6.6 6.5
Change-Id: I1f27f603acbca1590c820e80f52f3b994f5ea5c7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 003cef9d40f2e840f2690bd465994deaab5c2b95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-10 13:48:44 +00:00
Cristian Adam
1fb2c58ef3 Android: Do Thread.sleep before loading Qt libraries in Debug Mode
Amends 269187bfa272f9456aad6a6233100d846915f175 which added the sleep
but just loading the main library.

This commit moves the delay before any library is being loaded. Also log
the fact the thread is sleeping and advertise how to use the env
QT_ANDROID_DEBUGGER_MAIN_THREAD_SLEEP_MS variable.

Fixes: QTCREATORBUG-30425
Pick-to: 6.7.0
Change-Id: Ic1370e0b9fcce8c6074f768e5d94e5aa4a0a7824
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0804109d686e0a99ab0de0f1c70e3422183c6e98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-10 08:09:32 +00:00
Michał Policht
fdcebd63cd Windeployqt: introduce --include-soft-plugins command line option
Some plugins may have dependencies on additional Qt modules. This is
handled by deployPlugin() function. Existing code does not look for plugins
associated with these modules however, because the loop iterates over
plugin directories only once. This change introduces an option that will
make windeployqt take into account all such soft dependencies by making
recursive calls to findQtPlugins().

Task-number: QTBUG-121583
Change-Id: Id6535426a47f9b92a3035e864dfdd7577b82c9ad
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
(cherry picked from commit 5010eda5345bdbfc12e134d6fb3ae5b7370e2185)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-09 00:10:15 +00:00
Timothée Keller
acb5a72ef0 Windows QPA: Include custom margins in atypical margins
When calculating atypical margins that are used with
ExtendsContentIntoTitleBar, the margins were checked against
systemmargins, and then custom margins were added later. Instead, add
the custom margins immediately and take them into account during
calculations.

Pick-to: 6.7.0 6.6 6.5
Change-Id: I44af663c85b8bdf080d769e3b38431cbe5df64f3
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 82e8f9e4571c50be476f8e38f9239c5b0c6be32c)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-08 21:22:11 +00:00
Eirik Aavitsland
bcc5817614 Avoid QRubberBand leaving artefacts in QListView
On hidpi screens, the painted edges of the rubberband can extend
beyond the selection rect because of scaling. Extend the area to be
updated by 2x frame width, when the rubberband changes.

Fixes: QTBUG-113432
Pick-to: 6.6 6.5
Change-Id: Ie7aec1fefdc3fbf71c63952b693f462697adf849
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit a5a6b657a799cbed4567f60342714df52f9c8891)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 20:51:22 +00:00
Edward Welbourne
b93e7619a4 Correct documentation of QDateTime's comparisons
These previously claimed that date-times with different date, time or
zone are different; as pointed out by Marcus Tillmanns, this is not
true. Corrected the documentation to talk about representing the same
moment in time.

In the process, renamed the snippet shared with several other docs,
since the snippet name only focused on the other part of what it was
saying.

Pick-to: 6.6 6.5 6.2 5.15
Fixes: QTBUG-122973
Change-Id: Ifd74da84aad0b0dca688c131b6ae6a7b65633225
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cb5aac06cf7b3982a42004fd7455d78a3caba550)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 18:38:48 +00:00
Giuseppe D'Angelo
23d7faa8a1 QObject: fix a documentation note in the destructor
The docs for ~QObject say:

> any pending posted events for the object are removed from the event
> queue

but then they also say:

> Deleting a QObject while pending events are waiting to be delivered
> can cause a crash

These two contradict each other. In fact, the first one is correct, the
second one is factually incorrect. Amend it to what I believe it's the
intended meaning: do not destroy a QObject which is _handling_ an event
(i.e. we're into QObject::event() or an override).

Change-Id: Id1d564f296e17a764e0f49ebfedf6e292085c221
Pick-to: 6.6 6.5 6.2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shantanu Tushar <shantanu.tushar@kdab.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 6e0c438a41a61a3d0a93954f00f46951c4399224)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 18:38:48 +00:00
Wladimir Leuschner
f148aa073e QWindows11Style: Update font size in menubar items and spacing between items
Reduce the spacing between menu bar items and change
font size to 10pt.

Fixes: QTBUG-120639
Change-Id: Ic16e74f4a2426be6d6ef40904919d92785d96ce5
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit f75e554c6af7ea00bb5e6aa62a2af26350b67d98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 18:38:47 +00:00
Lucie Gérard
f3a66b2763 Add a licenseRule.json file for checking of SPDX license identifiers
The license test in qtqa reads this file
in order to check the validity of the license used.
This file reproduce the QUIP-18 [1] rules, with some exceptions.

Each entry in the file corresponds to a set of licensing rules.

A set of licensing rules can depend on the file ending,
registered in "file_pattern_ending". The last entry in the
file has no "file_pattern_ending", it sets the rules for the
files whose licensing does not depend on their ending.

The license to be used depends on the location
of the file within the Qt module repository.
Let's call this "<true_location>".
The  "<true_location>" can also correspond to a file name,
offering flexibility for exceptions to the rule.
The "<true_location>" are registered in "location".

For each "<true_location>" there is a
"file type" entry and a "spdx" entry.
The "spdx" entry gives the rule:
the expected license tag(s) in SPDX format
for the file ending (if applicable) and "<true_location>".
The "file type" informs on the QUIP-18 type
the tested file corresponds to. It is purely informational
for the reader.

The set of rules are tested in order of appearance
in the json file. For this reason, a more constraining
ending (like "special.txt") needs to appear in
a "file_pattern_ending" located before
the "file_pattern_ending" of a less constraining ending (like ".txt").
Also, a file ending cannot be present in two "file_pattern_ending".

"file_pattern_ending" and "spdx" should list strings.
"<true_location>" can be regular expressions.

During the test the deeper "<true_location>" are
checked first. The order is which they appear in the json file
does not matter.

To test this file, run
QT_MODULE_TO_TEST=../qtbase perl tests/prebuild/license/tst_licenses.pl

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121039
Change-Id: I720800507622701b80c76e78e68817c6c39c2407
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit d5d1bfd8e87a718145d1d8e3161fdf44ed1a804b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 18:38:47 +00:00
Friedemann Kleint
60d91acc0a Fix menu size in multiscreen setups
During QMenuPrivate::popup() and QMenuBarPrivate::popupAction(),
QMenuPrivate::popupGeometry() is called from updateActionRects() with
screen = 0 several times (from sizeHint() and various event handlers
triggered), which causes it to return the primary screen geometry
always.

To fix this for the non-QGraphicsView case, use the screen of
the menu when it is visible or the screen stored in a newly introduced
popupScreen member variable, which is set from a few places
in QMenuPrivate::popup().

Fixes: QTBUG-118434
Pick-to: 6.6 6.5
Change-Id: I6b18593d313719d628b0856004197ac59f46c270
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 8cd7a3d4723ca414f3fe544704a0ccb752da94b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 18:38:47 +00:00
Lucie Gérard
ff18cb7481 Correct license for examples files
Example takes precedent over build system file type.
According to QUIP-18 [1], all examples file should be
LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: Id348a89884bb309b96abb31077f14a51086b5d0c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit c2333f312ff05d592e44e8b10591e3568b8d9a26)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 18:38:46 +00:00
Lucie Gérard
d6414a02e9 Change license for .in files
According to QUIP-18 [1], all build system files
should be BSD-3-Clause.
The files in this patch are part of the build system.

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7.0
Task-number: QTBUG-121787
Change-Id: Ibc6a60a9b009fab0c953e8e3269533c121e4511e
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit bf1e76408e07ac175ee467c5095e88209d9a6ba8)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-08 18:38:46 +00:00
Lucie Gérard
d289d35183 Correct license for tools files
According to QUIP-18 [1], all tools file should be
LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Pick-to: 6.7.0
Change-Id: Icd5d5be2e04819617e68ff142924de1773bebbad
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 7b6289a0358274ec3c37cabd5b7d7212508a4e8a)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-08 18:38:46 +00:00
Morten Sørvig
4f8d01b436 wasm: send DPR change event on window update
Qt Gui expects that the platform sends DPR update
notifications if the DPR value has changed, before
sending expose/paint events or delivering update
request events.

The most straightforward implementation is to send
the DPR update event unconditionally and let Qt Gui
determine if the DPR value has changed, especially
if the native platform does not provide DPR change
events.

Pick-to: 6.6
Change-Id: Ica7a24a458b3b01f1c7b2e1e09d342114dc71331
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b8584173ab6a3fc4e034bc237b34f4968528b0f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 18:38:46 +00:00
Andy Shaw
be78514b20 XCB: Unset the connection's mousePressWindow if it's this window
In some rare cases it can delete the window before this is handled by
other calls, so rather than crashing we clean up.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Iddcd9890f0c13f4130626b0ed9c5b32f5890208d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b8f9a8681347476f4db1719b38a67d7f9d3c74be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 18:38:45 +00:00
Giuseppe D'Angelo
d1825d82ec Realign columns in the configure-cmake-mapping
Change-Id: Ie7c3c35b6e5a8d02d05650b86f6c2d47b72c3835
Pick-to: 6.6 6.5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9069b7fb20fe46f6e7b74c23d052274a8c5cf8dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 18:38:45 +00:00
Wladimir Leuschner
0ea3df975e QWindows11Style: Draw ScrollArea opaque in QAbstractItemView
Change-Id: Ica2c62355a576dda4eaefacbc41b8609009d0073
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 91b04d5cf1643831df10c43807603f678aa61016)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 12:57:21 +00:00
Giuseppe D'Angelo
21c3f17eaa QGlobalStatic: suppress -Wtsan warning
QGS employs a call to std::atomic_thread_fence. Unfortunately TSAN does
not support it, and GCC >= 11 raises a warning. This breaks the build
when building under -Werror. Suppress the warning using the usual
pragmas.

There's a catch: qglobalstatic.h is built into a PCH, and GCC <= 13
will still generate a warning because of
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431 .

Change-Id: I770f39b7563b66f483851444cd580bcafc5f288a
Pick-to: 6.6 6.5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 143bcbb96f512d8e4014f0abba99f8e7a8729499)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 12:46:38 +00:00
Juha Vuolle
032e127ad5 Bump Android platform version in documentation to 34
The supported level since Qt 6.7 is 34

Fixes: QTBUG-123059
Pick-to: 6.7.0
Change-Id: I5821dd78e43a6e487e1e8d4b55fd2022b2f91a89
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 419a1844afdee8deabb3648821d4e1b47e15233d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 12:46:36 +00:00
Cristian Adam
76c6b71db4 Android: Add Thread.sleep before loading main in Debug mode
This helps with the jdb debugging settling, and the native debugger
can hit breakpoints at the beginning of main() function or in case
of unittests at initTestCase() function.

By default in debug mode the delay is 1000ms. This value can be changed
with the environment variable: QT_ANDROID_DEBUGGER_MAIN_THREAD_SLEEP_MS

Fixes: QTCREATORBUG-30425
Pick-to: 6.7.0
Change-Id: Ica0c6080c55468579a28eecf8f45cff68d99c3a8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 269187bfa272f9456aad6a6233100d846915f175)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 08:20:54 +00:00
Inho Lee
2bbfa7f18d Fix offscreen rendering in QOpenGLWidget
Amends 68a4c5da9a080101cccd8a3b2edb1c908da0ca8e

In a case sharing QOpenGLContext,
offscreen renderings cannot get QOpenGLContext from Rhi.

Fixes: QTBUG-123005
Pick-to: 6.6 6.5
Change-Id: I9baae5e5c77878885f73ee39df5cd39117e8f1c2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 50c81f549030aba3c29f8cd161662b019028e91b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 05:50:11 +00:00
Mitch Curtis
617aa644c0 configure-cmake-mapping.md: add -qt-host-path and -DQT_HOST_PATH
Pick-to: 6.6 6.5
Change-Id: I6deb7b648c39adb8fb2765de5be29b0743ef2836
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d130886997575ee1ffc20bfcfb6344526ca28533)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 04:47:02 +00:00
Axel Spoerl
1e89a6e587 QDialogButtonBox: Don't set focus in a dialog with StrongFocus children
A QDialogButtonBox with the first accept button becoming default, didn't
explicitly set focus on such a button in a QDialog.
d44413d526ec12ed83acd7343c2005782178c7ad implemented this missing
functionality. It set focus to the automatic default button, unless the
QDialog had a focusWidget() set.

That has caused a regression, in cases where
- the QDialog has a QWidget child with a Qt::StrongFocus policy, and
- the QDialog is not yet visible, so focusWidget() returns nullptr.

Amend d44413d526ec12ed83acd7343c2005782178c7ad:

Implement a helper in QWidgetPrivate, that returns true, if a child
with a given focus policy is found.

Do not set focus to a QDialogButtonBox's automatic default button, when
- not located inside a QDialog, or
- a focusWidget() exists, or
- the dialog has QWidget child with Qt::StrongFocus, that is not a
child of the QDialogButtonBox.

Add an autotest function.

Pick-to: 6.6 6.5
Fixes: QTBUG-121514
Fixes: QTBUG-120049
Change-Id: I3c65ae36b56657f9af4a3a4b42f9b66e8bc5c534
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 78a3301372fb9b48dc65b18a19731db37abab75c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-08 01:52:51 +00:00
Juha Vuolle
79fa25249d Remove 'const' from variable that may be moved
std::move on const object is ineffective, and the code will
use a performance-wise costlier SMF

Amends: 0c05d2b43ec5ab29efc3db2718289a5600da754c

Change-Id: Id4a639d9a037c3f1d79ea60faa2715075462fea1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 68ae776e73881cbc160cd747e401631452e7f659)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-07 12:26:42 +00:00
Eirik Aavitsland
e1f069e65d Update bundled libpng to version 1.6.43
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.43

Pick-to: 6.6 6.5 6.2 5.15
Fixes: QTBUG-122989
Change-Id: Id439e64010bc3f6752f5589d663827a91f009173
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 210f2004dffae149c857d8d79d51eb996643ad4a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-07 01:21:29 +00:00
Wladimir Leuschner
44ee8df9c7 QWindows11Style: Draw frames HighDPI aware
Draw frames and lines on sub-pixel coordinates to be HighDPI aware.

Change-Id: Ie4eed73b3e5780216fad0b6a919cbe18391f2b79
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
(cherry picked from commit c785d56ae084d01a565aaf0fa2fa86a0682c461d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 14:13:53 +00:00
Volker Hilsheimer
f26e0996c7 JNI: Fix error with overload resolution when passing string types
The variadic templates are supposed to be removed from the
overload set when any of the parameters is a literal string type,
as otherwise we get conflicts with the legacy overload taking
class names and signatures as const char *. The detection of
a literal string types was missing a few specializations, so that
we ended up with the wrong overload being called, and class
names getting interpreted as method names instead.

Add the missing specializations, and add more test coverage
for using the old overloads.

Task-number: QTBUG-122235
Change-Id: I5488f2009c8f62d74fac6754844f57cf64011414
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Lauri Pohjanheimo <lauri.pohjanheimo@qt.io>
(cherry picked from commit 10afa38aa44231b3617984fdbca66d9699e2825f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 14:13:53 +00:00
Nodir Temirkhodjaev
7c74a2af73 QFutureInterface: Rename "interface" variables to "iface"
On Windows the "interface" is defined as "struct".
Do not #undef it to fix a unity build.

Task-number:  QTBUG-122980
Change-Id: I9379c996d8b67b16a8b825af0ff3469111533291
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1e836fff18ceaea8331711708bdc3d8ea0cc051e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 14:13:53 +00:00
David Redondo
157f7b47e4 Handle drag leave when performing platform drag of docks or toolbars
The existing widget machinery works through mouse positions. In order to
correctly update state  when a drag moves outside of a window it needs
to see a move outside of the window. When the platform drag leaves the
window a move to the outside of the window is now faked to not keep the
layout in the hovered state of the last move event.

Fixes: QTBUG-122944
Pick-to: 6.6
Change-Id: I348f5281a200b78e6be4f11b3c25339d052783a5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d7fe948fdb79e919065875410dba14275a2a7478)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 14:13:53 +00:00
David Redondo
2bc6b25c56 Map drag event positions to global during dock/toolbar drag
Drag event positions are window relatives, QMainWindowLayout::hover
expects global coordinates however.

Fixes: QTBUG-122949
Pick-to: 6.6
Change-Id: I28469ba1b5ef88661e744d4cf87f6acab3eb2c72
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 986de654b8c3af57af6f76581e50ff9e54c98b20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 14:13:53 +00:00
Juha Vuolle
5605c5a32f Add include for QT_CONFIG
To not rely on transitive includes.

Change-Id: I116483f94bba4a6edb0a78941da676b1a3e6e1bd
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit a83248dd9fe9831c72c1781f465b74b6214832a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 14:13:53 +00:00
Alexandru Croitor
ad0c09d363 CMake: Don't add default rpaths to qt qml plugins when requested
qt_add_qml_plugin has code to set a sensible install rpath for user
project qml plugins.

If Qt was configured without rpath support, we should not add any
rpaths to qt qml plugins:
- qt-computed rpaths added by qt_apply_rpaths
- user-project rpaths added by qt_add_qml_plugin

This is done by setting QT_NO_QML_PLUGIN_RPATH to TRUE as part of
QtSetup, effectively applying the option to any qml plugin that is
built by internal qt api.

User projects will still be able to use the default rpaths added
by qt_add_qml_plugin, even if qt itself was configured with no rpath
support.

Fixes: QTBUG-122687
Change-Id: I8178b527553dd00436d0abb3b44061ea16edc121
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 375f3869308fd01c276b17581ef827583550dba3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 10:34:54 +00:00
Alexandru Croitor
56d1754c2e CMake: Fix assignment in internal_get_build_vars_for_external_projects
The check and variable name were incorrect after a refactoring.

Amends ba9623860056cbb75e426e27905f9c29b687cefa

Pick-to: 6.6
Task-number: QTBUG-84884
Task-number: QTBUG-90820
Change-Id: I33b6b81695a6352c7869ef6186e00881b47bd6f3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit aacc31815d40c8f5dbdd998536fb1fcd5f632221)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 10:34:05 +00:00
Giuseppe D'Angelo
c80f475055 QSpan: add construction from initializer_list
P2447 has been merged in C++26, backport the same functionality.

This makes QSpan<const T> a proper replacement for a const QList<T>&
parameter, because now both can be built via a braced-init-list.

  // void f(const QList<int> &l); // old
  void f(QSpan<const int>);       // new

  f({1, 2, 3});                   // now OK

This is, technically speaking, SiC: in the presence of both `f`
overloads, the code above would have called the QList one. Now instead
the call is ambiguous.

We've been there already -- this is QString and QStringView all over
again, and the solution is the same: get rid of the owning container
overload. I'd rather have this construction *sooner* rather than *later*
in order to minimize the fallout.

And just like QString vs QStringView, there's nothing really doable to
prevent instant-dangling situations:

  QStringView v = getString();    // dangles
  QSpan<const int> s = {1, 2, 3}; // ditto

except for using QSpan (QStringView) as a *parameter type only*.

Note that QSpan with dynamic extent was already convertible from
std::initializer_list through its ranged constructor. However this fact
alone doesn't unlock the above syntax. QSpan with a static extent was
also convertible for the same reason. (This is non-standard:
std::span's range constructor for static extents is explicit, but QSpan
doesn't follow that design choice and makes the constructors implicit
instead.)

Found in API-review.

Change-Id: I160ab5b292b0c2568cd9a7ad1b4430085f475c29
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7f7b5ff3a1b617a3a1add1b1b6ad0718f0dcf143)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 10:28:06 +00:00
Marc Mutz
9ea3087d36 Revert "QStringView: simplify the constructor from QString"
This reverts commit 7d18ad49a37440835bb38bd77bc4e0991387ada0.

Reason for revert: This changes the constructor from being a template
to being a normal function, so changes overload resolution. The commit
message gave no indication on why this is safe. Since it's just a nice
to have, revert instead of running the risk of breaking code.

Change-Id: Icd506e7221bb50c99f276f6a43c15403ec0be7a9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit ff7e5987ecdd09f87cfcdb4c42039214627dcdb6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 10:28:03 +00:00
Thiago Macieira
244618c19a QLibrary: remove the unnecessary parentheses around dlerror()
We don't need a message like:

"Cannot load library nosuchlib: (nosuchlib: cannot open shared object file: No such file or directory)"

Change-Id: I01ec3c774d9943adb903fffd17b76599cea47502
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit a6a56814702612d8981f594a6158d70a7928cb99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 10:28:03 +00:00
Thiago Macieira
8007f6acb1 tst_toolsupport: make the i386 case really about i386
Specifically, don't use it for either of the x86-64 ABIs (LP64 and
ILP32). The generic case below should work for everyone.

Fixes: QTBUG-122720
Change-Id: I01ec3c774d9943adb903fffd17b75fc79095e089
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 24245d2a85cbcd503816027067aa72995e3ac2ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 10:28:03 +00:00
Juha Vuolle
aeb51edf33 Add QT_CONFIG(signaling_NaN) around the signaling_NaN limit function
Amends: 398a51686eda225f222d9df7ce56898c18ecdaa1

Found in API-review.

Change-Id: Ia9be5bc5bdcf7aa2960e9c88f961bf8168435a70
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 033b52c0ad06691db97df7f22562716de09758db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 10:28:03 +00:00
Laszlo Agocs
bdf324871a drm: Fix having more than window over the screen's lifetime
...when not using atomic.

On the non-atmic path the fb is passed in to drmModeSetCrtc.
Here we need a new call to it if a new QWindow gets created
after the previous one is destroyed. Previously this was
not done, so it ended up with Device busy errors. Atomic
does not need this since there the flip commit always
contains framebufferPropertyId.

Change-Id: Ie68152cad50438807ef45adfba65e74c8f30c956
Fixes: QTBUG-122663
Pick-to: 6.6 6.5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 818f8de64a2b1a7371ecb4bdd527b05343190582)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 06:35:20 +00:00
Laszlo Agocs
e3b2386dd7 drm: atomic: Avoid device busy when flipping after creating a new window
Task-number: QTBUG-122663
Change-Id: I168930428e8d09a9a042401460d678e20f3b82d5
Pick-to: 6.6 6.5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 0a3b5042a566afa4dc5162f469eb0d8be3120933)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 06:35:19 +00:00
Samuli Piippo
bfb6f4e86c CMake: add options to not generate target wrappers
The target wrappers for qmake and qtpaths do not work on Yocto
builds and only create confusion when they are available in target.
Add option to disable their generation.

Task-number: QTBUG-122420
Change-Id: Ibb829cc846ad6c470fe29e746ade42fccaa33a6f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 762c56d65bf2bf430621f6bed8f6d96ee333e718)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-06 06:35:19 +00:00
Marc Mutz
2f50deafbf Revert "Fix export of QDeferredDeleteEvent, should be Q_CORE_EXPORT"
This reverts commit bc3b18764aabf95a50a65e090863c54b6ac57e3e.

Reason for revert: QDeferredDeleteEvent changed the size in 6.7. It is
more important to protect the casual user that relied on the mention of
the otherwise undocumented class in the QEvent::Type::DeferredDelete
documentation than to be convenient for one tool, developed by experts
who know how to replace their dynamic_cast with a type() check and a
static_cast and/or extract information from an unexported class.

In fact, not even the autotest-export is needed, as there are no
mentions of the class outside of comments outside QtCore. 

Found in API-review.

[ChangeLog][QtCore][QDeferredDeleteEvent] Made this undocumented class
private and unexported. You will still be able to see the definition in
qcoreevent_p.h, but you won't be able to create objects of the class
anymore.

Manual conflict resolutions:
 - squash the tst_qapplication.cpp part of dev-only
   13074a967f18ed348ab744f7ff831965607a6421 to avoid the linker error.

Change-Id: I8a47c69d356a0bef260e7987bc4eab96430e8072
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e06c67d448a6b4684d9787e9c18ec12f884b7063)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-06 03:42:45 +00:00
Axel Spoerl
c76dd919fd Revert "QAndroidPlatformInputContext: send composition text and cursor jointly"
This reverts commit be3b9b2ab12f664c196d649e8c4247d70805d667.

Reason for revert: Caused QTBUG-121561

Fixes: QTBUG-121561
Pick-to: 6.6 6.5 6.2
Change-Id: I4b59d97ede6c50d2575a7d7cebbe2291983dd19f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 46502f9705634f02626ee1057975463d1c0ae1f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-05 20:29:08 +00:00
Tor Arne Vestbø
d50746ef3a Debounce QDeferredDeleteEvents in QObject::deleteLater()
We used to look through the event queue in QCoreApplication::postEvent,
and if we found an existing DeferredDelete event for the receiver we
would compress the two events into one.

This was changed in 99b89d30fa5484c5d1f3cbda828648c28af4fb7d, as the
logic was causing O(n^2) for deleteLater, by using one of the bits
in QObjectData to track whether the object had already been deleted.

But it kept the logic for tracking this in QCoreApplication::postEvent,
and QCoreApplication::compressEvent would still do the work of deleting
the additional QDeferredDeleteEvents.

To avoid the unnecessary heap allocation of the QDeferredDeleteEvents
we can move the debouncing/compression to QObject::deleteLater().
We use the same mutex as in QCoreApplication::postEvent to guard
concurrent access to deleteLaterCalled.

A note has been added about the (preexisting) issue that the mutex
is not sufficient to prevent data races, as the deleteLaterCalled
flag is part of a bit-field, and we're not guarding any of our
other accesses to other bits.

As QDeferredDeleteEvents is private API, we can rely on no-one else
posting it than QObject::deleteLater(), which should be the case now
that tst_QApplication::sendPostedEvents() was fixed.

The documentation has been clarified as well. It's safe to call
deleteLater() more than once, but that's not _because_ other
pending events for the object are cleared. The latter behavior
is normal ~QObject() behavior. The documentation was probably
written at a point we didn't do any event compression at all
for QDeferredDeleteEvents.

Task-number: QTBUG-120124
Task-number: QTBUG-119918
Change-Id: I2a733095b7cb066ba494b1335aa40200c749cb0c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 13074a967f18ed348ab744f7ff831965607a6421)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-05 20:14:37 +00:00
Juha Vuolle
997f86279f DRY QHttpHeaders::value() implementation
Task-number: QTBUG-122020
Change-Id: I403d376734587d721d27f7093b3774068829a46d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b370e1b7f19464dd5303122b3e1e72addbadbf57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-05 09:40:09 +00:00
Juha Vuolle
02579a27a0 DRY QHttpHeaders::values() implementation
Task-number: QTBUG-122020
Change-Id: I7401eef86b133d33f32cd786dffe9a06c4ac7aba
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9c0a79d323500d07fb8b95656b9013dc118b9fa3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-05 09:40:08 +00:00
Juha Vuolle
3d6393f533 DRY QHttpHeaders::combinedValue() implementation
Task-number: QTBUG-122020
Change-Id: I6232ea725d47800a9236ed90b70004a915bc8b65
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit de37316160920f88101fbb59e32b401d139f2e80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-05 09:40:08 +00:00
Juha Vuolle
a772e31395 QHttpHeaders: remove unused Header::operator==()
The QHttpHeaders comparison was dropped earlier, and the current code
no longer needs to compare both header entry 'name' and 'value'.

Change-Id: I57a3003f0fd1d8ff867c970d5ec8a994a167ae88
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit c0e4b73743b9e9e8c3e116f9db9fe37bfcd89bf5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-05 09:40:08 +00:00
Juha Vuolle
b3c98388a4 Document QHttpHeaders::WellKnownHeaders as the recommended overloads
... from a performance point of view.

Task-number: QTBUG-122020
Change-Id: I8a1558a46e74d740e330ad483454267f9922a5d5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9e26a8c0826f0914581c3e6f8e7970aed231c8e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-05 09:40:08 +00:00
Juha Vuolle
f413e71984 Make HTTP header name a variant / union for performance
This saves memory and can speed up performance with
well-known headers.

The change consists of:
- Change the internal type of 'name' to a std::variant
  capable of holding either WellKnownHeader-enum, or a QBA.
- Accordingly, add an equality operator.
- When headers are added (append, insert, replace) then
  use WellKnownHeader as storage type when possible;
  either use the function parameter directly if a WellKnownHeader
  overload was used, or check if the provided string can
  be converted to a WellKnownHeader.
- Convert other functions to use a more performant
  lookup/comparisons.

Fixes: QTBUG-122020
Change-Id: If2452f6edc497547246fb4ddbace384e39c26c5e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0c05d2b43ec5ab29efc3db2718289a5600da754c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-05 09:40:08 +00:00
Juha Vuolle
6c82802a95 Move few QHttpHeaders helper functions on top
As a prequel to make subsequent diff on the followup
commit (std::variant/union) smaller

Task-number: QTBUG-122020
Change-Id: Iaa5dd794dc7a9e33c2c43e459bf5dbd19afb3ba1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d3860b1b73799244f240dac8d03176636e367567)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-05 09:40:08 +00:00
Juha Vuolle
257a5309ae Add sorted lookup table for QHttpHeaders name fields
This allows a more performant (O(logN)) lookup for WellKnownHeader
enum (followup commit).

The lookup table is currently crafted manually. It may in future be
generated at compile-time, but this should only be done if new headers
are appended often; we don't want to unnecessarily bloat compilation
time either.

Task-number: QTBUG-122020
Change-Id: I0329902b13128f03c358796d5cda7014b1e75057
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit dd3af7e4e250b69d200770a670c90b1bb4ca2198)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-05 09:40:08 +00:00
Tor Arne Vestbø
e4bb6826f9 cmake: Allow silencing CMake generator warning from environment
Pick-to: 6.6 6.5
Change-Id: I13d3000121be39f204b4374118690fe27702dd12
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5736e0b65599f2e3dedcb80ec88ecc431a459d38)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-05 09:40:08 +00:00
Volker Hilsheimer
5997821ece Icon: work around compile optimization bug
We are observing that the strings become sequences of zeros in
release builds, possibly triggered by qOffsetStringArray being used
in a static constexpr function to initialize a constexpr array.

Pull the array out of the function as a static on translation unit level,
which is a pattern we use regularly elsewhere in Qt.

Change-Id: I69c8cfe4e2d6d7d4659edda621ba1afe9768035b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 302823d73b8ca27e67e703de8316092d8b4d5715)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-05 06:26:16 +00:00
Shawn Rutledge
106442586e QTextMarkdownWriter: escape special characters (line or word prefix)
Try to avoid writing anything that the parser would misinterpret.
Escape pre-existing backslashes, but not those that are already escaped.
Optimize maybeEscapeFirstChar() slightly and apply it to every line
of output (except in code blocks), not only to new lines created by
word-wrapping.

Since it would be hard to do this without using regular expressions,
the markdown writer feature now depends on the regex feature.

Fixes: QTBUG-96051
Fixes: QTBUG-122083
Change-Id: I8d95366501fd31441829081c668f11a3a3a23fe2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit ca4774131b9b8ee40b4d7f5c1ba296af4700207f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-05 04:04:01 +00:00
Thiago Macieira
2d6034a9c8 Remove unnecessary #undef about q{Debug,Info,Warning,Critical,Fatal}
The ones in qlogging.cpp were copied to it from qglobal.cpp in commit
23688d8942895507f4bc1517dd3c161134f4f9d0. They existed in qglobal.cpp
like in qdebug.cpp since the beginning of the public history. The one in
qdebug.cpp already made no sense in Qt 4 times, because qdebug.cpp was a
documentation-only source (no actual C++ code).

The #undefs from qglobal.cpp hadn't been necessary since commit
d394ca7f27197cfbfc28eb9a08eb0db261dd9d3d, the global functions qDebug(),
qWarning(), qCritical(), etc. were replaced by member functions in
QMessageLogger whose names did not match the macros.

Change-Id: I50e2158aeade4256ad1dfffd17b1c62f23eca4db
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 5670d5f7e1ed65b6d6158b73edc43111d7b8ca53)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-05 03:42:27 +00:00
Richard Moe Gustavsen
34162c1040 CMake/Windows: add quotes around the whole path, not just the dir
The quotes should be around the whole file path, and not
just around the directory. Otherwise it can cause the
build to fail if Qt lives inside a directory that is
symlinked from a different drive.

Pick-to: 6.6 6.5
Change-Id: I46e23d4a78c807e6617224ce7faff96e6985f449
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 26f307ddb16563777bbd57ba1f29d656760c7ff3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-04 23:43:31 +00:00
Richard Moe Gustavsen
ad98a3bc72 CMake/Windows: add setlocal to the Windows bat files
Several of the cmake bat files sets "script_dir_path". The problem
is that those assignments are not local to the script files. E.g
when qt-configure-module.bat gives it a value, and then call
qt-cmake.bat, qt-cmake.bat will assign it a different value. And
this value will overwrite the original value in
qt-configure-module.bat. So when the call returns, that script can
sometimes fail.

This happens (for unknown reasons) if the Qt source code path
contains a link to a different drive, created with mklink /d.
This is typical if Windows is running in a virtual machine, and
the Qt source code is shared with the host on e.g drive Q:.
In that case you might want to a folder on C: be a symlink to Q:, in
order to build Qt.

This patch will make sure we add "setlocal" in all the affected
bat files, so that any changes done to e.g "script_dir_path"
stays local to each file.

Pick-to: 6.6 6.5
Change-Id: Iee18e06eb0beece0c85c4345d9bfc0194e466e56
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 458be44aebd441884502798c569cfcdfb06d15a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-04 23:43:30 +00:00
André Klitzing
d546ff93a5 Do not add PDF-related files to the resources if PDF is disabled
This avoids added resources:

  ":/qpdf/qpdfa_metadata.xml"
  ":/qpdf/sRGB2014.icc"

Change-Id: I89a130bd281c5550f1c3dcead8336e0c3de6bc84
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3d31b1953847e9b052812c8b7985d53af2c88385)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-04 20:38:24 +00:00
Tinja Paavoseppä
71bbdc46d7 Android: Fix inverted equals condition on QtAccessibilityDelegate
Got inverted during child window refactoring, leading to broken
accessibility.
Amends commit 0a92d881bb91d3ff14187e7838af1cad9ad1070c.

Task-number: QTBUG-122827
Change-Id: Icbde94097eb0b33171f18f8a30c935d0b950c545
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 15132530eeb327365270cba42d720f3f20b65a39)
2024-03-04 13:07:57 +00:00
Marc Mutz
33336ef2ee QNetworkInformation: document a potential SiC
Amends 1b429d6be42d4282cabed9119d6122061bc9fde0.

[ChangeLog][Potentially Source-Incompatible Changes][QtNetwork] The
enums in QNetworkInformation must now be scoped when used from
QML. The scope is no longer optional. Adding the scope is a
backwards-compatible fix.

Change-Id: I0855c0c2edd569f486b283b4671cdc3177cb7d3b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f9653c4ff25a6c7d78e0d5cf2782d4c78d16281c)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-04 14:07:57 +01:00
Christian Ehrlicher
975fc3da70 QtXml: fix leak in QDomText::splitText
QDomText::splitText() needs to unref() the newly created QDomText
instance as it does not use it by itself

Pick-to: 6.6 6.5 6.2 5.15
Fixes: QTBUG-40561
Change-Id: I593011b63c39f2310204d97ec61da7cf78a0fc14
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit de0230467c1f658232b101a99e62d68992173592)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-04 13:07:57 +00:00
Marc Mutz
3bbe5641b0 QString: document isSimpleText() removal
Amends d1f40ea0873a36288c6493f1ed5c9952064b9144.

[ChangeLog][QtCore][QString] Removed undocumented internal, yet
public, isSimpleText() member function. If you still use it, you'll
have to write your own version outside of QString.

Change-Id: Iff8e4961542384890df42ef6b5f11106f2c606ec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 735d2d41c387bc408391bffad9167af412194cce)
2024-03-04 14:07:57 +01:00
Liang Qi
a5acbcc92c Revert "tests: blacklist tst_QWidget::render() on Wayland"
This reverts commit c41733b06bd61d4710a9f6ec849f0d913c4497bb.

Based on the Grafana data, last flaky was August 14, 2023, and
the test works fine on local vm with stressed cpu.

Fixes: QTBUG-115598
Pick-to: 6.6 6.5
Change-Id: I634598d20a581d4d1443a3fd81e1e9481bfa2545
Reviewed-by: Inho Lee <inho.lee@qt.io>
(cherry picked from commit 4dca61cbdaf070e7789e71669f306042a0dd7fe3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-04 13:07:57 +00:00
Axel Spoerl
8053228817 QDockWidget: Use resizer without native window decoration
975c0bdf732ea7c5f7632913a27a1b6ae5cd5b26 has disabled usage of a resizer
on Windows. This has caused a regression, when a dock widget was
rendered frameless.

Use a resizer in that case.

Fixes: QTBUG-120694
Task-number: QTBUG-102196
Pick-to: 6.6 6.5 6.2
Change-Id: I9fbcb1a8b1d8869995093bc1da7524ec81e9f02d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 89fc58127d449cc2995879ff334567141e9c1d58)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-04 09:50:02 +00:00
Tim Blechmann
1f57b48346 Compiler detection - __attribute__((fallthrough)) for clang
Clang supports `__attribute__((fallthrough))`. While C++ sources use
[[attribute]], the C codepath still requires a fallback.

Change-Id: Iaa93d2debc21fdd34e414ddb024b95942ae9191f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 376ff95e9308b311038bb316ef36d04244d55b66)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-04 05:17:42 +00:00
Thiago Macieira
9539f527fc QProcess/Doc: remove the note that about FailedToStart after started()
It was added in commit 75a2c81b0041df4ca59178cf52d9e5a8815f3524:

 Handle posix_spawn using exit code 127 to indicate fail-to-start

 Most posix_spawn implementations are done using fork(), so the only way
 to report errors afer fork() is via a special exit code.

Support for posix_spawn was removed when we dropped QNX 6.5 support in
Qt 5.7 (commit 005a8bfbf0022f03dafafcf2b5c438ccf0675a49). Also
complements commit d012e953bfb498091c0ea9a83a717a3deffc670f.

Pick-to: 6.6
Change-Id: I76ffba14ece04f24b43efffd17aadead7c30146b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 75254e1d355b2eb33fece8bc1a468ce92ac65c7e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-03 21:06:43 +00:00
Thiago Macieira
8a92fbf80c qfloat16: use std::numeric_limits<std::float16> if available
Instead of going through the bit casts. Also solves the violation of
constexpr requirements from the previous commit.

Change-Id: I01ec3c774d9943adb903fffd17b8b6ee93d3c031
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 398a51686eda225f222d9df7ce56898c18ecdaa1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-03 17:55:34 +00:00
Thiago Macieira
922370814a qfloat16: make native std::numeric_limits<qfloat16> constexpr
In C++23 with std::float16_t present (QFLOAT16_IS_NATIVE), the
_limit_xxxx() methods in qfloat16 need to set the native type, not rely
on the union trick because that isn't allowed in constexpr mode.

                    in ‘constexpr’ expansion of ‘operator<=>(Max, std::numeric_limits<double>::max())’
qfloat16.h:209:5:   in ‘constexpr’ expansion of ‘compareThreeWay((* & lhs), ((double)rhs))’
qfloat16.h:209:5:   in ‘constexpr’ expansion of ‘(& lhs)->qfloat16::operator NativeType()’
    error: accessing ‘qfloat16::<unnamed union>::nf’ member instead of initialized ‘qfloat16::<unnamed union>::b16’ member in constant expression

Change-Id: I01ec3c774d9943adb903fffd17b8b6ceed6ef9e2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 48cd6867578ef372bbacb16081414b506cdb5b38)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-03 17:55:33 +00:00
Tor Arne Vestbø
cc21debd36 Disconnect QWindowContainer::focusWindowChanged on destruction
Regression after 9e78256579e8dc704066a98cb4816a1aab0e7e3b.

Apparently the string based connection syntax is more lenient,
as with PMF-style connects, we (correctly) get:

 ASSERT failure in QWindowContainer: "Called object is not of the
 correct type (class destructor may have already run)"

when the QWidget destructor closes the QWindow and we get a
synchronous callback from the platform that we've lost the
focus window.

Change-Id: I8f25b3b050e11913ec0f0941eaf831c88b4249f9
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 7ff1285e7a93d51e1f2a079ae33349906d9e9fea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-03 16:08:05 +00:00
Mårten Nordheim
0119a81ea4 tst_QMutex: use the new QCOMPARE_* macros
Some machine in CI is failing some of these sometimes and
I would like to know by how much.

Change-Id: I88b41d5cde81419f7c11f7038101962630eb31ef
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 8d6d7428f49d91600977ef5fbe01ed2117424e71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-03 09:22:18 +00:00
Mårten Nordheim
65406e0be7 UDP: don't disable read notification unless we have a datagram
The current logic that we will disable the read notification if we
have any data at all doesn't make sense for users who use the
receiveDatagram functionality, since they will not make any calls
that trigger the read notifier to be re-enabled unless there is a
datagram ready for us to hand back.

Fixes: QTBUG-105871
Pick-to: 6.6 6.5
Change-Id: I0a1f1f8babb037d923d1124c2603b1cb466cfe18
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b2ff0c2dc25f640a31fa170dd7cd8964bbcd51d6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-03 09:22:11 +00:00
Friedemann Kleint
60b6257a3b SQL/SQLite: Silence warning "Unsupported option ''"
It shows for example when starting assistant.
Amends 3379fd2322d112af4ef7ce75aafe18c27746acae.

Change-Id: I85196c62ff9d9caaa46a5279c3b965dc28266ba8
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit af814d7d9d35405fabdf25e3e8f3a243d4d55deb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-02 01:52:03 +00:00
Marc Mutz
e75a5955b2 Rename qIsConstantEvaluated() to q20::is_constant_evaluated()
We should really try to avoid another
almost-std-compatible-but-not-quite idiom. When qIsConstantEvaluated()
was added, the rationale was given that this cannot be q20, because we
can't implement it in all compilers. But we can: returning false is a
perfectly legal implementation, and makes most users actually simpler
because the #ifdef'ery can be dropped.

There are only two users that still require the macro, because either
they do different fallbacks depending on whether the implementation is
trivial, or because they direct expected test outcomes.

The INTEGRITY compiler complains "calling __has_builtin() in a
constant expression", which we currently don't understand. To unblock
this patch, and therefore the 6.7 release, hard-code INTEGRITY to
return false.

Amends 95e6fac0a5a1eee3aa23e4da0a93c6c25e32fb98.

Change-Id: If6cae902ff434f2ccceb6057cb053b7f304a604c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 4b806d678e68c786f4be3809c72d396ae15bb04c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-02 01:04:32 +00:00
Ahmad Samir
6a74a3c4c6 androiddeployqt: fix QDirIterator::next() usage
The code inside the loop body uses it.next() twice, however hasNext() is
called only once; each call to next() advances the iterator.

Amends 4041610cb202699a47268975e5aaecaa1f182c0a.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Idb96cfbddc56e0d7ed38ab1b0279f40592c75175
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 56e151663ebfd4fc0876d33f22c81f0218339914)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-02 01:04:31 +00:00
Christian Ehrlicher
0b5b6e7db2 SQL/ODBC: escape values in connection string
Values in connection strings must be escaped when they
 - contain a ; -> escape with "
 - start with ' -> escape with "
 - start with " -> escape with '

Fixes: QTBUG-122642
Change-Id: I1df638194067af5df94a34009e1547886fdf928c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 000d462bf93b21a9bbb46fdba631c09ba3eb9276)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-02 01:04:31 +00:00
Christian Ehrlicher
874f5c1f46 SQL/ODBC: Add helper class SqlStmtHandle
Add RAII SqlStmtHandle helper class to make sure the statement handle is
properly cleaned up also on early exit.

Change-Id: I7aba4472be1e2991f395eeb7e43f8dd272336694
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 4f4ac705f0f918a133a6ff676180e99307358823)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-02 01:04:31 +00:00
Allan Sandfeld Jensen
3ff5f601b6 Fix previewing a preview on reentrance
Make the print preview more tolerant of reentrance by avoiding
previewing itself.

Change-Id: Ia4774cb51bdda7d311414c4e2f9c2bfbed4f187f
Pick-to: 6.6 6.5
Fixes: QTBUG-122749
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 367e6ff0b20be47fdc9ddd72866053ec60cbe254)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 21:05:50 +00:00
Tor Arne Vestbø
9dbb295279 Add QWidgetPrivate::rhi() helper method
For accessing the RHI managed by the widget compositing machinery.

Pick-to: 6.6 6.5
Change-Id: Ia3c1227cc2d9cfebe95611cad3dbcd7aa6f6f8c7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f451b01791536fede40c8d4fb90799c2e23e9386)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 21:05:50 +00:00
Tor Arne Vestbø
0c519efa11 Add QWidgetPrivate::closestParentWidgetWithWindowHandle helper method
In contrast to nativeParentWidget(), we return the closest widget with a
QWindow, even if this window has not been created yet.

Pick-to: 6.6 6.5
Change-Id: Icac46297a6052a7a5698d752d4aa871bd5c2bdd8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b571634172428263fa83ac733cf89e664bded014)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 21:05:50 +00:00
Tor Arne Vestbø
f9f9c648b4 Remove QWindowPrivate::compositing
It was added for Android in a4f50269f82695fbd0dd344f87b4b355feff4333,
for the case of QSurface::RasterGLSurface, but since 6.4 we no longer
use QSurface::RasterGLSurface for composition. And the Android usage
was removed in 2020ce5fd2478389c56f34742fdeee9cd24ca8a5.

Pick-to: 6.6 6.5
Change-Id: I8dafe959c54e09b3a974253e15d184365141d559
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f517e85e906bcfb59dd11d1fb4a1bea84afb1d9a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 21:05:50 +00:00
Juha Vuolle
85ef2d4d96 Mark QNetworkRequestFactory as TP
The documentation already marks the class as preliminary, but mark
also with the new macro for that purpose.

Amends: b4c90582a2dee5c534361b3903611206305b03c3

Change-Id: Idcf022283bff04f4c4ee260180d3f5cfd0e80034
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit dad2a60128c586fc816dcb3b22858112ce3dfc2f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 21:05:49 +00:00
Santhosh Kumar
335307c6a3 Update the default behavior of items with layout
The earlier patch 4ae537e67c99160f5dcac99f40d03a7921456556 had default
behavior as opt-out for size policy of items within the layout. This
can cause a lot more UI regressions than anticipated and, so make it as
opt-in (Qt::AA_QtQuickUseDefaultSizePolicy). This means that the user
needs to explicitly set this attribute to utilize the default size
policy of quick items.

Amends patch 4ae537e67c99160f5dcac99f40d03a7921456556

Task-number: QTBUG-117597
Change-Id: Ibdb3ea9897c19792a110cbb15834b27383b9103e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit c606739ad1d5cf68449e61db751aa0c65cba3e00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 21:05:49 +00:00
Juha Vuolle
d134378b20 Remove unsused includes in QRestReply
The removed includes were needed when there were separate methods
for returning QJsonArray and QJsonObject

Change-Id: I5f08c4afd5487c5ca191ee813a3d94c4ae3b0f06
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit ab04dcca88f926b6512acb7bd108eccb100d3b2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 21:05:45 +00:00
Tor Arne Vestbø
b3aa8fca21 windows: Remove workaround for delayed OpenGL initialization
We no longer use QSurface::RasterGLSurface for composition, so the window
will already be QSurface::OpenGLSurface during WindowCreationData::initialize.

Pick-to: 6.6 6.5
Change-Id: I9b5ea0245ddf4a19d165bde9ad6fd48a98bfca4f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit dc5a29b3246d19bd620acc9fdaea929bf856d8dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 21:05:44 +00:00
Marc Mutz
c49366a543 QDBusUtil: document the D-Bus signature grammar
The specification doesn't provide an explicit grammar, so I turned the
prose into ABNF for easier reference.

The goal is both to aid review of the validateSingleType() function
and to eventually use this to write a parser that doesn't use, or at
least limits, recursion.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I21f81aa83cde356ab48105ea98f066024e0b7b5e
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 476d2a7392ee26294d1230f0c5031fe6bb4a0f26)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 21:05:44 +00:00
Marc Mutz
b1b9717304 [docs] QDBusUtil::isValidObjectPath(): simplify description
The "does not contain two slashes in sequence" condition reads a bit
unmotivated. It's easier written as "each part is not empty", so do
that.

Pick-to: 6.6 6.5
Change-Id: Ibb204429521910582bd8ee03ff54f72d7e15ce84
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 63b52ba994ca9d9a0ceaeab465f64465b1fa137a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 21:05:44 +00:00
Nicholas Bennett
b720e4ae04 Add Qt Tools for Android Studio Macro \QtTAS
Make sure this macro can be used in any documentation regarding the
Qt IntelliJ plugin for Android Studio.

Task-number: QTBUG-121447
Change-Id: I764cd91ea4c1fc7897a9243729a1c6c553739ada
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit 2bae857aadaf9d0c67d9cba91f5f71805227f06d)
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-03-01 18:10:13 +00:00
Wladimir Leuschner
5dfec88838 QWindows11Style: Fix transparency for overlapping ItemView editing
Fixes: QTBUG-120254
Change-Id: Iabaee612f5a0613cbbcafe566b4a14d01cefa47c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 1a559261966f334e40ccd6d081302974e5b2b059)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 18:09:53 +00:00
Ivan Solovev
ed898efac7 Bring back QASV::detects_US_ASCII_at_compile_time
Even though undocumented, it's public API, doesn't hurt to carry
along, and improves compiler coverage in the test, so let's not remove
it.

Found in 6.7 API review

Amends 95e6fac0a5a1eee3aa23e4da0a93c6c25e32fb98.

Change-Id: Ia935036a69e0e678f22ac86b48a2c1c5e8c46733
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 380c01bac545172624944e269214ba168e59fb3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 18:09:49 +00:00
Shawn Rutledge
f0713117d6 QTextHtmlImporter: don't forget to appendBlock after block tag closed
If we see a closing tag that really demands a new block after it,
like </ul>, that needs to be done even if some ignorable whitespace
and "inline" tags come after it. Don't get distracted by those.

Also add a comment in QTextDocument::setHtml() to remind the reader that
HTML parsing is a two-pass algorithm.

Pick-to: 6.6
Fixes: QTBUG-81662
Change-Id: If723c9d3c211a684725055a06bcf87be4e38923a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 60aeeb0e92762d57c208e4212374d30be6490611)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 18:09:45 +00:00
Wladimir Leuschner
65cd5a06a0 QWindows11Style: Revert Windows global palette changes
Revert Windows global palette changes and set the QPalette for
QWindows11Style in QWindows11Style::polish

Fixes: QTBUG-120571
Change-Id: Iad4eb699c2dbfed38a917e6c9bc378c4262dc66e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 41854cfaac0fcd2c8f4386a46955716e652c4edc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 18:09:41 +00:00
Juha Vuolle
27feaf07a9 Change QRestAccessManager executeRequest() to use function_ref
Drop the templated executeRequest functions in favor of
qxp::function_ref for readability and type safety.

Task-number: QTBUG-122018
Change-Id: I36c07ff5fe6d2025459fe3f7190bc29901a320ce
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 3044a8ae274e579b4eab9c9564482314eb7e3f29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 18:09:37 +00:00
Volker Hilsheimer
fe5758e2d7 QTextEdit::event: refactor into switch statement
Replace if/else snake, made more complex by handling of QT_NO_*
configurations. Move the unconditional cases to the top, which also
fixes the handling of ShortcutOverride and ToolTip events when Qt was
built with QT_NO_CONTEXTMENU.

Change-Id: I1e2cc2c39e3cef9fe29a71e48595756cff0d2949
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 83f73df3e0e07242ce355fa12ae818fbb0ed6d03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 18:00:54 +00:00
Volker Hilsheimer
67c5cbb8e1 Fix spelling of FFmpeg in (end-)user-visible string of windeployqt
It's two capital "FF", lowercase "mpeg".

Pick-to: 6.6 6.5
Change-Id: I4eca719fa6ce0133e3ddb6163c81e24493b378e3
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
(cherry picked from commit 7bde3f4c4c6b4c27ce4ce45b6735d61f405ea53b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 18:00:50 +00:00
Mike Chen
dd52aed320 Fix QTextEdit/QPlanTextEdit palette not updated
QPlainTextEdit/QTextEdit, etc. never received ActivationChange
when used as child widget. Set palette to control on
WindowActivate/WindowDeactivate

Pick-to: 6.6 6.5
Change-Id: Iae75d9dcfba0c6171c556626551b37d4549006c7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 402cb510e1d40825d74447af831918f4a2a951f2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 18:00:48 +00:00
Paul Olav Tvete
79ac8b110a QTextEngine: Protect against integer overflow with huge texts
QPlainTextEdit would crash when adding a string of 136 348 169
characters, due to the integer overflow checks being done with int
variables.

Perform intermediate calculations and size checks with qsizetype
instead of int. This commit contains a slight modification of the fix
contributed by Adam Clarke in the bug report. Note that the size check
casts to size_t to cover the 32-bit case where qsizetype is qint32.

Fixes: QTBUG-119611
Change-Id: I1cf7e1bc4c35276862f37aa6d01f37075fa11635
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 997fd3b88ede8078af286da6ecc197e83a8cbb46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 18:00:46 +00:00
Wladimir Leuschner
4ff72f1bfd Increase padding for LineEdit controls in QWindows11Style
Change-Id: Ibf8e43160d7ae0aff04040f0e2bcf5bfbda52e1d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 172422fcee0036b8c14bf9bda42dfe7d05804d5a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 18:00:44 +00:00
Nicholas Bennett
7384f78b2f Add the use of a macro to control the supported AAOS versions
Add the macro and set it to the current support range in 6.7 for
Android Automotive OS which is 10 to 13

Change-Id: I4342a42f5f56ab9731c969d9cbe0d4291ec3eaf4
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 6164b17d226a4dd2099a852a6c34bae6fa19876d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 12:56:35 +00:00
Marc Mutz
9dc6be95f0 QByteArrayView: make conversion to string_view constexpr
Both QByteArrayView and std::string_view are Literal Types, so the
conversion between them should be constexpr.

Amends 96d67da420697cee10bdc537a1a592f6f22e2b8f.

Found in API-review.

Change-Id: Ic513ce32aa2a743ca890dc05a683a62c0f3a7d50
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit f9474364ee7ad3209873530b786bc6c081e1e2c9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 11:41:10 +00:00
Marc Mutz
c3ec6c8a53 QRestReply: use qt_ptr_swap instead of std::swap
qt_ptr_swap is our swap compile-time optimizer. It's faster because it
hardcodes noexcept(true) and std::swap() must calculate it.

Amends 9ba5c7ff6aa42c5701cf950d2137467a2d178833.

Change-Id: I1b5a326276bd30638ac9b6dcf597abb5e53ada00
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f70e113b2e895fb71db4ee6fb77a91f65e2deae9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 11:41:09 +00:00
Marc Mutz
c5bf202f21 QJniObject: use ctor delegation instead of construct+assign
The old code used unintialized construction followed by (move)
assignment to construct a QJniObject that requires a LocalFrame
object. That is two constructors and therefore one more than we need
(and need to destroy in inline code again).

Everything can be solved with another level of indirection.™

Since the LocalFrame needs to remain alive for the duration of
argument evaluation, the usual comma operator trick won't work. But we
can add a private helper ctor that takes the LocalFrame as an
additional argument to inject the object with the correct lifetime
into the ctor delegation chain.

Put the new argument in the front, to avoid clashes with the primary
contructor's trailing universal references, which might be a better
match than the new overload had we added the argument at the end. The
hope is that the compiler will avoid the ensuing register shuffling by
inlining the outer two constructor calls.

This brings the number of QJniObjects constructed down to one, as it
should be. We might also be able to remove the Uninitialized ctor
again.

Found in API-review.

Amends 62cb5589b3723fe8162e190cd54d9c78929b98d2.

Change-Id: I326187e54fd0705a1bbedb2d51d94a46b108a3c8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ddaf7642828c970a69c995a606c5cb16e003c26c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 07:47:21 +00:00
Tim Blechmann
137568c920 Fix -Wimplicit-fallthrough for clang
Clang's `-Wimplicit-fallthrough` warnings are a little stricter than
gcc's interpretation:

switch (i) {
case 0:
    foo();
case 4:
    break;
}

While gcc accepts the implicit fallthrough, if the following statement
is a trivial `break`, clang will warn about it.

Change-Id: I38e0817f1bc034fbb552aeac21de1516edcbcbb0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c26994ff1551aa5450383cc51bed9b4d39f973f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 06:33:17 +00:00
Juha Vuolle
91fa8748a1 Add space character when combining QHttpHeaders values with comma
The "HTTP RFC 9110 5.3 Field Order" states that the values combined
with comma can be followed up by an optional whitespace, and for
consistency recommends "comma SP". This is also what eg. 'MDN Web
Headers' class does.

Fixes: QTBUG-122650
Change-Id: I3391c86018090f0b8721929b64a7e3029e98ac85
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 1fbcb411e12047961dac157f5fbcd327e0a47833)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-01 06:32:27 +00:00
Axel Spoerl
a2b1f1e690 QApplicationPrivate::dispatchEnterLeave: remove dead code
Remove #ifdef 0 section added in 2011.

Task-number: QTBUG-121478
Change-Id: I2154cd5616e2695af89cf4fc5ec9d1b3ae5572d5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 2d1db53f9c0eceb5196cd2fc571b3b48c706a70e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 21:14:52 +00:00
Axel Spoerl
5e89966da1 Refactor and fix QMainWindow::tabifiedDockWidgets()
The method traversed QDockAreaLayoutInfo::item_list, to identify
dock widgets tabbed with the QDockWidget argument in a tab bar
It relied on bool QDockAreLayoutInfo::tabbed, which is set to true, when
a QMainWindowTabBar is to be added to a QDockAreaLayoutInfo. This flag
isn't cleared, when the second last dock widget is removed from the
tab bar. It can't be replaced by QMainWindowLayout::isDockWidgetTabbed,
because the flag also represents intermediate states, where e.g. a dock
widget is hovered over, prepares to become a floating tab and then rolls
back, because hovering doesn't result in a drop. In that case, tabbed
must become true, which the dock widget isn't actually tabbed.

Furthermore, the way to traverse item_list didn't find dock widgets
in a floating tab. In that case, tabifiedDockWidgets() wrongly returned
an empty list.

To fix both issues, refactor QMainWindow::tabifiedDockWidgets() to read
the list of dock widgets directly from the QMainWindowTabBar.

Add tests in tst_QDockWidget::floatingTabs() and
updateTabBarOnVisibilityChanged()

Fixes: QTBUG-122001
Pick-to: 6.6 6.5
Change-Id: Ia9eb3711be642101261f34ee447521cc6accc20c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit cd2a3e970aaeb8f5f92d9c6e52ede7a82f953150)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 21:14:50 +00:00
Yansheng Zhu
24f6eaa111 Implement Qt::ImEnabled by isEnabled() and isReadOnly()
Previously, querying Qt::ImEnabled only returned the value of
isEnabling(), which is incorrect for edit widgets with read-only
properties set, as Qt::ImEnabled indicates whether text can be *input*
through the input method, which results in the IM being able to insert
text into read-only edit widgets.

The fixed version uses both isEnabling() and isReadOnly() values to
determine whether input methods need to be enabled. For some platforms
(like iOS and Android) that rely on IM to select text, a check for
ImReadOnly has been added to their QPA plugins to enable handles on
read-only input boxes.

At the same time, the imEnabledNotImplemented function in the test file
tst_qwidget was modified, since ImEnabling should give a _false_ value
when a lineedit is read-only.

Task-number: QTBUG-105009
Task-number: QTBUG-110838
Task-number: QTBUG-119182
Pick-to: 6.6 6.5
Change-Id: Ia2abcdb3200826d567f90447d4f8b71d0ef1fbf0
Reviewed-by: Yansheng Zhu <670429759@qq.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 70096b2bbd54d35518167cb41ea3576b992c3cda)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 20:09:49 +00:00
Alexey Edelev
58b9d558dd Disable depfile support for the external projects when building for Android
androiddeployqt rules that support depfiles cause creation of rules that
interfere each other and cause the test build flakiness in CI.
This disables depfile support for ABI-specific external project until the
rootcase is found.

Task-number: QTBUG-122838
Pick-to: 6.6 6.5
Change-Id: I12e85f43494331c943c9b516d9494593facf9180
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 356b0aee0e93c9fc51e79faa8d6904bf4d5a6c27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 15:30:41 +00:00
Marc Mutz
21a4a2daf8 QCborStreamReader: don't assume that clear() results in isNull()
That QString and QByteArray::clear() shed all capacity() is a
historical artifact we will fix at some point. Don't add more code
that assumes a clear()ed string isNull().

Amends 8af346c1f66f813c3c8fe4d8b892ecfbe96eacfb.
Amends 1d9137e13f9eb3f183c967e9e911c5b260f93dc0.

Task-number: QTBUG-31283
Task-number: QTBUG-60745
Change-Id: Ib0d929325088d3e8e119fee3eafa964a783dc8e9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 6c424dbcb0385a4b36835fc5103ca74c1044eccc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 14:36:15 +00:00
Tor Arne Vestbø
3e04bf609a QMessageBox: Forward helper checkbox state via lambda
There may not be a checkbox when the helper is initialized, and
we want to support the case of a checkbox being added at a later
stage.

Regression from e5c40ec5c117376f401c01069f05780046d07094.

Change-Id: I397c3b3a101b249aab17804bd90085cfd4ab7dbb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f6d09a68f6fe7100bd1c6f6039db3832a9c5dce2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 14:36:10 +00:00
Ivan Solovev
e35f20485d QCborStreamReader: rename toType(Type&) -> appendToType(Type&)
Rename the toType() overloads taking an out-parameter to appendToType(),
because that gives a better understanding of the usecase.

Found in 6.7 API review

Amends 8af346c1f66f813c3c8fe4d8b892ecfbe96eacfb and
1d9137e13f9eb3f183c967e9e911c5b260f93dc0.

Change-Id: Ic1a462e9507123a59e6086bfb48b8b61ab79abb8
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ff034ebbfa7c1cc47cdcc15bc854972cd960db1a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 14:36:09 +00:00
Marc Mutz
12bf8fd618 synqt.cpp: scan for and reject #pragma once
In 2022¹, we gave ourselves the rule to allow #pragma once only in
non-installed headers (examples, tools, snippets, ...), because the
same installed header may reside in different places in the filesystem
and #pragma once would treat these as separate headers, causing
multiple-definition errors.

Recently, the question came up: "What constitutes a public header?"

Non-_p.h headers in e.g. src/plugins/ muddy the waters here a
bit. Since #pragma once is forbidden in installed headers, I had the
idea to use it to indicate non-installed headers. This patch enables
use of #pragma once as a static assertion to that effect, should we so
choose.

¹ https://lists.qt-project.org/pipermail/development/2022-October/043121.html

Pick-to: 6.6 6.5
Fixes: QTBUG-122813
Change-Id: I3b5beef72e154cf5bf1ccd4b6f02df9680609e43
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 1c8884fc277c5916a420a3c14de68547a391f9fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 13:56:23 +00:00
Mårten Nordheim
a05aa394b9 tst_qudpsocket: add helper exe to dependencies
Pick-to: 6.6 6.5
Change-Id: I2bea493c5273175746d502e62d1044eca20ece04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 788ce268820ff8807aefa45293aa5f3ec299052f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 13:56:21 +00:00
Giuseppe D'Angelo
80a3175a28 CMake: remove a duplicate check for C++2b
Change-Id: Ie617fa277fc3a36b5e2f34ae1b79099193ae1b17
Pick-to: 6.6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 918ac58a89b17a73a73bb15055d97f6eee782051)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 13:02:46 +00:00
Viktor Arvidsson
92e1bf8e3b QAbstractItemView: Release tab focus when hidden
When hiding a widget that has focus we try to focus the next widget in
the focus chain by running focusNextPrevChild. The abstract item view
overrides this to step the items but does not account for this hide case
which makes focusing not only not work, but also by hiding the widget
the selection in the item view gets changed.

Pick-to: 6.6 6.5
Change-Id: I29d40a1fb86ced60ec742b2753a87383846a89b3
Reviewed-by: Viktor Arvidsson <viktor.arvidss@gmail.com>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d9397479e6dfc2d7b73cab6dcbcda4cccdc20b8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 11:36:30 +00:00
Jaishree Vyas
08868b1c4b Doc: Documentation improvement in QHttpHeaders and REST classes
Language and some other improvisations

Fixes: QTBUG-120028
Change-Id: Id5a5544abf244de5cff83f0d795732595934bd36
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit d7b71294e8267123595593efca397151e4bf2595)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 10:48:36 +00:00
Tomi Korpipää
2c743bc0cb Prevent re-replacing state in setGeometry
Do not allow replacing a state again if it is already being replaced.

Cleaned up from the patch provided in QTBUG-121126.

Fixes: QTBUG-121126
Pick-to: 6.6
Change-Id: Icca932b0e5cccd2f39ac18f29d8f7707887d147f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit f429f12a7fb94ef5970a28eaf0b53aea935044b3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 06:14:19 +00:00
Christian Ehrlicher
8b100d89f3 SQL/ODBC: Don't assert when no error record is available
When SQLGetDiagRec() does not return an record, the list of
DiagRecords might be empty. This will create an assertion when trying
to access QList::front() or similar. Therefore we need to check if the
list is empty before accessing it.

This amends 4ec5c0efc756a39162b43367438fee965c229ae7

Fixes: QTBUG-122073
Pick-to: 6.6
Change-Id: I6f421d82f9b6fdf84672d755cbbe8d2adec13266
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6287daaa20bfb306d1e2d87d67df961e1da2857a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 00:03:43 +00:00
David Faure
4c3d906068 QDialogButtonBox: fix crash when adding a QToolButton
Introduced by commit d4f38a363251fcb5cdfb24d7a1aceb7b630f7e8f

Pick-to: 6.6 6.5
Change-Id: I99385249a454c75eeae13c1d17670b356427cb70
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d9b63c90bf65d853fa74a1327ef7455e1b655fac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 00:03:43 +00:00
Tor Arne Vestbø
ce054a1240 QWidgetRepaintManager: Use textureChildSeen to determine deferred update
We want to get rid of the QWindowPrivate::compositing member, as it is
no longer needed for the Android backingstore, which it was first added
for in a4f50269f82695fbd0dd344f87b4b355feff4333.

We can use textureChildSeen instead to check if we're compositing.

Change-Id: If85b21f92c8253bf89543a7e81e03730023f8095
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d31cc6dc7b1d1762990fdb70702981f73d060903)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 00:03:43 +00:00
Michael Weghorn
e9c11ba22a a11y atspi: Map checkable and hasPopup states to AT-SPI
These states have direct equivalents in AT-SPI, so map them
accordingly.

Fixes: QTBUG-119080
Pick-to: 6.6
Change-Id: I5a78a75d135a853b3773c34aa2a45c0791cefebc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit b2ec2e1137ceb0b83978a7fa35485b1b97c73648)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 00:03:43 +00:00
Giuseppe D'Angelo
40425a35ca QPixmap: fix the documenation for toHICON
The functions are now on QImage, not on QtWIn.

Change-Id: Ida777c7fc087bf673c5305beffb498ada115ed73
Pick-to: 6.6 6.5 6.2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit b2c95e74a6ad97bdebd9d1fed8ffec065aba31f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 00:03:43 +00:00
Marc Mutz
b0d04b2273 syncqt.cpp: Extract Lambda error()
It will be re-used in a subsequent patch.

Pick-to: 6.6 6.5
Change-Id: Ia58020a39440d5e583450f7adecf561f7267c403
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 74cbb1bbae718fce10b6ef1c882d74ffa4a2180d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 00:03:42 +00:00
Assam Boudjelthia
ec41bb4e2b Revert "Android: rectify the visibility of QtAndroid.jar class"
This reverts commit 523cf066285a648b10b277bb1b3b2c7b9d66d464.

Reason for revert: To avoid QTBUG-122456

The revert is done for 6.7 only to avoid such regression before the
release, and that gives us some time on dev to find proper ways to
handle that, since the access restriction still makes sense because
QtNative wasn't proper public API that's documented to start with.

Fixes: QTBUG-122456
Change-Id: I2e175ba170df85b7537be20a8841407f1162c7ba
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-02-29 02:03:42 +02:00
Soheil Armin
474a22b2a7 Android: Bring back QtActivityDelegate.insertNativeView()
Temporarily bring back the QtActivityDelegate.insertNativeView() and
QtActivityDelegate.setNativeViewGeometry() (replacement for
setSurfaceGeometry()) as they are still in use by the ActivityView
module of QtAndroidAutomotive.

They have been removed by 0a92d881bb91d3ff14187e7838af1cad9ad1070c.

Change-Id: Ia00407d827ca9217c9f49df55b4cf7001ac9871a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b42f174cd5be2014ae74453ab2d09742cc83fc36)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-29 00:03:42 +00:00
Laszlo Agocs
965c237aa2 rhi: d3d: Print more details on swapchain creation failure
Do it both for d3d11 and 12. Also add a bail out when presenting
to the latter (it is already there for d3d11).

Pick-to: 6.6
Task-number: QTBUG-109708
Change-Id: I6f8039bcf27fa20e4bebcdf01ac3feaa14249b4d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit c738a349d2d6fa27e994657ce38fe9027c96a251)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-28 20:20:20 +00:00
Tinja Paavoseppä
e5a8b36704 Android: Make timeout in tst_QApplication::abortQuitOnShow() longer
Since the Android emulator on CI is running without hardware accelerated
graphics, showing the widget can take almost the same time as the timeout
for exiting the app with the "wrong" exit code 1. If running on Android,
increase the timeout to 1000 ms to avoid flaky failures. Un-blacklist
tst_QApplication::abortQuitOnShow() since the random failures are
taken care of by this patch.

Task-number: QTBUG-122693
Change-Id: Id52ae15b3ab2dbdaf4924b675276dfe3a4168585
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 32197e94d79f9bb00ddb9c294bd2711dba47d1ee)
2024-02-28 22:20:10 +02:00
Alexey Edelev
a405320544 Fix the qtpath issue with lto enabled
Move qtconfManualPath pointer to the unnamed namespace, so it's never
exported. Add the static setQtconfManualPath method that sets the
pointer at runtime.

Fixes: QTBUG-122739
Pick-to: 6.6 6.5
Change-Id: Icfc631f9680ad5f484920b0fdf3e408b7657c108
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit bdb2f20154c1fa1f0962a46a22afdee453a2db1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-28 20:20:03 +00:00
Lucie Gérard
35114124d2 Correct doc snippet license
All file under doc/snippet should be
license as Documentation snippets
and according to QUIP-18 [1]
this is LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I76eedfb6b15c4091f726a5652e3530001d7cdaf7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1556a3a5eb13b05ccff5fb551ae9d72edb267e8d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-28 20:19:54 +00:00
Volker Hilsheimer
59ff87dc91 Windows: clean up System Tray Icon message icon
The handle is not owned by the Shell, we have to clear it up ourselves.
The documentation is not clear about how long the handle needs to be
kept alive, so store the icon when we create it as a member of the
private, and clean it up when it need to be recreated, or when the
QSystemTrayIcon instance gets destroyed.

Fixes: QTBUG-96348
Fixes: QTBUG-62945
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I6f93f29a415cde2cfe4e1b296295783c15b4da4b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit afb74a86d8cd1ac6463fa804300480967101d7d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-28 20:19:43 +00:00
Edward Welbourne
a3a2d3df20 Also check available in TZ timezone's constructor
Follow up to commit 00d9a9a9b59650b8e297f91dcc600c377da5bceb - as
commented in the QTZ constructor, one of the reasons for the prior "is
available" check was to avoid creating TZ cache entries for it; so
have the TZ backend also (like ICU) overtly check for availability
before trying to find data for the given ID. This duplicates work done
later in the constructor, which can perhaps be optimised out later,
but is no worse than where we were before the commit mentioned above.

Pick-to: 6.6 6.5
Task-number: QTBUG-121807
Change-Id: Ie0571df2de2bf0a3f4ee767184e58b378e8cb05a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ec9ca7ac43cfebc74afc03de338f81a879354b2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-28 18:50:34 +00:00
Alex Bu
684aec428a Fix the instruction of RISC-V arch that yield CPU
Replace fence with pause in opcode form,
as GCC doesn't support fence operand.
Amends a7f227f56cfe562280e89d3c73040f7e8384129e.
Remove the builtin pause checking,
as in GCC13 this will always pass,
while the opcode pause works
regardless of the pause extension.

Task-number: QTBUG-103014
Change-Id: I26e3c3b9f7d234be24abe1570aaf4c8cb3a272b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 61bd614abea0cbff83595ebf31b0beeccaef5304)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-28 18:50:32 +00:00
Pavel Dubsky
4baeef91d3 Replace QWindowsComBase with QComObject
Currently with have two base classes for COM-objects that implement
basic IUnknown functionality and the idea is to remove duplication and
keep just one. Since QComObject supports more features than
QWindowsComBase, such as multiple inheritance and intermediate interface
querying, we should switch to the former one.

Change-Id: Ief6567496de9f547b936de91d634c6998ba59a75
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4a705f5f29aa5ffce8db87fe54f7e70c08124d80)
2024-02-28 10:41:54 +00:00
Thiago Macieira
f5738ab463 QThread::currentThreadId: fix build on x32 (ILP32) ABI
On this ABI, pointers are 32-bit, so Qt::HANDLE (void *) is a 32-bit
variable and the "movq" instruction is inappropriate.

There's a GCC extended inline assembler modifier for the instruction
size suffix (%z0) but Clang seems not to understand it. Instead, I just
removed the suffix: we can do that because this is a memory load
instruction, which implies the destination is a general purpose register
(also required by the "=r" constraint) and therefore the assembler can
determine the size of the memory load from the name of the selected
register.

Note: I did not verify this compiles on x32 at all, much less that it
loads the right thing from memory.

Fixes: QTBUG-122674
Pick-to: 6.6 6.5
Change-Id: I01ec3c774d9943adb903fffd17b6513d146e89ce
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 08349ef0fe3902504987d12ebe0ed9674ed1e486)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-28 01:42:30 +00:00
Thiago Macieira
5fea2d374b QPainterPath: detach and reset before streaming in
Otherwise we end up appending and modifying the shared object.

Pick-to: 6.6 6.5 5.15
Task-number: QTBUG-122704
Change-Id: I01ec3c774d9943adb903fffd17b692c2e6d53e97
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2925683268ca9d8dc6811f8f64c50ca488b27acc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-28 01:42:30 +00:00
Thiago Macieira
20c44b7bac QStringView: stop instantiating std::char_traits<QChar> and <uchar>
It's deprecated and will be removed with LLVM 19.

Amends b1ee49b46533d39f7fabda68d0bd08a1ab130a27.

Change-Id: I5dd50a1a7ca5424d9e7afffd17ad07b3ab3fc18a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit dc2ae08e02730ab795445bc047221aa56914f723)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-28 01:42:30 +00:00
Andy Nichols
5f4c74f045 Doc: Fix typo in QSurfaceFormat::setDefaultFormat documentation
Fixes: QTBUG-107486
Pick-to: 6.5
Change-Id: Id22cedfa65e831574f683a33a4c2fde20570890e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d83b5350689242e7815a2c2e6b6168fe1f67d943)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-28 01:42:29 +00:00
Mårten Nordheim
4d3a69cea3 Schannel: check that plainsocket is open before use
In reality I think it should be covered elsewhere, before reaching
the TLS code. But this is a simple fix to avoid an unnecessary warning.

This is actually quite similar to the resolution in
ef4ba0285f9c5dd5ee2dca1e0cefee45eba3477c.

Technically checking isWritable would be more correct, but Qt is usually
the one to open the socket, and we open for both read and write anyway.

Fixes: QTBUG-116550
Pick-to: 6.6 6.5
Change-Id: I4996b18b5b65c434d91543451186f335e201604f
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 74f16c0ed5f0e0bb05e8a9b40266524cec8e4257)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-27 20:37:38 +00:00
Mårten Nordheim
6c30199c45 Http2: handle empty hpack block for headers
When adjusting handling for the special traling HEADERS with PRIORITY
case the actual no-headers case handling was lost.
This patch adds it back.

Now it deals with it being empty due to overflow or just empty headers.

With a real server this should never happen though, since they either
send the required headers or don't send a HEADER frame at all. So, in
theory it will not have caused a problem for users.

Pick-to: 6.6
Change-Id: Iacbb1183f26cb1f2e7e30ace6456488c4671972d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit a680838be4cf9eee44d7977722cd5acf3422f5ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-27 20:37:23 +00:00
Jonas Karlsson
6b0cb98478 Revert "QHeaderView: relayout on resetDefaultSectionSize"
This reverts commit a8df174369cecd90f14dac85bf162353b7cb25d1.

Reason for revert: Caused QTBUG-122109

Pick-to: 6.6 6.5
Fixes: QTBUG-122109
Fixes: QTBUG-120699
Change-Id: Iea185c00f35e17d8eb8e8da70dc2d808ea274b04
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c1921abf65092f4732435a92732c8c11224d31fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-27 09:19:09 +00:00
Axel Spoerl
d47c40d51e qmessagebox.h: Remove redundant semicolon after Q_ENUM
A redundant semicolon after Q_ENUM(StandardButton) caused a compiler
warning.

Remove it.

Fixes: QTBUG-122637
Pick-to: 6.6 6.5
Change-Id: I959c0c6d56bc312ad40f18c9455f4e6118b1c7c2
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 9af3a6c146a408b42540e9aefbe8feca096dcad3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-27 07:30:04 +00:00
Thiago Macieira
b7b11c8095 tst_qmessagehandler: disable the backtrace tests outside of x86
As the comment says, on most RISC platforms, the return address need not
be on the stack in the first place. In fact, in all ones currently
supported by Qt, it's passed in a register to the callee, which has the
option of simply saving it in a callee-save register when calling leaf
functions. Even if it is using a frame pointer, the compiler can simply
use any register. That means unwinding the stack is not possible in the
absence of either debug information or stack-unwind information, neither
of which backtrace(3) will use.

Strictly speaking, even on x86 the compiler can use the RBP register for
any purpose and thus make getting the backtrace() impossible, but in
practice it seems to work.

Fixes: QTBUG-121389
Change-Id: I5dd50a1a7ca5424d9e7afffd17acbd01ef916f5d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 03f1ea3dcb956c69216084d1df3a21f460c8475b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-27 07:29:53 +00:00
Thiago Macieira
da85678c25 QProcess: set the error message and state if qt_create_pipe() fails
It can only happen on resource exhaustion, which is an unlikely
situation. That's probably why we didn't handle this case. But let's do
it now.

This necessitated that qt_create_pipe() return with errno/GetLastError()
properly set, so save it and restore around functions that may change it
(like qErrnoWarning()).

Drive-by update of some warning messages.

Testing this is not practical and is fragile, because it requires
causing the resource exhaustion problem.

Pick-to: 6.6
Change-Id: I76ffba14ece04f24b43efffd17aafe4f11f54c21
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b653e05c92dd137ca2994d9d97bea839ca9a5e73)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-27 07:29:53 +00:00
Paul Wicking
a49bf6fc6a Doc: Use QDOC_PROPERTY for QRhiWidget::autoRenderTarget
`autoRenderTarget` is a private bool that very much looks like it's
used as a Q_PROPERTY. Use QDOC_PROPERTY for it to generate warning-
free documentation.

Change-Id: Ia6255287f139ff23172c4fac96950e1a37eeef83
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 2fb8c2d5c331b1bc30a54e803e1cd17cf534fc32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-26 21:34:55 +00:00
Dimitrios Apostolou
090acf35d1 Print output of failed tests only once
Pick-to: 6.6 6.5
Fixes: QTBUG-118983
Change-Id: I4473f64a7f9ec838a2bc2f705af77fb4c5df35de
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 9379b634a8a49d809441b0616bac7733dad670ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-26 21:34:48 +00:00
Axel Spoerl
ca34c1c647 Fix build without PDF
tst_baseline_painting and tst_qpdfwriter rely on QT_FEATURE_pdf being
enabled, without making it a condition to build the tests.

Don't build the tests with PDF disabled.

Task-number: QTBUG-122137
Pick-to: 6.6 6.5
Change-Id: Idbf03f30557618c83e946a80b7759cd4f6978ad5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 90a6415bedfc4ce1a934c3a36271b20c1a6a606a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-26 21:34:30 +00:00
Eskil Abrahamsen Blomfeldt
84bbfd9c62 Fix color fonts with DirectWrite backend
The logic to detect color fonts in the GDI font database was never
implemented in the DirectWrite database, causing emojis to look
monochrome. The patch moves this into the font engine itself instead,
along with the other initialization code.

Fixes: QTBUG-122168
Change-Id: I6f5dad579bd987149e613b8071821aaf70a89bc2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 6bd85d4a27ba2e934fa76a430f2e1d55c08d379d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-26 21:34:25 +00:00
Simo Fält
233ce5b018 COIN: Move skipping Debian instructions to qt5 repo
Pick-to: 6.6
Task-number: QTBUG-122447
Change-Id: I385d60d891c68edc3aa053d3561335a46b26923b
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit df1efc70b0cb3eeff4c59adbf58702af1d9a9200)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-26 21:34:20 +00:00
Christian Ehrlicher
03514d8f2c SQL/SQLite: handle option SQLITE_OPEN_NOFOLLOW
Since SQLite 3.31 there is a new open() option SQLITE_OPEN_NOFOLLOW to
disallow a filename with a symlink for security reason. Expose this
option to QSQLite via QSQLITE_OPEN_NOFOLLOW.

[ChangeLog][SQL][SQLite] Add new option QSQLITE_OPEN_NOFOLLOW to expose
open mode SQLITE_OPEN_NOFOLLOW.

Change-Id: I2d6218bde2bf8b4f1bc36125dffa551b52369072
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3379fd2322d112af4ef7ce75aafe18c27746acae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-26 21:34:13 +00:00
Giuseppe D'Angelo
ecaf35b4c5 Text widgets: document find() behavior with QRegularExpression
The various find() overloads that take a QRE *ignore* the case
sensitivity option set on the QRE object itself. They instead apply the
case sensitivity passed in the flags (see QTextDocument::find).

I think it was an historic mishap, but it's too late to change now.
Amend the documentation.

Change-Id: I526650d89a98777c7bb839b27d2f2e536a43ca4f
Pick-to: 6.6 6.5 6.2 5.15
Fixes: QTBUG-88721
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
(cherry picked from commit 3ec9331c341767b1430eb2b14df02383226e25e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-26 21:33:52 +00:00
Tim Blechmann
a4c158effe corelib: settings - make qsettings.cpp unity buildable
Both qsettings.cpp and qjsonparser.cpp defined Space in the
global namespace. Hiding it in one of them in an implementation
namespace resolves the name clash.

Pick-to: 6.6 6.5
Change-Id: I8dd1244f80d87f3908597ed82c8e41b49b7b916c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4ff65f0e5615b1132ec13c6eeba3647162d8dd0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-26 13:22:43 +00:00
Lauri Pohjanheimo
e31fef039d Android: run runAction() actions in onPause state
Fixes QTBUG-113255 by running graphics related actions also onPaused state when the paused app is visible. Also corrects possible other
problems where UI should be updated while app is onPaused state.

Fixes: QTBUG-113255
Change-Id: I02ee6b0713ec5f08ebba676c5edf94d2c1f81958
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b01a8075193afce3934f1ec436241784d9811bce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-26 10:23:36 +00:00
Marc Mutz
3de01e4e64 QOperatingSystemVersion: clean up after QOSVBase extraction
When 3446313c7a5cd6005089866a7b20c9f28e132a0a extracted most functions
from QOperatingSystemVersion to a new unexported
QOperatingSystemVersionBase, for BC reasons, it kept the existing QOSV
methods as (inline or out-of-line) forwarders to the new QOSVBase
ones.

But the only ones that are actually still required are currentType(),
type(), and isAnyOfType(), because their Base equivalents use a
different enum type (we should probably make the OS Type an enum in
namespace Qt instead; other patch).

The others can just be REMOVED_SINCE, and should be, to make new code
use the base class implementations, where inlining and constexpr
properly work (they don't, on Windows, in exported classes).

Re-use the existing REMOVED_SINCE(6,3) block in removed_api.cpp to
move these functions there.

Amends 3446313c7a5cd6005089866a7b20c9f28e132a0a.

Reverts a tiny part of 215677818470e48e9090d7ae4411e1fea62207b8 (will
conflict in backports).

Pick-to: 6.6 6.5
Change-Id: I1d7ba784634ccd7c9ba5f7ceddb15b7787468d31
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1214edc0d94fd8b3c0d2660879d9175256c14bbc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-25 11:23:54 +00:00
Chris Lerner
dfa4ebc150 tst_QWidget::realFocusChain: don't remove from iterated QList
The method removed from QWidgetList widgets in a ranged for loop.
That caused items being skipped.

Create a new list by adding positives, instead of removing negatives
from the original.

This amends b1802a164b8682ed9e8956a5a19a90ade65c25d0.

Pick-to: 6.6
Change-Id: I3f329290187ddc76169ababe8ffa6059d953212d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 086897a1ae8e8d5bb1c1c1c18375eacba9ec97a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-24 13:49:09 +00:00
Alexey Edelev
6d809221f2 Add the external reference to CMake package creating docs
Pick-to: 6.6
Change-Id: I70560afbc78ec901169779c2b30efec0bb8d67f0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit bb058909626410d22ccd74919d69cd747fbc33ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 21:43:26 +00:00
Volker Hilsheimer
7f8c6c90bf Blacklist tst_QApplication::abortQuitOnShow on Android
Task-number: QTBUG-122693
Change-Id: I48b62a47939037f58ca321e4498d8b98d79042d8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 28572aad1189b6823b1720aef720033978c67c0a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 21:43:26 +00:00
Mårten Nordheim
fa90e1a812 QLocal8Bit::convertToUnicode[win]: Fix order of growth and saturate
The order was wrong so we could have ended up saturating a 0
before we grew to 1.
Since this has never been in a release it is of no concern, and it was
already an edge-case anyway.

Amends 1090d5dd4ae5be898d4566314eda43b0283709d9

Pick-to: 6.6 6.5
Change-Id: I4b70f9018c3049697495a58313af148f8366c8bb
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 0d6b64bec6b555a6e534538a38d40259017f0de3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 21:43:26 +00:00
Volker Hilsheimer
a558e9172d Apple: use xmark.circle for the "clear" icon
Looks better as the action in a text input field.

Change-Id: I63fd9b963102919cf69f345723d1c5d83778f1f4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Karolina Sofia Bang <karolina.bang@qt.io>
(cherry picked from commit d51a47c316dcaf65f9cb82babc9ccfcd5ba62310)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-23 22:43:25 +01:00
Aurélien Brooke
5403bfedc8 RHI: fix Vulkan layout for PreserveDepthStencilContents depth textures
Vulkan fails when we attach a depth texture to a render target with
QRhiTextureRenderTarget::PreserveDepthStencilContents (we want to reuse
the depth data from a depth pre-pass.)

vkCreateRenderPass(): pCreateInfo->pAttachments[3] format is
VK_FORMAT_D32_SFLOAT and loadOp is VK_ATTACHMENT_LOAD_OP_LOAD, but
initialLayout is VK_IMAGE_LAYOUT_UNDEFINED.
The Vulkan spec states: If format includes a color or depth component
and loadOp is VK_ATTACHMENT_LOAD_OP_LOAD, then initialLayout must not be
VK_IMAGE_LAYOUT_UNDEFINED (https://www.khronos.org/registry/vulkan/
specs/1.3-extensions/html/vkspec.html#VUID-VkAttachmentDescription-
format-06699)

To fix this, just do the same as color attachments: specify a
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL instead of
VK_IMAGE_LAYOUT_UNDEFINED when the depth-stencil is preserved.

[ChangeLog][RHI] QRhiTextureRenderTarget::PreserveDepthStencilContents
now works properly on Vulkan

Change-Id: I0577bc8021b3598ddfdcea4af98aaef46e8a4519
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 9904686cf3e3fb59fa7839b2d16a6c78bb35bfa1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 21:43:22 +00:00
Laszlo Agocs
36d2fb1f9f rhi: d3d11: Fix depth texture by porting from the d3d12 backend
The newer D3D12 backend uses DXGI formats (for the texture, DSV, SRV)
that actually work. Backport these to the D3D11 backend. Otherwise
attempting to create a render target with a D24 or D24S8 QRhiTexture
as the depth/stencil buffer won't work.

In practice this is rarely exercised since the depth-stencil is
typically a QRhiRenderBuffer that maps to a
DXGI_FORMAT_D24_UNORM_S8_UINT texture but without
D3D11_BIND_SHADER_RESOURCE. Whereas textures get the latter flag,
and things break down. At least now the usage of typeless and
typed format is uniform. It could still be questioned if D24
should actually use R24G8_TYPELESS or if the original was fine,
but for now just sync with the D3D12 backend.

Pick-to: 6.6
Change-Id: I8a0564fc42a7866dae90f49f7b557c83dffc4d6e
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 51106995cbf51af0c92b34119f6d254568a67540)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 21:43:22 +00:00
Laszlo Agocs
aaba67eea9 rhi: gl: Fix multisample texture specification
...so that MSAA is actually effective.

Pick-to: 6.6
Change-Id: I4bf85df1312773ec29154a51c9c8464912e6ef8a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 46366a14a41ec6db5ab4ab72c473a4a4e187d484)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 21:43:21 +00:00
Laszlo Agocs
f9557be6f6 rhi: gl: take sample count from textures too for RTs
Rendering into a multisample texture (color or depth-stencil) is
supported, but the code only seems to pick up the sample count from
renderbuffers.

Pick-to: 6.6
Change-Id: I95a97debfebc7582f2026282384f6fb97aadfe23
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit ce54e07dacd99ae9d532b6398cdeedc287ee2743)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 21:43:20 +00:00
Øystein Heskestad
8dd7aba7fd QDataStream: Turn QDataStreamSizes enum into static contexpr quint32
The special sizes NullCode and ExtendedSize does not need to be part of
an enum. Turning them into constants removes the need for some casts.

Task-number: QTBUG-119952
Change-Id: Ie7835c52f4642ab907b91f0eceac2ea7650e81da
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit fb81373313c4d1834437351aeb5df4a44303b93c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 15:39:53 +00:00
Alexandru Croitor
3d18b218dd CMake: Fix passing -DFOO=0 to configure.bat
Add a space before the redirection operator, so that the '0' in
'-DFOO=0' after '%*' expansion, does not get squished with the '<',
effectively redirecting from '0>' instead of stdout.

As a drive-by, also add a comment why we need the '.'.

Pick-to: 6.6 6.5
Fixes: QTBUG-122622
Change-Id: I74ea3a1fe751cc1f2ad216b309f6b24d6d5f6b7f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 0165a91bff80722d2384914dd40ca65a20fc1a47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 15:39:53 +00:00
Alexandru Croitor
a567d408b6 CMake: Improve doc page of the QT_WASM_MAXIMUM_MEMORY property
Fix typo in 'application'.
Emphasize MAXIMUM_MEMORY.
Link to the latest commit of settings.js instead of the master branch,
so the link doesn't break in the future.

Task-number: QTBUG-121705
Change-Id: If4bbdcc4fa33d86a892c81dfd1d2703386a0035b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 3ec4a555599d352fa97272b8df612bf33e752878)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 15:39:53 +00:00
Nicolas Fella
74c59f8a23 QIcuTimeZonePrivate constructor: save iteration over all zone IDs
ICU returns a "valid" representation of GMT when given an unrecognised
ID, so QTZ's constructor has been checking the ID is available before
passing it to the backend constructor. That availability check was
done by generating the list of available IDs to see if the given ID
was in it; this is very inefficient. Furthermore, the QTZ constructor
was also checking availability, to work round the same issue in only
this one backend, making the check redundant.

So overide isTimeZoneIdAvailable() in the ICU backend, calling
ucal_getCanonicalTimeZoneID(), which answers the question directly;
and drop the duplicate check in the QTZ constructor. Expand a test to
verify an invalid name is rejected.

Fixes: QTBUG-121807
Pick-to: 6.6 6.5
Change-Id: I34f996b607b958d12607a94eb273bb1b406cca1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 00d9a9a9b59650b8e297f91dcc600c377da5bceb)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-23 16:39:52 +01:00
Mårten Nordheim
975ee89cea QHttp2Connection: confirm successive remote stream IDs are higher
And it should also apply to the promised streams, not separate ID tracking.

https://datatracker.ietf.org/doc/html/rfc9113#section-5.1.1

Change-Id: I6826a39c98f9b6a585200e628533843db731a85b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
(cherry picked from commit e247a6ce9ff83ef62424eef01d26cb752a4d2abc)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-23 09:28:23 +00:00
Kai Köhne
36d14d76fd Doc: Mention AA_DontUseNativeDialogs in QFileDialog
Pick-to: 6.6 6.5
Task-number: QTBUG-119551
Change-Id: I54f7e8f4b855b15d22b2180095cbf454b31412c3
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit d3117e97014af029b2c117daef9695b87103ab25)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-23 10:27:59 +01:00
Rayam Pinto
206000166f Implement icon mapping for Apple, Android, and Windows
Not all xcb icons have a corresponding icon on all other desktop
platforms, so we might want to remove those enums for which we have
almost no coverage in a follow-up commit.

Change-Id: I8fdc64f773768ce4ed1e0050f2a3bddef976e688
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 72d129c45e92eb55c64a336bb60a1ebca471241f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 09:26:26 +00:00
Julian Greilich
68d611a25c Revert "Android: move referral global field to local variable in QtActivityBase"
This reverts commit 5b5f4344daa4df023007cd59efdf8f36b00bb150.

Reason for revert: Without the key being public, we would have to duplicate this variable in our application code when fetching the stored referrer.

Change-Id: I46ad3618da9912c41f8248f871c24dd41015af2b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 950998223b68a247ac96f7e3ef92db9f89bfec0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 08:31:15 +00:00
Tinja Paavoseppä
ec9eb9d90b Android: Add QtEditText to QtWindow in constructor
Of course, createSurface() is called more than once, for example
when coming back from the background, and you cannot add a View
to the layout more than once, since this leads to an uncaught
exception and a crash.

So add the QtEditText once, in the constructor, as is indeed
sensible.

Fixes: QTBUG-122648
Change-Id: I7ef48951cd8a1c99935f5e96c70b6dbf0c745803
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 211e51b81ec9800161d0a98c6f70c747701035e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 08:31:04 +00:00
Petri Virkkunen
46ead3fbef Do not register focus listener for null view in QtEmbeddedDelegate
A null view can not be focused.

Change-Id: I0564dd554a304e2e60e3ae83c4782ac348edcd9b
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 14851471eefb8708a52981532ebaeed87509381f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 08:16:10 +00:00
Petri Virkkunen
f52e7c99e9 Move QtDisplayManager dpi calculations to functions
In order to use the same functionality from outside the class and avoid
reimplementation, moving the dpi minimum value check to functions.

Change-Id: I242b18fafab1b6283a46bda8b59e87adf50e5c0b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 7bbd39c4c9f345ae48781a212a6544e72757fd3e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 08:16:04 +00:00
Marc Mutz
030496750e QDBusIntrospection: make DiagnosticsReporter safe to use
Add a virtual destructor to this polymorphic class and disable copying
(requires to bring the default ctor back manually, and to export the
class nested in an exported class).

Amends 248d2103b5ef8f9cf8c1189cb67d78e1b6e741b7.

Change-Id: I9008e4ecebca34feac6ae92fa026f2673b652ba9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 02d7c8c069b93f7ddc1ccba462d8ff9ec3c1d806)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 08:02:09 +00:00
Marc Mutz
368f788ba1 QDBusIntrospection: fix position of Annotation definition
When 2e8a48c1cdc8547ec47f097a41dd53c641715b77 made
Annotations::mapped_type a struct Annotation instead of just QString,
it inserted the Annotation definition after the first inline user of
Annotations (struct Method).

I don't know why this compiled in the first place, but it did,
probably because of the re-parse-everything-at-closing-of-class rule,
but there's no reason to not move it to before the first users, so do
that.

Found while trying to make QDBusIntrospection a namespace instead of a
struct.

Amends 2e8a48c1cdc8547ec47f097a41dd53c641715b77.

Change-Id: I316cb5e49f3476adc5ff5abb023b9d74303ab640
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 448d4f847a263d88ee2149a728bcb390e15cefbc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-23 08:01:55 +00:00
Marc Mutz
175f2c4f33 QOperatingSystemVersion: fix UB (invalid static_cast)
When the QOSVBase we're constructing from isn't an actual
QOSVUnexported, the cast from QOSVBase to QOSVUnexported is
invalid. Instead of casting, add an QOSVUnexported(QOSVBase) ctor and
just call that.

Amends 215677818470e48e9090d7ae4411e1fea62207b8.

Pick-to: 6.6
Change-Id: I7352a044b62086585f1b036433f9b8779c77ac9d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit e3c831dc558de7e83c81fe09644db18013d5dd65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-22 23:10:32 +00:00
Marc Mutz
a2be9f7a39 CompactStorage: make it default-constructible again
When 30a8e79243084017d23f1c765d5f1cbb86564191 added constructors as a
work-arund for an MSVC issue, the default contructor became deleted.

This hasn't caused trouble so far, as all users apparently pass a
payload object, but I'm about to merge a new user that doesn't, so
this came up.

Fix by bringing the default ctor back using =default.

Amends 30a8e79243084017d23f1c765d5f1cbb86564191.

Pick-to: 6.6
Change-Id: Iaf1a9536c2e0b24a62fdd55c837478a3450da38c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 1b89d747d7da7bffd515a5521e7dd5212c95f7af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-22 23:10:32 +00:00
Alexey Edelev
c11d505a89 Wrap condition in _qt_internal_check_depfile_support with parentheses
The AND/OR combinations are not evaluated correctly. Wrap them with
parentheses explicitly to ensure the expected evaluation order.

Pick-to: 6.6 6.5
Change-Id: Ib2515ba85417b32cef3f799e0cb2c89d2c4257ab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7ac969e1461478974f62a46a913d6cd2b34ed80a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-22 23:10:32 +00:00
Allan Sandfeld Jensen
50417e36dd Fix support for Input color spaces
Not really a common use-case and shouldnt be in images anyway, but
we have the code to support it, except it had a typo in it.

Pick-to: 6.6 6.5
Change-Id: I8585eaf7be82f13e61c94430743d765359fa48fe
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b697de79b041cd47e86b578a3a119fb3e7b62f71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-22 23:10:32 +00:00
Alexandru Croitor
fd8696e943 CMake: Fix missing output of TEST_x86intrin_OUTPUT config test
When the intrinsics test failed, we never showed the failing build
output due to two reasons:
- TEST_x86intrin_OUTPUT was empty
- bracket arguments don't do variable expansion

Use the newly introduced feature in qt_config_compile_test to get
the output.
Replace the usage of a bracket argument with a concatenation of
regular strings.

Amends db342f42a4b00f858cb43328c9fdaff5fe2b5788

Pick-to: 6.5 6.6
Task-number: QTBUG-122596
Change-Id: I7cdef9a145ac64c8fced8add4879fa19b8bcd19d
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9e9099865a0881ac5bb6035237e0a0c86962c45f)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-02-23 00:10:32 +01:00
Alexandru Croitor
6674c0f8f9 CMake: Teach qt_config_compile_test to set the build output
The qt_config_compile_test command now assigns the build output of a
config test to the TEST_${name}_OUTPUT variable in the callers scope.

We can use this to show error messages, and it can also be seen in
trace files for better troubleshooting.

It works for all project based calls with CMake 3.16, but for source
code based tests, due to the usage of check_cxx_source_compiles instead
of try_compile, it will only work for CMake 3.23+.

Pick-to: 6.5 6.6
Task-number: QTBUG-122596
Change-Id: Ib9664c158ba9a391bd17bf30a28f9a34eba991d5
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3334a77ecfb792fba0144e99887f11cd0fa2506d)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-02-23 00:10:31 +01:00
Volker Hilsheimer
8ca6eb2b39 JNI: Support declared QtJniTypes in QJniArray
They can be treated like QJniObject, but are not QJniObject instances.

Change-Id: I419b6d0493f9a0ad3dcc726d48ac4c9ad3e6bc19
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 77e00a4d08498285ea4273e01fda489ae6a7fd8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-22 19:44:02 +00:00
Marc Mutz
60ee856adb QDBusUtil::isValidBusName(): remove an impossible condition guard
QStringView::split() only returns an empty container if a) the haystack
is empty and b) SkipEmptyParts is in effect.

Neither is the case here: We use the implicit default of KeepEmptyParts,
and we've already checked that the haystack isn't empty in the first
line of the function.

So the result of split() can never be empty here. Remove the check to
avoid confusing more readers than just yours truly.

Amends the start of the public history.

Pick-to: 6.6 6.5
Change-Id: I423e747ae4de0708d063a6bb2befd625dbd5c591
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 05f9996bbf45fc90e49ea8c1679fa25201555860)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-22 19:09:23 +00:00
André Klitzing
b71dd650c6 Remove ; after QT_DECLARE_EXTERN_RESOURCE
This avoids a warning with clang compiler.

error: extra ';' outside of a function is incompatible with C++98 [-Werror,-Wc++98-compat-extra-semi]
QT_DECLARE_EXTERN_RESOURCE(AusweisAppQmlModuleMoreView_raw_qml_0);

Change-Id: Id289080884ba2b017e884a15debfdd46102f1093
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 11259972a3c5d1918f889f145a1f223bf7d876a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-22 18:09:50 +00:00
Laszlo Agocs
eb3529ea35 rhi: d3d11: Flush() when destroying a swapchain
Task-number: QTBUG-120276
Pick-to: 6.6 6.5
Change-Id: Iaf79c4dcf60d9a52bd562fd94976402cf570147d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit cff5a49cc20c3c9d98a5f97cd702a378ae29611b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-22 17:56:13 +00:00
Joerg Bornemann
fdf06f5db9 CMake: Default QT_I18N_SOURCE_LANGUAGE to "en"
Task-number: QTBUG-122396
Change-Id: I36c76211529e685aa1c85a7fb1b15667ad479185
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 974d791f3674031675113289f4bf09d4d21ac488)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-21 17:22:08 +00:00
Joerg Bornemann
e294095b48 Doc: Link to qt_add_translations from qt_standard_project_setup
Task-number: QTBUG-122396
Change-Id: I88e95eace2f6d387cf03aa42394e90231d0f9a9c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1d55864607f5fd44e7e5d9515ab023202c373a1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-21 17:22:03 +00:00
André Klitzing
13590640c3 Add newline after import
This avoids -Wnewline-eof for clang compilers.

error: no newline at end of file [-Werror,-Wnewline-eof]
    Q_IMPORT_PLUGIN(Governikus_AnimationsPlugin)

Pick-to: 6.6 6.5
Change-Id: I8de21f1f27cd177211ebf70fac0e01292cfa410c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f926ccbf64791ded226da187674e7a5f6a40eca7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-21 17:21:55 +00:00
Joerg Bornemann
2d5d8137fc CMake: Rename I18N_*LANGUAGES variables and parameters
...according to the Qt 6.7 CMake API review.

Task-number: QTBUG-122396
Change-Id: I42012e346325ff05d63fa4dac44276eef15320fe
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b387a6cd8aedf03e4445bbdf757398e85c041635)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-21 17:21:53 +00:00
Volker Hilsheimer
e749540a24 QIcon: complete the documentation of ThemeIcons
Add missing \since 6.7, and document the purpose of each value based
on the description in the freedesktop specification.

Change-Id: Id88438abf152c317600454d7137a19b13aa0a3cc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit b5a0db53b5eac7c0be8bc99ba79097608bf3e71f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-21 17:09:38 +00:00
Volker Hilsheimer
cb24a119b9 QIcon: remove unmapped ThemeIcon enum values
The ThemeIcon enum provides symbolic names of icons for which most
engines provide an icon. We couldn't find a matching icon for several of
the XDG icon names, so remove those enum values for which we don't have
at least two matches.

Also remove names that are too specific for a desktop environment,
like icons for certain applications or system-wide actions.

Change-Id: I5a6c74256bda66d9fde7513f834a8361858605c4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 0de09beee54f715e4d2b1e739cf75c8c8d78db16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-21 17:09:38 +00:00
Marc Mutz
b2b3a08dbd QMime: remove unused qmap.h includes
These TUs never seem to never have used QMap, QMultiMap or
QVariantMap, so remove the superfluous includes.

Amends ffa5820fa3bf8b28675129919d748373d6c77827.

Pick-to: 6.6 6.5
Change-Id: I3381fced294d7b99d3553d0efde38f20f01e4e97
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 7285fea9f3ba0824dbc12bb9de463f8e6ebd3c2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-21 17:09:38 +00:00
Marc Mutz
f9725e7013 [docs] QDBusUtil: remove documentation of bygone functions
The referenced QString overloads were removed when
6bbfae9457248f1f65cf18f87ecc6ff66a6fdd70 ported from
QString/QStringRef overload sets to single QStringView functions.

Remove the docs.

Amends 6bbfae9457248f1f65cf18f87ecc6ff66a6fdd70.

Pick-to: 6.6 6.5 6.2
Change-Id: I766ad104f83aa19d90eeefe5b67524184869640a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 0be4e195fd9b20f33b70a8527cf581eff5fb7a84)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-21 17:09:38 +00:00
Topi Reinio
d8e3105737 Doc: Move OpenGL examples to '3D' category
Task-number: QTBUG-122377
Change-Id: Id4c765c128ad2e90cacfffaa3f798bad349e71e8
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit e858e86c9fb5f74f0c47d93cf46b98ec0081db96)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-21 17:09:37 +00:00
Lorn Potter
3143e4118e wasm: update Emscripten to 3.1.50
Change-Id: Id147a927420a1743ef1cfd952b36e90ac0c319dd
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 87738e8b81aa02696f8a9fb3749042e988bf77c9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-21 12:46:22 +00:00
Kai Köhne
87c9ba4866 Doc: Improve documentation for QFileDialog::Option
Do not add new paragraphs in the \value description,
which breaks the generated HTML table. Instead, use \br
more often to break overly long lines.

Replace 'option is only valid' or 'supported' by
'effective' and 'used'; if an enum doesn't apply to a
dialog or platform it will just be ignored, but it's
OK to set it.

Fix link to DontUseCustomDirectoryIcons enum.

Pick-to: 6.6 6.5
Task-number: QTBUG-119551
Change-Id: Iac86a85c7b3b402997fa14f4c4e2fa7111c62e9e
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 8fd3f7e578ef65a77c4ba1ed981db98d99cd3e98)
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2024-02-21 13:46:22 +01:00
Volker Hilsheimer
746e6d4b48 Apple icon engine: maintain aspect ratio of image
Don't return fixed square icon sizes from availableSizes(), respect the
aspect ratio of the input image we get from the system, and return an
actualSize() that fits into the requested size, but uses the image's
aspect ratio as well.

Reuse the calculation in the rendering code.

Amends 5b993fa8ede67871a8b2434505bc3c3d8bb906c6.

Fixes: QTBUG-121764
Change-Id: I672b90a1fbecb662fd6614dcfa5090e28b16f3c8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
(cherry picked from commit 8a19f3c089deafa8a3a5fa5a05baa7ca01d8ec14)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-21 12:46:22 +00:00
Alexandru Croitor
5e7cd47721 CMake: Fix wasm build without PCH enabled
There were a few missing includes.

Change-Id: I352f4745a2691e96160408ab234a1ed8549f063c
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 9fe6190b5b609d7f69b61db4d4c77aad2eddf8ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-21 12:46:22 +00:00
Tor Arne Vestbø
e8c857a6cc Remove unused method QPlatformBackingStore::rhiSwapChain()
Change-Id: I8fa8a0789d382ffb3e77ff79ac507d857442cbf4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 02dbabdc708a570612dc12c137ab2ead6da3aadf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-20 21:26:04 +00:00
Lorn Potter
93f8c8f3e6 wasm: make opengles3 (webgl2) default surface format
All major browsers support webgl2 out of the box.
[ChangeLog][WebAssmebly] Default OpenGL ES version raised to 3.0

Fixes: QTBUG-110686
Change-Id: I875b55c2e0f6e955249f121d92214cf10ed416d7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit ee25bde3edf08e27efbb9619683ffb5517115817)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-20 21:07:47 +00:00
Lucie Gérard
f67888e8db Correct license
According to QUIP-18 [1], all build system files
should be BSD-3-Clause.
The files in this patch are part of the build system.

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I9a79fb04971b117515ed16b3978435ad8ef0e31f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 08b8f9dd2f3e792a6fb43b7e065a7123dff74313)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-20 16:44:31 +00:00
Alexey Edelev
7369e8b7c1 Remove QT_ANDROID_DEPLOY_RELEASE variable
We assume that we can remove the variable handling and replace with the
warning, since variable was never out from TP.

Task-number: QTBUG-121706
Change-Id: Iee29c0b5327d62cd3d7e77419e14e555fadcec2c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit bb68cc5844b364987b4f8317ba2d4509b9253cf1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-20 16:25:35 +00:00
Ivan Solovev
bc60c5183d qfloat16: use new \compares command
... to describe the comparison operators provided by this class.

Task-number: QTBUG-119433
Change-Id: Ifde49fb60aa50b733a35aa01c7a031b82fb06836
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4281495f52c22326ae961849d8ad7362c30168d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-20 15:42:36 +00:00
Ivan Solovev
7eeb96c290 Date and Time classes: use new \compares command
... to describe the comparison operators provided by these classes.

Do not remove the existing documentation of individual operators for
now, because the new commands do not contain any links to explain what
do the types of ordering actually mean.

Task-number: QTBUG-119433
Change-Id: I663b992377ea8b00ffa0c0a64da0733e3772d1dd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e766a338345a3ac00d9e6ae498353616dd5d4c77)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-20 15:42:26 +00:00
Giuseppe D'Angelo
098b53790b Mark the REST enablers as Tech Preview
Change-Id: Ie49a447f0f885290d43a7e4ecb0e0754df0da3e3
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b4c90582a2dee5c534361b3903611206305b03c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-20 15:27:34 +00:00
Friedemann Kleint
ac42639ad7 Windows QPA: Fix unity build
Undef a macro that clashes with variables in other sources.

Pick-to: 6.6 6.5
Task-number: QTBUG-109394
Change-Id: Id62f886ad64908047fc896f7e48da04759308123
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 9362e4f3fa7c42b9d76fd5b4dd504e749b3bcaab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-20 15:27:33 +00:00
Eirik Aavitsland
824d293601 QPainter: fix assert when drawing bitmaps at very near to .5 coord
The code assumed that the rounding of a floating point value, and the
rounding of the sum of that value and an integer, would always snap in
the same direction. But because of accuracy limits (independently
of the rounding function employed), that is not always the case for
fractions very near to .5.

Fixes: QTBUG-122451
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I0825d42e6be7f6e3397760a5e9be5dddca42dcdc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit a43d86fe1c0bc9d352f67c134a9ee5f754aea5e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-20 15:27:31 +00:00
Lucie Gérard
d251de904a Correct util file to reduce exceptions
Task-number: QTBUG-121787
Change-Id: I538ecece16c6daeef4394e29a1581c52bd4d9d02
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 657e0ec3430a0da377fadaedd7da6e51e5b4c0ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-20 15:22:44 +00:00
Lucie Gérard
6bb0f3d161 Change license in files to avoid LGPL and non-LGPL license mix
According to QUIP-18 [1], all module files should be
LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
or
LicenseRef-Qt-Commercial OR GPL-3.0-only
LGPD and non-LGPL licenses should not be mixed in a
given directory.
The files in this patch are the only ones in their directory
with non-LGPL license.
The license is changed to that of the other module files
in the same directory.

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: Id58248a6f60438e01e77e9448f07e3057d173260
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0fd636d7cc4f9d50b1623e9374215a15640af5e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-20 15:22:43 +00:00
Lucie Gérard
cb85390fc2 Correct license in config.test
According to QUIP-18 [1], all build system files should be
BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I06880d91e4c6f8d7a92d249f3d216b2bc82fdeed
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit d478ca528511fcaa95491bcedaa259b2f6c5e727)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-20 15:22:43 +00:00
Kai Köhne
59c220d59d Be more verbose if QT_LOGGING_DEBUG is set
Fixes: QTBUG-121380
Change-Id: Ieb977ada03aa0128cbaeee796f42508fd6db4031
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 0616741288f425e5dc58e13eb5f099e4e8ce3a49)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-20 11:35:34 +00:00
Tinja Paavoseppä
76a40b2e73 Android: Implement input connection listener in QtInputDelegate
This way we can just pass the input delegate as the listener for
QtEditText when we create it, and having the listener in a separate
member doesn't provide a real benefit anyway.

Task-number: QTBUG-118139
Change-Id: I0125c87ecd39eed550a120ea8326d2c50a1b016e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0e95d3ab57f4f57e65f7bb6019064ce4e31135a3)
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-02-20 09:38:52 +02:00
Giuseppe D'Angelo
467749ce99 Long live QT_TECH_PREVIEW_API
A macro to mark tech preview APIs, in order to make header reviews
easier:

* newly introduced TP APIs are clearly marked as such;
* an API that leaves TP and becomes stable requires to change the
  header, and not just the documentation (and therefore will again
  appear in the header review).

The idea is to use this macro as if it were a C++ attribute.
It can't actually be an attribute, because we want to use it to tag
e.g. macro expansions (like Q_PROPERTY).

Change-Id: I05c5a91a4fa5bedfbd1c6146d4dc00e1d1d28628
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 32a1151245034e4d5d3162df21518e38b6f81fcd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-20 07:22:49 +00:00
Giuseppe D'Angelo
18d15404cb PCRE2: upgrade to 10.43
Apart from some source code reshuffling, 10.43's JIT has
dropped its support for ARMv5.

[ChangeLog][Third-Party Code] PCRE2 was updated to version 10.43.

Pick-to: 6.6 6.5
Change-Id: I7909f0a9358f38282f5eaeacd2eb10529b47e63c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 909d881e7539bc77ab79650782ae91372fb4ee83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-19 22:48:24 +00:00
Christian Ehrlicher
ee62ac4330 Fusion icons: fix artifacts in media icons
The fusion svg icons had some unneeded transparent objects which lead to
artifacts during png export/pngcrush optimization. Fix it by removing
the unused objects and re-export the pngs again.

Fixes: QTBUG-122272
Change-Id: I13c670a90e88dd31cb7a066c3565cf30c42e83b5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit dfe5118f927a45c56d508ffa8662e05c2f99d68d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-19 21:43:28 +00:00
Mårten Nordheim
cd307451ae QHttp2Connection: fix potential streamId reuse
Change-Id: Ib81058c4613820f15f55388b87433875c11492dd
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit df4322f7f7dc818c5dd1dd859ce5010116d5d651)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-19 21:43:28 +00:00
Wladimir Leuschner
4f92e8fe50 QWindows11Style: Set mask for MDI Window only in case widget is valid
Fixes: QTBUG-122398
Change-Id: I3f7e01548f4a243b2356cbc1e669384fce1d1261
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 6bfdfea6d6c72d5ed4be8c60e8dcad150d3f1e8f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-19 15:41:57 +00:00
Tinja Paavoseppä
d2ae5ef51e Android: Fix code style issues in QtEditText
Remove m_ prefix from function arguments. Move constructor to be
the first method.

Change-Id: I8854c3964ccd609666d8bbae631e59bcaee768f3
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit c545a3a086a6747b09ed8fffbcd85e0efeaa896f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-19 15:06:15 +00:00
Petri Virkkunen
4247c25b1f Android: Move textfield option handling to QtEditText
Previously QtEditText input method hints, input type and caps mode were
parsed and set inside QtInputDelegate. Given these things are only
relevant for QtEditText and did not use any QtInputDelegate internals,
moved them to QtEditText.

Task-number: QTBUG-118139
Change-Id: I5162e890679f6e14adf42647572c0fb96ad451b9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1ed1122fc3fb2c1cbdc3befec584e4e84754ef01)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-19 15:06:04 +00:00
Joerg Bornemann
9d0137cce1 QMake: Fix quoting of WASM's ASYNCIFY_IMPORTS linker option
WASM projects failed to link on Windows if "CONFIG += silent" was
specified in the .pro file and the build environment did not contain
sh.exe.

In that case, QMake prepends "@echo linking && " to the link command.
The mingw32-make tool then considers this command as "complex command"
and runs it through either sh.exe or cmd.exe, depending on whether
sh.exe is found in PATH. If cmd.exe is used, the single quotes around
the ASYNCIFY_IMPORTS option are passed verbatim to em++. Then em++
thinks 'ASYNCIFY_IMPORTS=qt_asyncify_suspend_js,qt_asyncify_resume_js'
is an input file. That file is of course non-existent, and linking
fails.

Remove the single quotes around the linker option. They are not
necessary.

Pick-to: 6.6 6.5
Fixes: QTBUG-122192
Change-Id: Id362b51ac787f7f235bcb3d9102c5dee66ce5768
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9c56c1f7c2a9aa28eb800d16d783290ff4b55aa4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-19 14:24:16 +00:00
Kai Köhne
59ce981061 Assign a category to Contiguous Cache Example
Pick-to: 6.6
Change-Id: I98e62adce63df7e940d96cd50dcb243366dca216
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit f54d222d223262b07580a082f95a9f9935d5743f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-19 12:20:22 +00:00
Marc Mutz
21177c79bc QTzTimeZoneCache: don't hold mutex while parsing files
The QTzTimeZoneCache::findEntry() function is always called with
QTzTimeZoneCache::m_mutex held, from its only caller,
QTzTimeZoneCache::fetchEntry().

However, findEntry() performs quite heavy parsing, reading
e.g. /etc/localtime or a file in /usr/share/zoneinfo/. These files are
larger than 2KiB file on my system.

Even though findEntry() doesn't touch m_cache during its operation¹,
it thus prevents other threads from looking up (and even parsing)
other entries in the cache.

A straight-forward solution is therefore to drop the mutex in
fetchEntry() for the duration of the findEntry() call² and then
re-acquire it for the final m_cache.insert().

This means, of course, that more than one thread could parse the same
file concurrently, and then one of the thread's result would be
discarded. Having the file already in the OS cache makes this probably
less of an issue than it sounds, but more complicated protocols are
readily implementable, should it become necessary. QTBUG-122138 has a
sketch.

¹ It's a static function, so it cannot access NSDMs.
² Incl. the heap allocation required to store the result in QCache.

Fixes: QTBUG-122138
Change-Id: If0cba6d041fb21a48cbde6b43190662a2c55cd25
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 039b2e4e5dca0fbf98a10fe548467034eeddf117)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-18 08:37:24 +00:00
Marc Mutz
3265e2467d QTzTimeZoneCache: make findEntry() static
It doesn't need access to the members, so making it static both saves
the implicit this pointer, and communicates to the reader that this is
function doesn't access other QTzTimeZoneCache members.

In particular, it proves that it doesn't really need to be called with
m_mutex locked, cf. QTBUG-122138.

Task-number: QTBUG-122138
Pick-to: 6.6 6.5
Change-Id: I28c99be8d066c1647aaf7aa256b6400a6dd92955
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7862453ba9cbcb601b9aad59dd821ae49661de4a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-18 08:37:18 +00:00
Ahmad Samir
1edd218b55 QAtomicScopedValueRollback: IWYU instead of including qglobal.h
Change-Id: Ie2cde2a72169204cbc5cc8b981d9dfd1210abbe0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9f66c9396f2dfd96e8b73ae34c75f168254d7bd6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-18 08:37:09 +00:00
Kai Köhne
901b61bb6a Remove year from generic Qt copyright information
While at it, also add the missing dot in Ltd. (as
it's an abbreviation). Also, prefer https:// over
http://.

Fixes: QTBUG-121906
Task-number: QTBUG-121928
Pick-to: 6.6
Change-Id: I4e1f1563376ae36b3c260359d830f00969ab9351
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6ea922b584a5f55cb73519aa81f074db59b96404)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-18 08:37:02 +00:00
Marc Mutz
1bba8b894a QLoggingRegistry: further defend against non-NUL-terminated strings
Various functions in QLoggingRegistry took QByteArrayView, but they
continued to assume that the data was NUL-terminated (converting back
to const char* by calling data()).

Make sure only NUL-terminated strings are passed by taking in the
tranditional way, as const char*. Keep QByteArrayView when storing in
the map as key, to avoid comparing just pointer values (as opposed to
the string content).

Amends 806545fcc8d6b3b96a5191a00a31e9a39837189c.

Pick-to: 6.6 6.5
Change-Id: I232167d4c91070369e770c41d3ea53bd2406a03f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6b59ff573028eabba42ca63ce50ce05fa160ecaf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-18 08:36:48 +00:00
Ahmad Samir
27291b97b4 QTimer: make both defaultTypeFor() methods constexpr and noexcept
Also de-duplicate the code by using defaultTypeFor() in singleShot(),
this way the comment and the calculation are done in one central place.

Change-Id: Ib822cae0e9228e546b664fbac728a60d65c4bbc3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit adc0920c48d812fb1b3e2b7bfc76217a7126a41e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-18 08:36:43 +00:00
Marc Mutz
25649bcd3b Avoid double-lookup in QLibraryStore::findOrCreate()
The code is in a critical section, so don't waste time traversing the
QMap twice.

Now that two previous commits have re-arranged the code such that
lookup and insertion are symmetric, we can combine them into a single
lookup using operator[].

Pick-to: 6.6 6.5
Change-Id: I4a10cece65b8c35d05a9b80967bf15d2e15bd73f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7192b1184190982b6422196121821838d9fcbba6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-17 16:19:59 +00:00
Axel Spoerl
39e9b6b24c QXcbWindow::handleLeaveNotifyEvent(): Consume when leaving geometry
QXcbConnection::mousePressWindow() returns the XCB toplevel window,
which has consumed the window system's last mouse press. When the
function returns a valid pointer, QXcbWindow::handleLeaveNotifyEvent()
didn't propagate the leave event to QWSI::handleLeaveEvent(). Instead,
the leave event was ingored.

That behavior is correct, e.g. when a button on the main window is
pressed and the mouse hovers away from the button, with the mouse
button continuously being pressed. It is not correct, if the mouse
cursor leaves the main window.

=> Ignore the leave event only as long as the mouse cursor remains
within mousePressWindow()->geometry().
=> Deliver the leave event, when the mouse cursor leaves the window.

Fixes: QTBUG-119864
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I30a6ebedcd148285b9f17dfd87885ff67726b54c
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit ec24b36d3db82c340d9386951ea48c26f77c2923)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-17 13:23:33 +00:00
Christian Ehrlicher
7874fc1ac8 Style icons: fix artifacts in media icons
The media svg icons had some unneeded transparent objects which lead to
artifacts during png export/pngcrush optimization. Fix it by removing
the unused objects and re-export the pngs again.

Fixes: QTBUG-122272
Change-Id: I7e63ef53e5a78ce3a06c0053dea98e13c6ba264b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7a4b307210f2825f5f53b6d6f8537f27cc9659a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-16 22:57:30 +00:00
Ivan Solovev
62a8bb3477 Refactor tst_qcomparehelpers
Previously the test consisted of just one cpp file. An attempt to add
more test cases to the file resulted in the minGW compiler complaining
about a too large object file:

 Fatal error: tst_qcomparehelpers.cpp.obj: file too big

This patch splits the implementation into a header and a cpp file.
This itself does not fix the issues, but now we can add the new test
cases in a separate cpp file. This patch also adds some comments
that advocate doing so.

Change-Id: I451987370fa4e18b7ad81dfc064ea016f1d0da47
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit e26914fa0fe8b6bb2a045a8d37e1b73777a5e0ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-16 22:57:30 +00:00
Mårten Nordheim
4483e81440 QLocal8Bit::convert{To,From}Unicode[win]: use more of state
Like other backends we should increment the invalid character count
when we output a replacement character.
And we should also output the NULL character if requested!
The downside here is that convertFromUnicode doesn't even have the
ability to do so. So instead I added a comment explaining why it is not
handled there.

Task-number: QTBUG-118318
Pick-to: 6.6 6.5
Change-Id: I57ba631aa59454e77007ab353277b7e8c2b5526a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 3c8d71796499a2ca641758dc1e9af4a778c8ef41)
2024-02-16 20:47:47 +01:00
Zoltan Gera
2a950ce36e Android: Do not double finger size for touch events
Fingers in touch events are modelled by rotated ellipses with their
major and minor axes stored respectively. The axis is the diameter of
the ellipse in one direction, not its radius. These values should be
converted to a rectangle correctly, without doubling their extents.
The pair of this fixed code is located in function
QWindowSystemInterfacePrivate::fromNativeTouchPoints().

Change-Id: I4fea7e8168a9c248a744964d4821b774b85a6cf4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9a0098f4b34e88f28d3d5d6d88948dcf8606e7b3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-16 14:45:03 +00:00
Thorbjørn Lindeijer
2cfe7199a2 QGtk3Theme: Fix QGtk3Interface::fileIcon
By failing to set the G_FILE_ATTRIBUTE_STANDARD_ICON attribute, the
"icon" returned by g_file_info_get_icon was always null and a
GLib-GIO-CRITICAL warning was output to the console (at least since glib
2.76.0)[1].

After adding the necessary attribute, the code was crashing, because now
a valid icon was returned, however the icon should not be freed[2],
which is why I removed the "g_object_unref(icon)".

Now it was no longer crashing, but the size of the icons was off. It was
passing GTK_ICON_SIZE_BUTTON (4) to gtk_icon_theme_lookup_by_gicon where
a size in pixels was expected. I chose 16 because that's the pixel size
associated with GTK_ICON_SIZE_BUTTON[3].

Finally I noticed the returned icons had the wrong color. It seems that
a GdkPixbuf uses RGBA8888 format[4]. Adding an explicit conversion to
ARGB32 made the icons look correct for me.

[1] ed8e86a7d4
[2] https://docs.gtk.org/gio/method.FileInfo.get_icon.html
[3] https://docs.gtk.org/gtk3/enum.IconSize.html#button
[4] https://docs.gtk.org/gdk-pixbuf/class.Pixbuf.html#image-data

[ChangeLog][Platform Specific Changes][Linux] Fixed file icons provided by QFileIconProvider when using the gtk3 platform theme.

Pick-to: 6.6 6.5
Change-Id: I312ef76ac28bc28435b756d299998485db122906
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 277d77029d7fe8f46c6ee101869dcff389426cb1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-16 14:45:03 +00:00
Christian Ehrlicher
c63ecb05ce QDockWidget: fix dock buttons size
The previous fix calculated an icon size of 12 instead 10 for the icon
size when SH_DockWidget_ButtonsHaveFrame is set. This lead to a too
large icon. It was also rendered blurry because there was no native png
with 12x12 pixels so it has to be scaled.

This amends 04f4b27774ba70ebba425394fa8a1ffdffb2483b

Fixes: QTBUG-122214
Task-number: QTBUG-118643
Change-Id: Iaf332a21681e5b84222299d79d4b28d0c26b0cda
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 8eb599566ea983869298fe1f3362918bf0651f11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-16 14:45:03 +00:00
Tinja Paavoseppä
3d01456b10 Android: Request QtEditText focus when its window is touched
This allows switching focus between different Qt windows,
which combined with the previous changes enables keyboard
focus for child windows.

Task-number: QTBUG-118139
Change-Id: I4b237166dee264a22b2e3dd1ca4d82e0cfce376b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit e703feea40108cdd11f8f0270cc82c2aa0e691cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-16 16:45:03 +02:00
Petri Virkkunen
17e546ac7f Android: QtActivityDelegateBase listens to focus events from child views
In order to detect gaining/losing and moving focus between windows,
implement GlobalFocusChangeListener for the root View.

Add a surfaceFocusChanged native function in QAndroidPlatformWindow in
order to follow these focus changes.

Task-number: QTBUG-118139
Change-Id: Ia9bf6249c28a420f42793a9829aef31b12757630
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 2c192c6f5fe08b014bfa90ea0452258e649d3183)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-16 16:45:02 +02:00
Tinja Paavoseppä
1712c4eeca Android: Move QtEditText to QtWindow
Every QtWindow has its own QtEditText. QtInputDelegate
uses QtEditText from the QtWindow which has the focus.

QtEditText is a View class which handles the creation
of the input connection, and encapsulates other various
keyboard input related functionalities. Previously
we have only had one, which requests focus when the
software keyboard is opened. However, with the
introduction of child windows, it does not make
sense for all the windows to operate through this
one instance.
Furthermore, since it always needs to have focus
to be able to open the software keyboard, this
leads to a bit surprising behavior in the focus
chain if we want to make each window focusable,
not just the top level one. Having each window
have its own QtEditText makes sure when a window
gets focus, the focus doesn't leave outside
of the matching view's own scope, making it easier
to handle.

This should also make it easier to clean up keyboard
input related events tied to a window when that window
is removed.

Task-number: QTBUG-118139
Change-Id: Idd1a9407bc0c48660f2885d3bda28e46d42c08a0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit f4050cc5ea7490ba3b8b2bb0a174559d7e72a27e)
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-02-16 16:45:02 +02:00
Lucie Gérard
02ab923adf Change wasm files license
The other files in this directory are non-LGPL

Task-number: QTBUG-121787
Change-Id: I9c319f723dafd7205029d7632c456412d1a3010b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 76a7057bf544e3b35a3b1d6e3cb3fc7be3c2036c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-16 11:30:13 +00:00
Mårten Nordheim
d059d5c3cb QLocal8Bit::convertFromUnicode[win]: limit fprintf to !NDEBUG
Because there is no other way to stop it from printing the output.

Pick-to: 6.6 6.5
Change-Id: Ie6dcb393351f50691366849ba85d60e2e186f9fb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1dd89bfb04515bd2e431f8915256a417d622288f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-16 02:31:28 +00:00
Lucie Gérard
fc7157bbee Correct license in widget/kernel
According to QUIP-18 [1], all module files should be
LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
or
LicenseRef-Qt-Commercial OR GPL-3.0-only
LGPD and non-LGPL licenses should not be mixed in a
given directory.
The files in this patch now match the other files
in the same directory and QUIP-18 rule.

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: Ied60c775fbae38d6edeabc669f782b39d02c28f4
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 039d51835f4c2a3956e929f7ef7f525dccbd7fd5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-16 02:12:28 +00:00
Andreas Eliasson
cd664a7f39 Doc: Fix readString() and readByteArray() code snippets
Both of these functions return a StringResult, which has no
StringResult::code member. Instead, use the existing
StringResult::status member.

Fixes: QTBUG-122254
Pick-to: 6.6 6.5 6.2
Change-Id: I0b9bfa1fc9a30e9c542ab90f3d8f4243bdeda762
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 57388179a41a169d4f6d65a385f605af31722bf2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-16 02:12:28 +00:00
Ahmad Samir
6816da00a9 QTimer: use QTest::ingoreMessage() for negative internvals tests
Pick-to: 6.6 6.5
Change-Id: I87d095b748a7488a71b22710ab7ed72d9451c769
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 026e1e3fdb8ab2116f7fae28455c7141c926bb88)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-16 02:12:27 +00:00
Tor Arne Vestbø
1c8cb94e4a iOS: Propagate focus changes to VoiceOver
Changing the focus object should update the VoiceOver focused element,
the same way we do it on macOS.

There's no NSAccessibilityFocusedUIElementChangedNotification on iOS,
but we can pass the focused element as an argument when posting the
UIAccessibilityLayoutChangedNotification.

The class method on QMacAccessibilityElement to get an element for
an QAccessible::Id was not used by any callers, and has been modified
to resolve the container from the QAccessibleInterface, so that we
don't need to plumb that all the way from the focus change event.

Inspired-by: Jan Möller <jan.moeller@governikus.de>
Fixes: QTBUG-114608
Pick-to: 6.6 6.5
Change-Id: I2e43ae649bc7e3a44c1e1200e8de66bf420b1949
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7a512d1267442e646bb7942291197b2b03f4d1cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-16 02:12:27 +00:00
Shawn Rutledge
82cc779ee6 tst_QTextMarkdownWriter: test both ways of setting font characteristics
We have explicit QFont properties, and QTextFormat::setProperty().
Setting FontFixedPitch doesn't necessarily affect the view (QTextEdit or
Qt Quick Text/TextEdit); and setting the font to the one we get from
QFontDatabase::systemFont(QFontDatabase::FixedFont) is also unreliable,
because the "monospace" fallback might actually be proportional.
QTextMarkdownWriter checks for both to decide whether to use backticks;
so markdown writing works if an editor UI makes the format monospace
both ways to be safe. But in the opposite case that the main font is
actually a monospace font, it's always been broken.

The rest of the QTextCharFormat properties are generally working, to
the extent that they are applicable to Markdown. But we lacked explicit
test coverage: so far we were just reading Markdown or HTML and writing
Markdown to test the writer.

Also amend an old comment about writing underlines: writing was always
possible, and since f5c7799f59ba53c634906b11e2135190093bf87b reading is
supported too. So the underline support is symmetric (except that we
don't heed the QTextDocument::MarkdownFeatures argument to the writer
ctor: we probably should do that some day).

Task-number: QTBUG-54623
Task-number: QTBUG-75648
Task-number: QTBUG-75649
Task-number: QTBUG-79900
Task-number: QTBUG-99676
Task-number: QTBUG-103484
Change-Id: Iacb4ed0ea59030570702d4eadfdadfad872065c6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit bf8167c5fc513861ba9ecadf491db256de65eafd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 19:47:27 +00:00
Eirik Aavitsland
7fb362ab59 Baseline tests: avoid rendering items that are blacklisted on the server
Blacklisting items on the baseline server would avoid any mismatch
failures for such items. However, they would still be rendered. That
is undesirable if the rendering itself has unwanted side effects for
such items, e.g. crashing the test executable.

Fix by adding new functionality in the baseline testing framework to
allow checking blacklisting status ahead of time, and add a new macro
QBASELINE_SKIP_IF_BLACKLISTED to do just that.

Add usage of that macro to the QPainter baseline test.

Pick-to: 6.5 6.2
Change-Id: I35f6df8cff2c6cb985c25ab5470cd42b53d44940
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 4449dbe73704e328c4645f1e9ae7455622b8968f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 19:47:27 +00:00
Rami Potinkara
4b5e899114 Android: QtEditText support for full-screen soft keyboard
Full-screen soft keyboard support added. Including functionality
for copy-cut-paste and line change.

Future TODO QTBUG-121522

Task-number: QTBUG-109367
Pick-to: 6.6 6.5 6.2
Change-Id: Ia5632cacc910c7ebde0e40608c2abd027b8f953a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1f6d7cbb341bd79826d3f6d69e1f1a427ebb8f1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 19:47:26 +00:00
Marc Mutz
0fe424a9ae Add fast-path in QLibraryStore::findOrCreate() for !instance()
If there's no QLibraryStore::instance(), then there's no LibraryMap,
so no need to construct a mapName we know we'll just throw away.

We must keep locking the qt_library_mutex to check instance(), but we
can drop it immediately if we find there isn't, and construct the
QLibraryPrivate object outside the critical section (the hope is that
the compiler sees this as an opportunity to tail-call).

The final goal of this exercise is to get rid of the double-lookup in
LibraryMap.

Pick-to: 6.6 6.5
Change-Id: I181dd2657e831a37e2d6f1c5d4df7e2a25ac48cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c9b967437df344b5fc95121a3560a34bf352c696)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 19:47:26 +00:00
Edward Welbourne
219fbe7b21 Implement QTZP::isTimeZoneIdAvailable() on Android
The QTZP base implementation of the availability check was to
construct the list of all available IDs, then see whether the given ID
appears in it. This can be very inefficient. The ICU backend has
recently grown a more efficient solution than that, matching the TZ
and Darwin backends. For Android this was still very inefficient, but
its instantiation is cheaper, so simply instantiate and see if the
result is valid. For MS, the backend caches the list of available
zones, so searching the list is a reasonable solution, given the
complexity of its constructor.

Add an implementation for Android and document, in the base-class,
that the fall-back is only suitable for use if the list is cached.

Pick-to: 6.6 6.5
Change-Id: I9dc2ba4be1492ec811c8db6cff9490ac0303115d
Reviewed-by: Volker Krause <vkrause@kde.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 7c502391cf73e3fa5bc02ea0b46261f0b5be0b84)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 19:47:26 +00:00
Laszlo Agocs
be149bfd82 vulkan: Make setEnabledFeatures2Modifier an overload
Change-Id: I74087324e4ea54af0165f3e30b73b2df61104a41
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 38de2c9532d1ae2fa57ad25b088a88dc6eb27769)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 19:47:25 +00:00
André Klitzing
eac0a67e82 Fix documentation of used digest and signature algorithm
SHA-256 is used since 2019.
This amends c9f8893000249bd5701674c53d18a823b4a1c629.

Pick-to: 6.6 6.5
Change-Id: I005aa3414e4606045c8c3b01d71547efcf4122ba
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ad8047daf1eee0263a3749974ed2f33faae6609f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 19:47:25 +00:00
Alexandru Croitor
b404d8e361 CMake: Fix AUTORCC_OPTIONS INTERFACE_LIBRARY error with CMake 3.16
Make sure not to set the AUTORCC_OPTIONS property on INTERFACE_LIBRARY
targets, because it's not allowed with CMake versions lower than 3.18.

Amends 329dbfcc78d067d26b5a4dd99f4284900fd68f2c

Pick-to: 6.6 6.5
Fixes: QTBUG-122266
Task-number: QTBUG-106466
Task-number: QTBUG-101353
Task-number: QTBUG-121948
Change-Id: I9ab606c0b11e2b4f8689e0bde9c001f59c81fa42
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit b3cc89e81c149533e279df2442a79cc1dfce9ec5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 19:47:25 +00:00
Tor Arne Vestbø
2832ad2f9d macOS: Expand and tighten plumbing of QWindow's requested color space
A QWindow can have a requested target color space via its QSurfaceFormat.
This allows users who know what color space their source material is in,
or who do their own color matching, to ensure a consistent target color
space.

In the past we plumbed this to NSWindow's colorSpace property. This meant
that you could only have one color space per top level, even if child
windows were in play, and we could only set the color space if we were
the ones creating the NSWindow, failing the color space request in cases
where the window was embedded in a non-Qt window hierarchy.

We now store the requested color space in our QNSView, and propagate it
to both the IOSurfaces we use in QCALayerBackingStore, and to the view's
layer, in case it's a CAMetalLayer. We also pick up any changes to the
backing properties of the view, and ensure we update the color space
accordingly.

We still propagate the color space to NSWindow, as for OpenGL we don't
use CAOpenGLLayer (which has a colorSpace property), but instead use
NSOpenGLContext. This is not something we're going to change, so as
a workaround we set the NSWindow color space, which does affect GL
drawing via NSOpenGLContext. The granular color spaces we set on
the IOSurfaces and CAMetalLayer will override the NSWindow state.

Change-Id: I5d9765d95140b8523ee09f70ff09a8c9400ffdc7
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
(cherry picked from commit ef378898454964ce4d66d2656d2d5e4c7ac69b22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 15:27:30 +00:00
Mårten Nordheim
268cc19dc6 tst_QNetworkReply: Try to stabilize qtbug68821proxyError
The test is a bit silly, it was originally written to make sure that
we produce meaningful errors when trying to connect to a proxy server
where the connection is refused or the server doesn't respond at all.

To test that, it creates a local QTcpServer and starts listening to any
free port (by specifying port 0) and then it closed the server and
uses the address-port of localhost:serverPort as the proxy to use, since
we know it _was_ unused, since we were able to bind to it.

However, just calling close() doesn't immediately tear down the internal
socket descriptor, so the OS may still have the port reserved for
some time.

By moving the QTcpServer to a narrower scope we will quickly destroy it
and the internal socket engine, which is parented to the server, and
this in turn releases the socket descriptor.

Pick-to: 6.6 6.5
Change-Id: If12128fc21d1f545df152f08f0d52c1b14ac6037
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 775a57f26682867e183d26863d85eb22a563cdbd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 15:27:29 +00:00
Eskil Abrahamsen Blomfeldt
90963387e4 Fix kerning errors when using DirectWrite backend
There were a couple of errors when calculating advances
in the DirectWrite font engine: First of all, we would
apply the CLEARTYPE_NATURAL glyph metrics when using
GDI_CLASSIC rendering, causing text to look compressed
in some places, because we always passed TRUE for the
useGdiNatural parameter to GetGdiCompatibleGlyphMetrics().

In addition, we would pick the GDI-compatible metrics even
when design metrics had explicitly been requested on the
layout. This is the case for distance field rendered text,
which always operates with design metrics and scalable
layouts, so it was visible as kerning errors on some text
there.

Pick-to: 6.6 6.5
Fixes: QTBUG-122139
Fixes: QTBUG-122167
Change-Id: Ic28da6b3235d7af0452bdcb836e037594f8a20ba
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
(cherry picked from commit de3d5dd73b748bc1591447fe81dff6427a86f77b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 13:51:47 +00:00
Marc Mutz
aea4e9788a QVarLengthArray: give the default Prealloc a name
... and use that in QVarLengthFlatMap's definition in lieu of a magic
constant.

Amends d4611ba3a5b46ee790e6c790ef6c3d771d3507ee.

Pick-to: 6.6 6.5 6.2
Change-Id: I369f31b643789075ef6c14669b8b794ed0b3bbb1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit c30195a95e751552a39f99dd5833ebf722d11bc1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 13:24:48 +00:00
Alexey Edelev
c3aa052942 Add configure mappings for QT_BUILD_<TESTS|EXAMPLES>_PROJECT
Change-Id: I1e9f877c4c9b6257f4f90e3361d5a0226e62e841
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7c9efdf40c9d9f7f89f7a9be0c06e0d3ec54ec2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 07:32:38 +00:00
Volker Hilsheimer
72cc294156 AppleIconEngine: fix aspect ratio adjustment
The requested icon might not be square, so fit the image
we have correctly into the requested size.

Fixes: QTBUG-121764
Change-Id: I877dedf5aa779cd82a75a1a49b26c08e3cea6163
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 5b993fa8ede67871a8b2434505bc3c3d8bb906c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 07:19:24 +00:00
Volker Hilsheimer
04ecd7d090 Iconbrowser: render theme icons as list with large icons
In icon mode, the name of the icon gets truncated.

Change-Id: I8e2081a68006907ae916c8e8fa1aeb6006acbc6d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 477381993a3899c73e240e0fb2dc2b9f67f8cb63)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 07:19:14 +00:00
Paul Wicking
ea0814fb7f Doc: Resolve qdoc link warnings
- Drop link to non-existing documentation.
- Reorder links such that the target becomes the text and vice versa.
- Use correct link target names.
- Add missing qttestlib doc project dependency to qtwidgets.

Change-Id: Iaa0ea7b22326c82271b14b17c4b78c3a25a834f1
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit f157422c58475b3b818b0dddc31289e7105967c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-15 07:15:20 +00:00
Tor Arne Vestbø
7cb459ea7e QRhiWidget: Register cleanup callback also on first RHI init
The first time ensureRhi() is called we don't have an RHI yet, and will
adopt the top level's repaint manager's RHI. We need to register a
cleanup callback for this RHI, so that if it goes away, we will
reset our RHI pointer to null, just like when we switch from one top
level to another (and get a new potential RHI).

Without the reset, we would be working with a stale QRhi pointer,
which we in most cases updated via a call to ensureRhi(), that
picked up the new QRhi, but for good measure we should reset it
if we can.

Change-Id: Iac6d8787b636675bbcb4358e8f0baad26187b0e2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 986f8b361ce9d6163f6ef691cad7b2955dcfe5cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 19:02:31 +00:00
Tor Arne Vestbø
2d41c622b2 QRhiWidget: Tear down resources before window has changed
We were handling QEvent::WindowChangeInternal, but based on what the
code is doing, what the comments say, and what QQuickWidget does,
the right event should be WindowAboutToChangeInternal.

This fixes a crash when reparenting a QRhiWidget into another widget,
where we could call removeCleanupCallback() on an RHI that was already
gone.

The fact that we have a stale RHI pointer at WindowChangeInternal time
is still problematic, and caused by our call to addCleanupCallback not
happening as it should for the first call to ensureRhi(), but this will
be fixed in a follow up.

Change-Id: I054120e97a24a1f74af44b2d251470792f03f7f3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 6fbbbef260cf71fee05d9e816c069964c6f0b92c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 19:02:31 +00:00
Joerg Bornemann
498f5791f6 CMake: Fix custom QT_DEPLOY_TRANSLATIONS_DIR on Windows
Pick-to: 6.6 6.5
Fixes: QTBUG-121880
Change-Id: I7747253ae2671b2d417b25f0a98bc13871a661e2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit dd970940baccc08c458bd0e2eea13a54bd2d4d30)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 19:02:31 +00:00
Joerg Bornemann
f224891038 CMake: Fix custom QT_DEPLOY_QML_DIR on Windows
The value of QT_DEPLOY_QML_DIR was never passed to windeployqt.

Pick-to: 6.6 6.5
Fixes: QTBUG-121881
Change-Id: I993793f74d84ccb0e7c2deb72b1e33e81692ecbb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 527b9da5388a3cccb81706becbd8e40977d5db11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 19:02:31 +00:00
Mårten Nordheim
b04fe2de61 QLocal8Bit::convertFromUnicode[win]: support more than 2Gi input
As we did for convertToUnicode. To support more than 2Gi input, we
need to handle the input in chunks because of the `int` parameter in the
Windows API. Testing also revealed some corner cases we also need to
handle, which is mostly happening when there is an incomplete surrogate
pair at the end of the current input window.

The test takes between 3 (plain MinGW) and 8 (MSVC with ASAN) seconds
to run on my machine.

Pick-to: 6.6 6.5
Fixes: QTBUG-105105
Change-Id: I4fb0420b88ca41dfa8b561a35c6d96659bd81468
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 496340f33ad48738d1595c5c4048e4a05819786c)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-02-14 20:02:31 +01:00
Mårten Nordheim
5e882b5de9 QLocal8Bit::convertFromUnicode[win]: Pre 2Gi changes
As we did for convertToUnicode, we do some smaller changes, like
increasing indentation, and switching to using pointers and calculating
the input-size in this commit, so that the real changes in the next
commit are (hopefully) easier to read.

Pick-to: 6.6 6.5
Task-number: QTBUG-105105
Change-Id: I3bf1a487f63a3e24efd7a945152647dd8fc0aca8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit cba0efc2705af1ef027603f7ee4cb60f184412d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 20:02:31 +01:00
Mårten Nordheim
22f2fcd354 QLocal8Bit::convertToUnicode[win]: support more than 2Gi input
To properly support more than 2Gi input we have to support being asked
to resize more than once. Previously we would only have to resize the
one time because we went from our 4K stack buffer to the final size
heap buffer. But now, since our input size can only be specified in
int, we have to deal with looping over the input and resizing the buffer
as needed.

We also have to deal with trailing data at the end of our sliding window
potentially causing issues for the encoding. So we try to shrink our
window when it causes issues, or store the trailing data for the next
call.

The >2Gi test takes about 6-8 seconds on my machine.

Pick-to: 6.6 6.5
Task-number: QTBUG-105105
Change-Id: I9a44b8f379bf2c2c58183f961544ed2f4c8c7215
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit a7171c62569ac2005560131a17515bb6841e9b98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 20:02:30 +01:00
Mårten Nordheim
0c944d361a QLocal8Bit::convertToUnicode[win]: split out buffer growing
We will need to potentially grow the buffer before appending anything
to it, because if we pass in 0 as a size then the MultiByteToWideChar
just returns the size we would need. If we didn't intend to do so then
we would increment our output buffers even though nothing is written.

And when appending single characters (like the replacement character
for an invalid sequence) we need to grow the buffer as well.

We'll need this all in the next commit.

Pick-to: 6.6 6.5
Task-number: QTBUG-105105
Change-Id: I94b9a0f7d18a725da01a47398163e6d0f704eefc
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 1090d5dd4ae5be898d4566314eda43b0283709d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 20:02:30 +01:00
Shawn Rutledge
a7367e6a3c QTextMarkdownWriter: Don't word-wrap headings
If it wraps, the text on the next line is no longer part of the heading.

Fixes: QTBUG-106526
Change-Id: I8015c948d875c6944422ef3439e3128af5b2a2e2
Pick-to: 6.6 6.5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 65c40290b488395ee7c1fdfabc4d274889d9afab)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-02-14 12:02:27 -07:00
Shawn Rutledge
183ee5c177 QTextMarkdownWriter: Avoid omitting or misplacing ending indicators
If we need to word-wrap a paragraph after a long formatted span,
write any ending markers before the newline (amends
280d679c556ab8ead4748a627d7cd4c1950027fb ).

Break before a fragment if the whole thing is past the column limit;
in that case, write out any ending format markers before the newline.

And now we have test coverage: prepend characters one-at-a-time to a
line that already has a two-word formatted span at the end, and watch
it successively break after the span, in the middle, and then before,
while never putting a newline before the ending markers or failing to
write them.

Fixes: QTBUG-116927
Change-Id: I140e10d19a491cb599bf7ecf8514af866b5383f3
Pick-to: 6.6 6.5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 908fc2e72b34073dc42ce0f2d6f7cc5adc9651d9)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-02-14 12:02:27 -07:00
Ivan Solovev
09236abe2d QVulkanWindow::setEnabledFeatures2Modifier(): pass parameter by value
The method takes an std::function as a parameter, so it makes sense to
pass it by value to avoid copying when passing lambdas.

Amends bd78047df34fda3a56b8db069fc97280831ac696

Found in 6.7 API review

Change-Id: Ic0608a176bfd26b5b44fae48f29d84737e81a413
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit c5d0345c3d6177105c2a6cbb2f99ab6c64d333a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 19:02:26 +00:00
Ivan Solovev
40e56294f1 QTimer: do not set active state when setting a negative interval
QObject::startTimer() returns 0 in case of failure, for example when
someone tries to register a timer with a negative interval.

However, QTimer internally uses -1 as an invalid timer id.
This could lead to a situation when the timer was not really started,
but QTimer::isActive() returned true.

This patch fixes it in two ways:
- check the return value of QObject::startTimer() and treat 0 as an
  error.
- do not treat 0 as a valid timer id when calculating the active state.

As a drive-by: move the `using namespace std::chrono_literals;`
declaration to the top of tst_qtimer.cpp, so that we do not need to
repeat it in each test case.

Fixes: QTBUG-122087
Pick-to: 6.6 6.5
Change-Id: I0e21152b2173ebb5fb0dada1b99a903a321ca9c4
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 612b67cf13cedb832e082308b620f948377ddf21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 19:02:26 +00:00
Philip Schuchardt
86cdd53a6d Synchronize read buffers on non-Apple Silicon in RHI
Read buffers are not automatically synchronized when the
buffer uses MTLResourceStorageModeManaged. This commit adds
GPU to CPU synchronization for managed buffers, ensuring
proper data transfer for reading operations on non-Apple
Silicon devices.

Fixes: QTBUG-119447
Pick-to: 6.6
Change-Id: I6398f4f27d00950c7dceae918b04e0054d4b5647
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit f21af7f88b2184a420293967d07bf6552541ddc9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 19:02:26 +00:00
Lucie Gérard
233f1de47f Change license in test file
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I701e707447ca68977bdd80662200eb0c36545dbe
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit ee8822168ce15764693cb4600f445e0605ce0e9a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 14:23:15 +00:00
Alexey Edelev
f6c2e909c9 Change the mechanism that copies framework header files
Split the header copy custom commands into two blocks and add
<module>_sync_headers_fw_copy target that is responsible for the copy
of CaMeL-case header aliases. For the Ninja generator we leave the
file-level dependencies between the <module>_sync_headers_fw_copy
target and header copy commands. For the Unix Makefiles generator we
put the command directly to the target to make sure it's executed by
make.

Also add the explicit commands for creating the output header
directories.

Fixes: QTBUG-122200
Pick-to: 6.6 6.5
Change-Id: I71ba716d17a879f20ae0869cf2257d246ac17eff
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 103eca1070a75bfa97d0b72b94e0c759ef0bcd1c)
2024-02-14 15:00:04 +01:00
Artem Dyomin
178fe26cb3 Improve description of QRhiTextureSubresourceUploadDescription::setImage
The format of QImage is not considered upon texture loading,
it should be documented.

Pick-to: 6.6 6.5
Change-Id: I795c8a82a71ecdba5407f7e4ce940f7d538ff924
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
(cherry picked from commit f2957e463362b307c1cc736365c4640c9befbdd0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 13:41:54 +00:00
Alexey Edelev
36086ba3ca Use the unique resource identifier in editabletreemodel example
Fixes: QTBUG-122210
Pick-to: 6.6
Change-Id: I86200961384de6fd57f5c140120461faada4fb4d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3f312908804ff8871d60b9227e057362d02b34ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 07:43:00 +00:00
Tor Arne Vestbø
fceb53e4c8 Add QPlatformIntegration::BackingStoreStaticContents capability
This was a feature in Qt 4, but the only platform that carried it over
to Qt 5 was Windows, in ab76593f18396e693f24066592244ca95e135ea2, and
that's still the situation.

As a first step in possibly implementing this on more platforms, lets
replace the hard-coded check in QWidgetRepaintManager::hasStaticContents
with a proper QPlatformIntegration capability check in the only call site.

Change-Id: I2067109f45116cd8c62facf7224cd748f19e845b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit cce303b6a70bfc5e7f191529724969ca7509039f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 07:43:00 +00:00
Tor Arne Vestbø
6ff8306403 tst_QWidgetRepaintManager::staticContents: Trigger resize via QWindow
QWidgetPrivate::setGeometry_sys wrongly triggers full update, which is
why the test was QEXPECT_FAIL, even on Windows, which does implement
static contents.

We can test the behavior without involving the broken QWidget behavior
by resizing the QWindow instead, which triggers a resize of the platform
window and will be fed back through QWSI, similar to when the user
resizes the window via the window frame.

The QEXPECT_FAIL message for the QWidget resize has been updated to
reflect why it's expected to fail.

tst_QWidget::optimizedResize_topLevel() has similar issues to this
test, and solves it by using Window specific platform code. For now
this test has been left alone, as there are a lot more going on in
that test in terms of workarounds and blacklistings, so it needs
further investigations.

Change-Id: I28a55c0723b3e7f16b362d1ebc369e038d5a7ac4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ea0cf4a9a2535110d6cf325e75537b4618a7374f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 07:43:00 +00:00
Tor Arne Vestbø
cb1f28aef3 macOS: Implement support for backing store static contents
We already had the machinery to copy one buffer to another, so this
machinery has been generalized a bit, so we can use it to preserve
the static content during buffer resize.

As explained in the comments, we need to do the buffer copies during
buffer creation, instead of relying on our back buffer finalization,
as we are not guaranteed that we can always copy the static content
from the front buffer.

Change-Id: Ia9b3ac6ec982949990d172b0b14f35b13bbae92a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit cd29145ddcf099acf0651aca637fc2ce65ba7546)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 07:43:00 +00:00
Lucie Gérard
a47bea2296 Correct license in qmake/
The majority of files in qmake/ have non-LGPL licensing.
Remove the mix of licenses and follow the majority.
Not sure what is the type of the files in qmake/
according to QUIP-18 [1].

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I4003daada9e20b9ea4524de89ba49fbe0880ec23
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 3828b30951e3bdaa8227d0ade14725de04593671)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 07:43:00 +00:00
Tor Arne Vestbø
4a39d2039f QBackingStore: Take DPR into account when resizing with static contents
The plumbing from QBackingStore::resize to the platform backing store
was missing a high-DPI conversion for the backing store's static
contents, which is also expressed in the QtGui coordinate system.

Pick-to: 6.6 6.5 6.2
Change-Id: Ifaac916cbf184b9386aa5feca1577a53bf2906ed
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 515822de24e45e9c6d8d59b74c557640ba68a6ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 07:43:00 +00:00
Mårten Nordheim
9d7eb4bf8b Modern windows style: fix implicit conversion error
"implicit conversion from 'double' to 'int' changes value"

Amends a1f12273b2e355033ab2a9478d1e9702210a0733

Change-Id: I7b26073403c8a589b5ec1d6b32e06b4bb6283946
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 26bdda0032692ab2e73f00272fb9d36518c271f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 07:42:59 +00:00
Shawn Rutledge
3b4901d2d4 QTextMarkdownWriter: Handle lists in blockquotes correctly
But we do not yet handle a blockquote in a list item. Presumably
that's less common anyway.

We now also continue block-quote prefixes onto blank lines
within a block quote, which looks more normal.

Task-number: QTBUG-104997
Change-Id: I2b5642cf3a0c81a94444a33f026a02ad53e7e6bb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f3e528b97f6836b497953935e1dd27fee134e68a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 04:34:49 +00:00
Allan Sandfeld Jensen
a1413a6ecd Fix build with gcc-14
Work-around SiC change made to qfloat16 when using native floats.

Pick-to: 6.6 6.5
Change-Id: I981505e6eff7277ad14512b56fad334be6e79016
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit dcb2186c2a3199d39af09bb81376437b55b907ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 01:23:00 +00:00
Tor Arne Vestbø
2332a9c67b QWidgetWindow: Don't meddle with WA_WState_{Hidden/ExplicitShowHide}
In ccd3bf0871b81dfc09bb469b161f32dfb47ee53e we introduced code that would
ensure that our call to QWidgetPrivate::setVisible() from QWidgetWindow
would not result in WA_WState_Hidden being set. This code was later
modified in 51300566ffe2ece2455e1d0479a556c5dbb3bb8e to apply to
widgets that were explicitly shown/hidden.

Unfortunately, the reset of the Hidden and ExplicitShowHide attributes
would in some cases result in the widget having only ExplicitShowHide
after being hidden, which is an invalid state.

It also resulted in the widget having both Visible, Hidden, and
ExplicitShowHide, if first being hidden via QWidget, and then
shown via QWindow, which in turn prevented the widget from being
hidden via QWidget::hide().

As we no longer rely on the adjustments to Hidden/ExplicitShowHide
to fix QTBUG-73021, we can remove the entire logic. Any setVisible
call to QWidgetWindow will either come from outside, in which case
we should respect that and set Visible/Hidden via QWidgetPrivate,
or the setVisible call is a result of QWidget itself (or its parent)
showing the QWidgetWindow, in which case the QWidget visible state
is already up to date and we skip the QWidgetPrivate::setVisible
call.

Task-number: QTBUG-121398
Task-number: QTBUG-73021
Fixes: QTBUG-120316
Change-Id: I3174ad66b7e10c55aa99b7cb433267632169ca8f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 1308f7e0b182769896e6c4c31105c100265beda9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 01:23:00 +00:00
Tor Arne Vestbø
0531e444a7 Ensure QWidget::destroy() events and attributes match hiding the widget
When destroying a widget via QWidget::destroy(), we clear WA_WState_Created,
and then delete the QWidgetWindow, which in turn hides the widget. But
QWidgetPrivate::setVisible(false) skips hide_helper() if the widget has
not been created, which leaves out important events such as the hide
event, and even more important, fails to clear WA_WState_Visible. As
a result, the widget is left visible (and mapped), even if it has been
destroyed.

This is normally not a big issue for the main use of destroy(), namely
destructing the widget, but for cases where destroy() and create() is
used to recreate the widget this is important.

We now unconditionally call hide_helper() if the widget is not already
hidden. As a result, the widget will correctly be visible=false after a
destroy(). This in turn means we need to re-apply the visible state after
recreating the widget when we detect a mismatch in RHI configuration.

Due to our meddling of the Hidden and ExplicitShowHide attributes in
QWidgetWindow private, a QWidet::show() will not have any effect after
being destroy(). This is okey for now, as destroy() is internal to
a widget, and we make sure to either update WA_WState_Visible and
WA_WState_Hidden (in QWidgetPrivate::setParent_sys), or use the
QWidgetPrivate::setVisible() code path directly, which doesn't
have that issue. The root problem will be fixed in a follow up.

Change-Id: I77cb88d75e57f0d9a31741161fb14d618a653291
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 371d7ea19a8075a1ad2c2011433b40e8eb1f6816)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 01:23:00 +00:00
Tor Arne Vestbø
fe434acac6 Restore window state of recreated top level widget, not closest QWindow
When we recreate a top level QWidget due to the RHI config not matching,
we need to re-apply the window state, as the state is lost on destroy().

But we should do this on the QWidget we are recreating, not on its
closest QWindow. These are usually the same, so it didn't matter in
practice for most cases (besides the more convoluted way of getting
to the QWidget's window).

But if the top level widget does not have a winId yet, the call to find
the closest QWindow via QWidgetPrivate::windowHandle() will traverse from
the top level widget to its transient parent widget, via nativeParentWidget,
which is strange and likely a bug.

As a result of that, we would store the window state of the transient
parent widget, and then, once we had created() the new top level, we
would apply the window state to the top level, which now had a winId.

We can simplify all of this by just storing and applying the window
state on the widget we are re-creating. There's no need to go via
the closest QWindow for this. We do however need to set the window
state on the widget's window, as going via QWidget will just bail
out since the window state hasn't changed.

Amends c88211d1e4ac12eb2ae4990703a4f73c7085d624

Fixes: QTBUG-119795
Pick-to: 6.6 6.5
Change-Id: I0ad6e7bbac5f29d095cc643e9a7094784e9a2122
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit aecedfed9ab763513af8fda5a2b208b263da3f65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-14 01:22:59 +00:00
André Klitzing
7b774f6ce2 Add USES_TERMINAL to add_custom_target and add_custom_command
This shows the output immediately to the console.

Change-Id: Ia7f40c10ea24e4c95d5d8fa95fd1bc2bd76d61ca
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d588924d11db24efe92a4ba3d77b3d768f460002)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-13 22:12:50 +00:00
Tor Arne Vestbø
97b7fea4c3 Disable NSUserDefaults initialization workaround on iOS
Core Foundation would fail to pick up defaults from command line
arguments, as the logic to read the command line arguments was
in the Foundation class NSUserDefaults.

As a workaround, we initialized NSUserDefaults as early as we could,
so that we could use Core Foundation elsewhere in Qt.

As NSUserDefaults is considered a potential privacy risk, and needs
explicit declaration of use for iOS in the privacy manifest, we
disable the workaround for iOS. This should be okey, as the original
issue does not seem to manifest on iOS 17, and was only a problem
in practice when using command line arguments to debug things.

The issue is also seemingly gone from macOS 14.3, but we keep
the workaround in for now, just in case.

Task-number: QTBUG-114319
Change-Id: I2c698353673f797756a877a49cfbd8a37367c31e
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 6657acf8f57529bfe601d18db5d594773f51fe91)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-13 20:53:57 +00:00
Tor Arne Vestbø
776b987638 CoreText: Get user's preferred languages via NSLocale instead of NSUserDefaults
The latter API is considered a potential privacy risk, and needs
explicit declaration of use for iOS in the privacy manifest, so
avoid it if we can, to simplify things.

Task-number: QTBUG-114319
Change-Id: Ica6fef47720696bc9ab25cb25642d6650f618b70
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit a3eba2378b4acfc46e5e6f8f511cdb0370c81d89)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-13 20:53:47 +00:00
Alexey Edelev
0d7784e09b Fix the namespaceless target condition in __qt_internal_walk_libs
Access the target name value, but not use the variable name in
when checking the target existence.

Pick-to: 6.6 6.5 6.2
Change-Id: I0f86e3c7665d9c028bf4cbdc5aa8fb840fe1d542
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 3d4a5c513ab050d04ab175610167f4d31982be5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-13 14:58:59 +00:00
Matthias Rauter
faaef169f5 Fix unsigned/signed mismatch warning in KTX file reading
On MSCV x86 (32bit) the comparison of qsizetype with
std::numeric_limits<quint32>::max() leads to a warning.
This patch adds a static cast to avoid the warning.

This is an ammendment to 28ecb523ce8490bff38b251b3df703c72e057519

Pick-to: 6.6 6.5 6.2
Change-Id: Ie50572165ac31aafa7d23570bc133c5c96cf8b00
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
(cherry picked from commit 6463b36da05bf57f2ff5857be6fa56e2c240fe12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-13 14:58:54 +00:00
Tor Arne Vestbø
f03c68fec1 tst_QWidgetRepaintManager::scrollWithOverlap(): Disable scroll bars
The scroll bars may show up in one of the grabs and not the other,
(as seen on macOS), which is interesting, and possibly a bug, but
is not what the test is checking for, so let's disable the scrollbars
to stabilize the test.

Change-Id: Iad97ca5b22783bb1bee51b560957c5461b7d9923
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit c6fc6cef33b2b343fd507ee1f6f6ec5d32b6df4e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-13 08:51:50 +00:00
Tor Arne Vestbø
35677d5739 Un-blacklist tst_QWidget::optimizedResizeMove on macOS
It has been passing consistently in dev, 6.7, 6.6, and 6.5 for the past
6 months: http://testresults.qt.io/grafana/goto/S35hM52IR

As a drive-by, fix comment that claims the test is only run on macOS.

Pick-to: 6.6 6.5
Change-Id: I6502c40e0c39afb68a461bd530df1bacb5211dec
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 4e9017c1fc6b80a24871481f0c33dcc88a69d9d6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-13 08:51:50 +00:00
Piotr Wierciński
a339175672 wasm: Disable problematic qlocal test for time being
Upgrading emscripten to 3.1.50 breaks this test, so we disable the time
for time being. After emscripten update this test is to be enabled
and fixed.

Change-Id: Ic48d81e2285ed8f7639bf20c6c29b2b9e402a591
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit c23d3ca1f08a7c7c76bb71602a56a79898efa117)
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2024-02-13 08:51:50 +00:00
Thiago Macieira
c4aa3b0dcb tst_QHashFunctions: make the consistency check table-driven
So we can test more values. Because we are testing more values, we can't
use QEXPECT_FAIL, because we can't guarantee a mismatch.

Task-number: QTBUG-116077
Task-number: QTBUG-116080
Change-Id: I664b9f014ffc48cbb49bfffd17b021719e6d612f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 1845d433277348542e496d3c38175ad0c5cbddde)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-13 01:01:43 +00:00
Christian Ehrlicher
be03e8523d QFusionStyle: Pass handling of FrameGroupBox to base style
The fusion style had an own handling for
PE_FrameGroupBox/SC_GroupBoxFrame but failed to handle all cases (e.g.
with checkbox, text and horizontal alignment) correct. In contrast, the
base class (QCommonStyle) is properly handling all those attributes and
returns a correct subControlRect(). Therefore remove the special
handling, let styleHint() return the correct value for
SH_GroupBox_TextLabelVerticalAlginment based on the groupBox's text
alignment and rely on QCommonStyle ability to calculate the correct
values.

Pick-to: 6.6
Fixes: QTBUG-85425
Fixes: QTBUG-95472
Change-Id: I98ccf861274026a8fd4a2ef436efc3bb009be056
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 5a032f0b3fcfb7dbd63e784dedaa8e27fc34ce3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-12 23:53:34 +00:00
Tinja Paavoseppä
9ce4f8ad82 Android: Change QtWindow Runnables to lambdas
Change-Id: I19a3e0a0a035a49965d7643db3ebdb72de95a3a9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 46c2d587b07ca99d36a28402924d7a7cf9c1b3e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-12 09:29:28 +00:00
Tinja Paavoseppä
c5a2da4351 Android: Make QtWindow package private
Change-Id: I0231193c3118619b4d2fc9f4e7f0f85ddd0b41b8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1f2570976e3b337a7f9eefea0c6937e943b7887a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-12 09:29:26 +00:00
Tinja Paavoseppä
64caa7c4b3 Android: Move bringChildToFront() call to Android UI thread
Cannot change view hierarchy outside of Android UI thread.

Task-number: QTBUG-116187
Change-Id: I05d36a28d16480519a6919047272be9f3cf667d0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3914a965ccc1b1f8a2b5828b480cd760cf923779)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-12 09:29:24 +00:00
Tinja Paavoseppä
93aa5ceeff Android: Remove unused QtLayout.TouchListener
Now that QtWindow extends QtLayout again, the touch listener interface
is unused as QtWindow can directly handle the touch events.

Change-Id: Ic58b5ab7644ffb3a60833b6507115b20db3f29de
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0ae95cb1f72782d5890f34c00b91eed15936ad29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-12 09:29:22 +00:00
Tinja Paavoseppä
ceae81f5d9 Revert "Android: Make QtWindow wrap the QtLayout instead of inherit it"
This reverts commit 2bc7d38bd63843c4598ed501e3adbf0e39162c61.
The real cause for the problems was the missing runAction() in
bringChildToFront(), creating the QtLayout could still be done
in Qt thread without problems, just as long as its hierarchy
is not changed outside of Android UI thread.

Let QtWindow extend QtLayout again - the missing runAction()
causing problems is added back in a follow up commit.

Task-number: QTBUG-116187
Change-Id: Ib4211c40adf573f9f6dd6300b275cff0ce718fba
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3dad99a43ed3ae936d5f47ff0cf4db78260e91d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-12 09:29:09 +00:00
Tim Blechmann
b725daa449 qmake: use [[fallthrough]]
Since qt is on C++17, it's possible too use the [[fallthrough]]
attribute instead of a // Fallthrough comment, that may be stripped by
compiler launchers (ccache/icecc), causing -Wimplicit-fallthrough
warnings.

Change-Id: Ic809cf4e95b2160fac591b3802fa123e705337cc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 84537e6dc22030004c2aec7285641e721da627cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-12 05:33:58 +00:00
Thiago Macieira
6a9be62270 qHash: force inlining of the hash16bytes() helper
It wasn't getting inlined in aeshash256_lt32_avx256() (used by VAES +
AVX512VL variant) due to a GCC __attribute__((target())) mismatch,
causing a major loss of performance compared to the VAES + AVX2 variant.

Comparing the throughput after this fix on an Intel Core i7-1165G7
(Tiger Lake) laptop, with qHashBits modified to statically select either
[A] aeshash256() or [B] aeshash256_avx256(), out of 5 runs:

            dictionary   numbers     paths-small  uuids      longstrings
A/B (avg)   103.7%       101.1%      103.5%       104.5%     100.3%
A/B (best)  103.4%       100.9%      103.2%       103.6%     100.8%

Considering that a string representation of a UUID is 37 characters (74
bytes), neither "uuids" nor "longstrings" are directly affected by this
change. However, the overhead does change, with the aeshash256_avx256()
needing slightly fewer instructions to reach aeshash256_ge32().

Benchmarking on an Intel Xeon Scalable 4th Generation (Sapphire Rapids),
the "uuids" data set has a 10% performance loss for some reason.

Pick-to: 6.6 6.5
Change-Id: I50e2158aeade4256ad1dfffd17b1b105d3cab482
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 6ab4623cad39bec935f76e366f3f262922bde94a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-11 10:44:44 +00:00
Oliver Dawes
7ad4db5ee9 Guard against nullptr cmdAllocators Release call
It is possible for a QRhiD3D12 instance to be created and destroyed
before the cmdAllocators list is initialized. This change simply
guards the cmdAllocators so that Release is only called if the
element is not nullptr.

For an example of how this can happen see QRhi::create. The
QRhiD3D12 is created but may be released immediately if
QRhiD3D12::create fails. One way this may happen is if the
ID3D12Device is removed but in practice many different errors may
cause create to fail.

Pick-to: 6.6
Change-Id: I395d247a952f9584122be083ac5ca6a3caddf300
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 63c8c1e862ee7dcd98dfd0d786e65e1b4fa05267)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-11 07:42:06 +00:00
Tim Blechmann
7c0ca6e3c9 serialization: cborparser - silence gcc warning
Change-Id: Ic28f85e7f6efbd65c79d67ce2fb3a367f36412fb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 381d6b5ac909b0f1a03f1f74b1e97b0a70abf43f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-11 07:41:32 +00:00
Tim Blechmann
5ef06fd8d1 qmake: make unity-buildable
msvc_objectmodel.cpp and qmakeparser.cpp have symbols that may clash.
Removing them from unity builds allows qmake to be unity-built.

Pick-to: 6.6 6.5
Change-Id: I46443ec979142ab2ebb686f9444b37e1043f0af1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 72f5793d2e6b8d749d7d6c9e3a6444f11e8b2cc0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-11 07:41:23 +00:00
Ahmad Samir
cddf6498d3 QFileInfo: clarify the docs with respect to "file" == file system entry
The word "file" could be slightly misleading in this context, because it
refers to an entry on the file system, which could be a regular file, a
dir, a special character device. Clarify the meaning by using "file
system entry" instead of just "file".

Fixes: QTBUG-120688
Pick-to: 6.6 6.5
Change-Id: Ic2a91cc74336a6718c13ad1ffd9f2c4001e5d63f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0211dfd92bcaa5a3a4c1ce94e13fcfd9c49e9c6d)
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-02-10 19:42:07 +00:00
Thiago Macieira
7b7dbc459d QtSql: #include mocs
Change-Id: I50e2158aeade4256ad1dfffd17b1f286a9001ae8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit f3832b63ded4fc0223f6da7c3e5878dbc4764308)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-10 10:39:25 +00:00
Thiago Macieira
a75d39a986 QDBusAdaptors/Doc: fix missing preposition "in" in documentation
Drive-by clarify a bit the text what "it" means, because it's different
from the "it" in "its" two words later.

Fixes: QTBUG-121875
Pick-to: 6.6
Change-Id: I664b9f014ffc48cbb49bfffd17b0959e7b3495fd
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 2c51a0bb7b71cba0d085281f7a588f750b06a8e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-10 10:39:23 +00:00
Marc Mutz
da0620727f QBitArray: defend resize() and fromBits() against negative sizes
Use the same technique the constructor already uses: Q_ASSERT followed
by selecting the no-op branch in case assertions are compiled out.

Change-Id: I24cbcfd686f67e060134baecfb21044948b6eb98
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a327117c0d851dac4eea860e7d86ef3f80a0ffce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-10 01:17:52 +00:00
Marc Mutz
03e184e48c QBitArray: simplify resize()
Use the new (in Qt 6.4) QByteArray::resize(n, ch) to avoid the manual
memset() unpleasentness.

Change-Id: I786988125f52b1bc1f733c30ab2b95eda569481d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit efc579145ef33655a4aaad5a41124cb103bfbe7a)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-02-10 02:17:52 +01:00
Marc Mutz
0a2104f50c QBitArray: simplify (size, value) ctor
Don't do the memset() manually just to save re-writing the single
leading byte. Pass the initial values to the QByteArray constructor
directly.

Change-Id: I67daf446bebb8c8c6b05d235746ee43604f42445
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0d6ca27517523e960b132bd5e51d9b48bb9a93a3)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-02-10 02:17:52 +01:00
Christian Ehrlicher
d55d8d9620 SQL/ODBC: remove unneeded qMakeFieldInfo(... QString *errMsg)
This function can be merged with the other overload of qMakeFieldInfo()
because no-one uses it except qMakeFieldInfo() itself.

Change-Id: I7ed07ac0c673801fed9c00c9b0ce1628cfea3837
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 686f953bdb05f3e68de8c847fb4054e6cd91cde8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-10 01:17:51 +00:00
Volker Hilsheimer
c374e51277 QTreeView: fix performance regression from accessibility updates
When expanding items in a tree view, the model as seen by accessibility
changes size and structure, and needs to be reset. This was done in
6a4afebc5ce8db69a6c9fb398cada31e6bad5e3c by emitting a ModelReset update
at the end of QTreeViewPrivate::layout when laying out the items had
changed the number of visible items.

However, QTreeViewPrivate::layout is called both recursively, and in a
loop when expanding all items, or expanding items to a certain depth,
resulting in a heavy performance hit when each recursion or iteration
causes the accessibility bridge to rebuild its representation from
scratch.

Instead, we now only store a flag that the model has to be reset in
QTreeViewPrivate::layout, and then trigger the reset in the function
that call layout, after the laying out is complete.

Fixes: QTBUG-122054
Pick-to: 6.6
Change-Id: Icb8384b56a4727c8c5050a1d501aebb55f48aafe
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a86321cb665b1af03b245b3b0fe0b57faa4a678f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-10 01:17:51 +00:00
Christian Ehrlicher
e068750afd SQL/ODBC: Remove code duplication - merge SQLFetch/SQLFetchScroll
... into an own function instead doing the check if fetchScroll is
available in every function.

Change-Id: I8c8a1c8693f667ddf89a660b733e31505427073a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 16c27a83f0c9c6f53578dd56024719a709cafcb0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-10 01:17:51 +00:00
Christian Ehrlicher
0c4dfd15b9 SQL/ODBC: avoid code duplication
... by moving the adjustment for the table/schema/catalog name into
splitTableQualifier().

Change-Id: Ia392b1c2e7f29e63ea88c21492f2116eac573b5e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 06039b523d2969e6683f9daf7d89dae727e7eaf4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-10 01:17:51 +00:00
Marc Mutz
5c97556d12 Add q20::erase_if(std::(multi)map, pred)
INTEGRITY has a pre-P1115 implementation of std::erase/erase_if that
returns void instead of the number of erased elements, so make q20's
implementation more specialized, so the compiler will pick it over
INTEGRITY's.

Same as 9b83574e8391e3e68a1c400f09b8354e268eeb32 did for std::vector.

Change-Id: I65149d7c92593126696f281151309b8f02ba4038
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 1a7edf3ba7bc8f7cdcd11eae973582158b4ecff8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 21:44:02 +00:00
Marc Mutz
0f840a4bdb QLoggingRegistry: disable copying
It's not copied, and copying would probably be a bad idea, so make
sure it's not done inadvertently.

Pick-to: 6.6 6.5
Change-Id: Ia7397906c0efb07ac5e079580bdbb15f4bf4911e
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 3a2d8c5828efee9f182c260f55720d3bb6152893)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 21:44:02 +00:00
Lucie Gérard
e869d921b8 Change license of .pro file
According to QUIP-18 [1], all build system files should be
BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Change-Id: Ifd2832708e0c8e0bde1cad4004839fecffe44e3c
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit d44629d677ed2aae6d32ab10cb69cfdffa385639)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 21:44:02 +00:00
Shawn Rutledge
dc314851e7 QtIcoHandler::canRead(): avoid checking more than once
QtIcoHandler::canRead() calls ICOReader::canRead(), which assumes that
QIODevice::pos() is at the position where the .ico data starts (i.e.
pos() == 0 if this is a separate .ico file). But if an AnimatedImage in
Qt Quick opens an .ico file, canRead() gets called multiple times:
the first is when QQuickAnimatedImage::frameCount() eventually results
in QImageReaderPrivate::initHandler(); then ICOReader::readHeader()
is called, which moves the file position. The second time is when
QQuickAnimatedImage calls QMovie::isValid(). At that time,
QIODevice::pos() == 6: we need to avoid calling ICOReader::canRead()
because it's no longer at the start of the data.

Without this change, AnimatedImage reports "Error Reading Animated Image
File" and doesn't show anything.

The fix is to store the known-good state, the same way that
QTiffHandler::canRead() returns true if its d->tiff already exists
(TIFFClientOpen() succeeded).

The test checks that it's ok to call QMovie::frameCount() first and then
QMovie::isValid(). Calling frameCount() has the effect of moving
QIODevice::pos().

Pick-to: 6.6 6.5
Task-number: QTBUG-117429
Change-Id: Ie3a5225f2cea9a0d76d685e83ce4d4a10cbe9188
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 3f515fa7aff7cb24565f0bb61b16bb2bde6faf60)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 21:44:02 +00:00
Volker Krause
8762c3bbde Optimize QTimeZone construction on Android
isTimeZoneIdAvailable() is significantly slower than just trying to
initialize the timezone and see if that worked.

Even in the x86 emulator the difference for this is from 2+ms to no
longer measurable here, on less powerful ARM devices it's even more
extreme. This matters in particular for code creating many QTimeZone
instances, e.g. for calendaring.

Pick-to: 6.6 6.5
Change-Id: I5f175137b8b71816347a8debb492214427a51104
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit f4e83fccb4ecbf01ba9b72b02a1041e93e7c92b3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 18:32:22 +00:00
Christian Ehrlicher
5010ab2275 QSqlQuery: remove unneeded friend tst_QSqlQuery
... as it is no longer needed.

Change-Id: Ia60b6e53675260ef0e793ac1b44c913af1454b35
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 74722411d3fbfcc30d8eff98efcc627be451aea9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 18:32:22 +00:00
Christian Ehrlicher
a1c6bb8030 SQL/OCI: fix QOCIDriver::formatValue()
The switch needs to be on QSqlField::metaType() instead the internal
QSqlField::typeID() which holds the db-specific type of this field.

This amends 7b391c0d2c03d8d25449eca3868cd010d75ff81e.

Pick-to: 6.6 6.5 6.2
Change-Id: Id1d1791826f08adb01cc3da45bf5a66bad288046
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 55d1480c9992b52c39906b3861a3e2e7f7bed898)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 18:32:21 +00:00
Alexey Edelev
979f6b4eb3 Remove the commented legacy code from Qt6CoreConfigExtras.cmake.in
Pick-to: 6.6 6.5
Change-Id: I44243ed239c21382569f0c4abf9a271da42b9a19
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 74dac559c060ee24242a625fc46a8c463d06055f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 18:32:21 +00:00
Oliver Dawes
c56553ae3d Initialize QRhiD3D12::activeAdapter for imported device path
This commit makes it so the QRhiD3D12::activeAdapter is set when
using an imported device. QD3D12MemoryAllocator::create would
crash before as it would attempt to call IDXGIAdapter1::GetDesc1
on the passed uninitalized pointer. With this change using an
imported device with the d3d12 rhi backend will no longer crash
the application.

Fixes: QTBUG-122007
Pick-to: 6.6
Change-Id: Iadc67fee0c7ee70ac904f66a523acd3b1a63e42b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 95c20ffac3473f9188df363aebcb911589645806)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 15:12:46 +00:00
Eirik Aavitsland
6ae9a8441e Refix invalid glTexImage2D operation in FramebufferObject
A recent change fixed the texture format parameter to be RGB instead
of RGBA for opaque internal formats. However, this broke the RGB10
case, since the pixel type is then GL_UNSIGNED_INT_2_10_10_10_REV. The
doc says:

"GL_INVALID_OPERATION is generated if type is [...]
GL_UNSIGNED_INT_2_10_10_10_REV [...] and format is neither GL_RGBA nor
GL_BGRA."
https://registry.khronos.org/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml

This modifies ba9e57d65f15c935632b0ad22db0bead9a7d5f90.

Pick-to: 6.6 6.5
Change-Id: I9a004331513179a3f840a007af0418d14e7f5dff
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit b0056f052d842150305d59a3ced280e1885a8619)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 14:26:33 +00:00
Tor Arne Vestbø
15c4509018 Apple: Make Qt::Key_Backspace primary sequence for StandardKey::Backspace
This will show up in menus as ⌫, instead of ^H, which is a better fit
with the native behavior.

Task-number: QTBUG-122042
Task-number: QDS-11733
Pick-to: 6.6 6.5
Change-Id: I224971421a13baec2a0f65be8ae4a5791dabafdd
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 41b76ffbd0993997f541436b1235407b00c542f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 14:26:31 +00:00
Jonas Karlsson
de5820c3f8 Improve KTX file reading memory safety
* Use qAddOverflow/qSubOverflow methods for catching additions and
  subtractions with overflow and handle these scenarios when reading the
  file.
* Add 'safeView' method that checks that the byte array view constructed
  is not out of bounds.
* Return error if number of levels is higher than what is reasonable.
* Return error if number of faces is incorrect.
* Add unit test with invalid KTX file previously causing a segmentation
  fault.

This fixes CVE-2024-25580.

Fixes: QTBUG-121918
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ie0824c32a5921de30cf07c1fc1b49a084e6d07b2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 28ecb523ce8490bff38b251b3df703c72e057519)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 13:46:48 +00:00
Marc Mutz
fbb2bd0a25 Add fast-path in QLibraryStore::findOrCreate() for empty fileName
The LibraryMap can never contain an object whose fileName is empty.

To see that, observe that the only insertion into LibraryMap is in
findOrCreate() and that refuses to add such objects there.

But if LibraryMap cannot contain such an object, and findOrCreate({})
is just an ugly way to get a default-constructed QLibraryPrivate (a
new one for each call), then we don't need to lock the
qt_library_mutex to produce one, and neither do we need to construct a
mapName that we know we'll not find, anyway.

So drag this case to before the mutex locking and the construction of
mapName.

It took me more coffee than I'm ready to admit to figure this out, so
leave a comment for the next reader indicating that an empty fileName
is actually a valid argument.

To avoid repeating the new-expression, wrap it in a lambda, together
with the ref() call. Move the remaining ref() call to where it's still
needed.

The final goal of this exercise is to get rid of the double-lookup in
LibraryMap.

Pick-to: 6.6 6.5
Change-Id: I781eafdb9516410d7a262ad27f52c38ad2742292
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b28bad0b20719f72fb335a65f76382132e326ad0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 13:46:47 +00:00
Lucie Gérard
c052ee9032 Change license for tests files
According to QUIP-18 [1], all tests file should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit ff1039c217fb1ae03b701557a5a50c2112555991)
2024-02-09 10:50:13 +01:00
Kevin Keating
737dbc8c78 WASM builds now handle bitmap and pixmap cursors
[ChangeLog][QtGui][Platform Specific Changes][wasm] Previously, bitmap
and pixmap cursors were nonfunctional in wasm builds and would trigger
warnings.  These cursors now work as expected.

Fixes: QTBUG-116796
Pick-to: 6.6 6.5
Change-Id: Idd9aa4d458a36452fd5b49f72cc595756fc50923
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 38c62c58514d574f44caf799e5568a2e9eebffeb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 09:32:20 +00:00
Artem Dyomin
07059d4d1d Fix loading QRhiTexture from image on gles
The code should consider that image may be created by
a pointer to user data, with original alignments.
It means that we the way of setting parameters from
raw data and QImage should be the same.

In Qt Multimedia we want to pass a zero-copy image
to rhi creation to get rid of an extra copy:
codereview.qt-project.org/c/qt/qtmultimedia/+/537062

Aslo, data align has been fixed.
Due to the documentation, GL_UNPACK_ALIGNMENT can
be 8, 4, 2, 1. Let's find the biggest possible align.

Task-number: QTBUG-121934
Pick-to: 6.6 6.5
Change-Id: Ic0f1617d4699217a7549c13e916be96108183d03
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 1d6bb23f6285252f7fa6cac87003cbe0f33f51af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 09:32:19 +00:00
Alexandru Croitor
f1cb2edd1e CMake: Add test for configuring a standalone test
A standalone test is one that uses
 find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
in its project code.

To ensure we don't accidentally regress this feature, test it as a
cmake test.
Also run test, this somewhat covers testing qt_internal_add_test.

Pick-to: 6.6 6.5
Change-Id: Ia9f27eef2bd7bd5bb57b96e553304924db252365
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit a61ac2ca58eb705021176720d481c0eb4c925c2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 09:27:42 +00:00
Marc Mutz
c4de095be1 QSpan: apply LWG 3346 work-around
We have not hit the GCC < 10.4 problem with containers that define
both element_type and value_type, yet, but we have with
QVersionNumber, so proactively apply it to QSpan, too.

While we're at it, copy the QList code to mark QSpan, too, as
contiguous.

Pick-to: 6.6
Change-Id: I883fd0b5f75db175a730262035ebbf0cb19de529
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 95feea933bbc67ab4a188470973da3f4df450c3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 07:20:02 +00:00
Marc Mutz
bfd565a4d3 QList: give the LWG 3346 #ifdef'ery a symbolic name
We'll need this in more places, so centralize its definition in
qcompilerdetection.h.

Amends 595b4e1a9b436a8190964dc41f79621400f5a6be.

Pick-to: 6.6 6.5
Change-Id: I87f84cb9ff3ad339c000604423295180176f5799
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit f4cfc21dec6319c2ae99042be6bb12922a9d336d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 07:19:49 +00:00
Tim Blechmann
bd17f3f370 cmake: build repo helpers - fine-grained test/example options
the tests/examples could only be enabled globally. when working on a
specific repo, it's beneficial to disable tests/examples for other
projects to reduce project sizes (and cmake configure/generate times)

Change-Id: I0026ba87b667d427043cc8eb1baa6c28b2046dd7
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 25b89f2c88cdfc98bfa462949531a33f7ef50996)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 07:17:11 +00:00
Christian Ehrlicher
8501df2c09 QAbstractItemView: close all child editors when parent is removed
QAIV::rowsAboutToBeRemoved() closed all child editors when the child was
a direct ancestor of the removed index but forgot to check if the index
is an indirect ancestor. Some of those editors were removed later in
updateEditorGeometries() but not all as the testcase in the bug report
showed.

Pick-to: 6.6 6.5
Fixes: QTBUG-103476
Change-Id: I90b3d3bff3857aa79f96eecf23d980928693b7bc
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 1d799e91082092821a04885bd9d069febefc37da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-09 07:15:07 +00:00
Ivan Solovev
96775c7c11 Deprecate QDataStream::readBytes(char *&, uint &) instead of removing it
We cannot remove the overload using QT_REMOVED_SINCE, because a qint64
lvalue in the new overload will not bind to an uint& parameter, so the
old code would not compile.

Deprecate the old overload, and add a unit-test that makes sure that
it still behaves correctly.

This commit also introduces the new deprecation macros that are
required to do the deprecation in Qt 6.11.

Amends fd48ce0b73c74dafd5db27bc1f2752ef665df7ef

Found in 6.7 API review

Change-Id: I02893bfbe040df736f8e746384e0261a0f0041d3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cbc6ee0eb9ef42c7024fa527bb94ac89953709a6)
2024-02-08 15:24:52 +01:00
Morten Sørvig
ab02d2053f qfreetype: Fix caching of memory fonts
Make QFreetypeFace::getFace() not return the same font
face for all memory fonts.

QtFreetypeData has a cache which maps QFontEngine::FaceId
to QFreetypeFace instances. Each FaceId should then
have a unique hash value, which is accomplished by
by hashing the font file name and a stored uuid.

However, we were not setting the uuid in all cases,
which means that in-memory fonts (which do not have
a file name) would hash identically.

Fix this by setting the uuid to a value based on the
address of the FontFile, which should be unique.

Change-Id: I45de37b512fb666c26490551c831c0db824b5f35
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b33b85cc46998133cddb18683402b6f0aaac754e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-08 13:38:00 +00:00
Jacek Poplawski
54a32bdacf Disable unloading libraries on VxWorks
Unloading plugins after each test case in QtDeclarative autotests leads to crashes (signal 11) during type registration in subsequent test cases.
The issue arises due to the unloading process, where unloading and then re-registering types in the next test case leads to sig11.
Disabling the unloading of libraries prevents the crashes.

Task-number: QTBUG-115777
Change-Id: I6712f687134fd452fb0b962363a8f0fde85344ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ef5ab6e00664caf0af23b21593f809d718c9dfc7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-08 13:17:58 +00:00
Marc Mutz
e576d50d7c QBitArray: avoid overflow in storage-to-size calculations
Unlike other containers, a QBitArray's size() is not limited by
storage, but, esp. on 32-bit platforms, its size_type: A INT_MAX
size() QBitArray only requires 256MiB of storage.

So we can't rely on "won't happen in practice" here and need to avoid
the potential UB (signed overflow) in the (d.size() * 8 - *d.data())
storage-to-logical-size calculation by using unsigned arithmetic.

Use the opportunity to Extract Method adjust_head_and_tail(),
centralizing the bit fiddling.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I485eafdf3ce2087a81c683672ff98a43f97c9968
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 78f8dfc5427457783ceef7d85885cddbec035ebe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-08 06:40:20 +00:00
Marc Mutz
e69a151573 QBitArray: use QDataStream::SizeLimitExeeded where applicable
[ChangeLog][QtCore][QBitArray] Uses new
QDataStream::Status::SizeLimitExceeded now, where applicable (was:
WriteFailed, ReadCorruptData).

Change-Id: If5a8db9c6b2f104b40266784d88cf7cad0b0ce73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6504496c646be5ded0318fd4663945c41bb1b02f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-08 06:39:55 +00:00
Marc Mutz
0985c707a9 QBitArray: don't create invalid Qt 5 streams
Qt 5 streams cannot handle QBitArrays with more than INT_MAX bits,
even on 64-bit platforms, because of interface constraints (size_type
int).

Qt 6 can, so make sure to refuse serialization of oversized QBitArrays
to Qt-5-compatible streams.

[ChangeLog][QtCore][QBitArray] Now refuses to stream a QBitArray with
size() > INT_MAX to a Qt-5-compatible QDataStream.

Pick-to: 6.6 6.5 6.2
Change-Id: I263e27bd366757c8e0360dfd337948c44d00647a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9219e8ff1d13a7e9aeb595d60aa4b3767a8941fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-08 06:39:49 +00:00
Alexandru Croitor
2cf327be82 CMake: Fix undefined symbol: qt_resourceFeatureZstd issue
When cross-compiling, host rcc might generate zstd compressed
resources, even though the target might not support zstd
decompression.

To avoid that, we made sure to disable zstd compression when using
cmake api like qt_add_resources if the target platform does not
support it.
We did not do it for CMAKE_AUTORCC though.

In such a situation, the linker would fail with:
 error: undefined symbol: qt_resourceFeatureZstd

Add the --no-zstd option to AUTORCC_OPTIONS for targets that are
created by Qt CMake public API like qt_add_executable and
qt_add_library if the target platform does not support zstd
decompression (check via the QT_FEATURE_zstd variable).

This in turn applies to our own qt_internal_add_ API as well.

Allow opting out via the QT_NO_AUTORCC_ZSTD CMake variable.

[ChangeLog][Build System] Targets created with qt_add_executable
and qt_add_library will now add the --no-zstd option to AUTORCC_OPTIONS
when the target platform does not support zstd decompression. You can
opt out via the QT_NO_AUTORCC_ZSTD cmake variable.

Pick-to: 6.6 6.5
Fixes: QTBUG-121948
Task-number: QTBUG-106466
Task-number: QTBUG-101353
Change-Id: Ibdcfecd9a4b1e206479a3f4588b1b624dd91e122
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 329dbfcc78d067d26b5a4dd99f4284900fd68f2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 18:31:17 +00:00
Ivan Solovev
7ccd63fd89 QDataStream: use SizeLimitExceeded status in write operations
Set this status when the stream tries to write more data than the
current serialization format supports.

Update the methods that write containers to return early if they fail
to write the container size, and do not try to serialize the elements.

Convert the manual tst_manualqdatastream test into a data-driven
test, allowing us to specify various stream versions. Adjust the test
code to check that the SizeLimitExceeded status is set when the
stream version is <= Qt_6_6.

Amends fd48ce0b73c74dafd5db27bc1f2752ef665df7ef

Found in 6.7 API review

Change-Id: If4c62ea53ac9bccd423f00f0f03afd6ba6bdc4f5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit dd514160ce169734e23a146a2c115fed55a69260)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:29 +00:00
Ivan Solovev
44dc38ebc9 QDataStream::readBytes(): make the growth of the buffer geometric
The algorithm tries to allocate the memory using 1 Mb blocks.
When the input data is large, this results in a lot of reallocations,
which is slow and inefficient.

This patch modifies the algorithm in such way that the allocation size
increases at each step, resulting in geometric growth of the buffer.

Pick-to: 6.6 6.5
Change-Id: I071df68d51ba1dbd8b2eb5f94eb078a33223505f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a1bfac287ee5d3719646d68dc91dc8e8e4cec04e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:29 +00:00
Ivan Solovev
635be3cdf1 Fix QDataStream::operator<<(const char *) to handle 64-bit length
The operator was not converted to using a new streaming version, so it
supported only 32-bit length.

Fix it and add a manual test for serialization/deserialization of
large c-style strings.

Amends fd48ce0b73c74dafd5db27bc1f2752ef665df7ef

Change-Id: I83704edec021d400b992de810feba5da52d5ffe1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 0aaf7092cd077eb07e62d3742293f146c65c9630)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:29 +00:00
Ivan Solovev
cc1476c608 QDataStream: use qint64 to represent size while reading and writing
Do that to avoid narrowing at the call site on 32-bit platforms.

Amends fd48ce0b73c74dafd5db27bc1f2752ef665df7ef

Found in 6.7 API review

Change-Id: I31142399385521d973b2ed3789745569e44d5d63
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0ed34d19926c60f3b74a58723c5c36f366e99d95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:28 +00:00
Lucie Gérard
7d0578b11f Change license for examples files
According to QUIP-18 [1], all examples file should be
LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I185ebdff2faa5e4af6ac0ee77c3ae33faae06e7d
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit f45dffa8b4e5a3ddc3473203e27ebdeebfde10da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:28 +00:00
Lucie Gérard
de0a46c966 Change license for tools files
According to QUIP-18 [1], all tools file should be
LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I89e08859871d29a9cf8c7a56b30b07b2c2f34b42
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit fb226262e8b371372fdc66b832b9eab24741f70d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:28 +00:00
Lucie Gérard
596341782c Change license of configure.bat file
According to QUIP-18 [1], all build system files should be
BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I58689f832ed3a5c8475c9bd7e0205e2128fb7cc2
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 20f7c54fdc76a3798ba431b88a0f9701253198c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:28 +00:00
Johannes Grunenberg
fdd4d5df69 QLogging: Add missing newline in win_message_handler()
Neither win_outputDebugString_helper() nor OutputDebugString() add a
newline at the end of the message, so one needs to be added before being
passed to the output handler.
A newline was previously present but removed when deduplicating calls to
qFormatLogMessage().

Fixes: QTBUG-121947
Change-Id: I9f1c1d8726e4234f24999f47c52340140d5a4614
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c05f987fcd36bf2f194f0dedb37f4eea7a68e4f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:28 +00:00
Eirik Aavitsland
cd59980f72 Update bundled libpng to version 1.6.42
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.42

Pick-to: 6.6 6.6.2 6.5 6.2 5.15
Change-Id: Ie41c2df610fcd456af2bc4dee05dde90c426602b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit a046bc19e451f6f2e42ac1fcddaf5ef3efc81f0d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:27 +00:00
Edward Welbourne
c2400042ba Update Valgrind to version 3.22.0
[ChangeLog][Third-Party Code] Updated Valgrind header used by QtTest.
The change only affects portability of s390 inline assembler.

Task-number: QTBUG-121346
Pick-to: 6.6 6.5
Change-Id: I7eca3b13d4f5475693c548b85b837d5d4b4b090f
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 79badf1b2c92cf937b2ded1cbae40cc69b358fba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 15:10:27 +00:00
Assam Boudjelthia
6ca01cd2d2 Android: request POST_NOTIFICATIONS permission for Android Notifier
Android 13 and above requires the notification permission
"android.permission.POST_NOTIFICATIONS" to be requested at runtime.

Pick-to: 6.6 6.5
Fixes: QTBUG-121668
Change-Id: I38512ffc07c1a3ffe7cddffa937b98332f172d15
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 7fa6d09ca20b27b8350e6e26040372ba70e6244d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 10:10:08 +00:00
Assam Boudjelthia
8c5ea5b368 Android: fix style extraction when set to none
If extract_android_style meta data is set to none currently the app
still tries to extract full stlye and crashes. If this option is set
no style data should be extracted after this patch.

Fixes: QTBUG-121667
Change-Id: I764e1eb6a582073196f991ca930d245d17a1f7e5
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit ff6a6d3285c48d5e54bf03361115116f58461e33)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 10:10:08 +00:00
Lucie Gérard
ae8a5adb96 Change license of .qdoc files
According to QUIP-18 [1], all .qdoc files should be
LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I7c4d8a1957db6f6d7ad18cbc1928499724e9305f
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 60889fcf72da0c3bf003ea587befee6b573ccb23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 10:10:08 +00:00
Lucie Gérard
7fdb18afda Change doc snippet license
According to QUIP-18 [1], all doc snippet files should be
LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I6e5bc9d05a5d510cc07a15abafe2257034562510
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 1dbc57ad0c7bb0ca9ffeb931c836f6f9791db12f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 10:10:08 +00:00
Marc Mutz
5e3723e7ff QBitArray: DRY operator<<(QDataStream&)
Drag the common parts out of the if-else. This also means that
qsizetype size() is no longer truncated in the assignment to quint32
len, but that doesn't fix the problem that we create invalid Qt 5
streams when the QBitArray has more than INT_MAX bits in it. That is
for a follow-up patch (which is why the {} stay for now).

As a drive-by, replace verbose constData() with data() (the QByteArray
is already const).

Pick-to: 6.6 6.5 6.2
Change-Id: Iabf816e16f823bb3959469a635a21339242f36fc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 741617aea0e4c631b2fd4b822f0948ec067f1cdc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 10:10:07 +00:00
Ed Cooke
277aa8e61b Update the icons in the system tray example
Update the icons for bad, heart and trash in the system tray example.

Fixes: QTBUG-119127
Change-Id: I0b6d4600397a0cb2a5474da04297ab92689358cd
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 1878556f25cb86ecefc986a92801c3cbe421ca8b)
2024-02-07 10:10:07 +00:00
Juha Vuolle
02abe2152f Remove HTTP 1XX status test from tst_qrestaccessmanager
1XX statuses are not final statuses, and testing 'error' on it is not
necessarily very meaningful. Furthermore the internal handling of
these statuses changes in Qt 6.8.

Fixes: QTBUG-108068
Change-Id: I9c18c579cd310266273eccd2aee2e032f60538e0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit cdfeca26cf313b84f6a9b1380e039f214357c52f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 10:10:07 +00:00
Christian Ehrlicher
e9b187a836 Q(Plain)TextEdit: don't crash when using a style sheet
When using a style sheet, Q(Plain)TextEdit::isReadOnly() might get
called during the initialization before d->control is properly
initialized which lead to a crash.
This amends 43ce457cbd093fc06d99b5ac833c789ef7c893d5.

Fixes: QTBUG-121697
Fixes: QTBUG-121790
Task-number: QTBUG-1857
Pick-to: 6.6 6.6.2 6.5 6.2
Change-Id: I15c357c9eef7f6559bcc2ad89033a3d8e7fcbfef
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit c6af5b9c12e1ea4cec007c5efe869636ce97a9d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-07 01:17:47 +00:00
Matthias Rauter
bf8edf8036 Update visuals of remote controlled car example
* Added icons to the controller.
* Keep the car within the scene.
* Removed the ui file because 4 buttons can be maintained in code easier.

Change-Id: I10af821beb442939e1e7fbdd3ffbde67a272bb2f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 29a4323974a1877faf389637be40688e3bc1790d)
2024-02-06 21:24:14 +00:00
Alexey Edelev
256c39f9d5 Add plugins of imported QtModules to the _qt_plugins property
This covers the following use case:
QtModuleX is pre-built and installed, it's imported. The plugin has
a PLUGIN_TYPE that is associated with QtModuleX and is built with
application that links QtModuleX. When deploying the application
it's expected that the plugin is deployed, as the one that belongs
to the linked QtModuleX.

This ensures that we udpate the internal _qt_plugins property that
is used in the __qt_internal_collect_plugin_targets_from_dependencies
function.

Pick-to: 6.6 6.5
Change-Id: I9824351ebab5a24509800da4db69f1e282a35884
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 75d83d5a6521a5cf5c7159f1ef09e8978e429919)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-06 19:23:27 +00:00
Matthias Rauter
13c57d394b Update icons in the torrent example
Fixes: QTBUG-118876
Change-Id: I7b3c24db220a0501bc2b99341589211bdf217c05
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0da459ec5bc5c92aed5de0e819778b6dd891ceef)
2024-02-06 12:18:40 +00:00
Tor Arne Vestbø
68a8a8b309 Harden WidgetAttributes debug stream operator
The call site may pass in a null-widget, so guard for that.

Change-Id: I631cb2fc105bad69faf3daaeac4b893457d27cc1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 97c02b80ae28d9bdc4e01980296e0db67f194f81)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-02-06 12:18:40 +00:00
Tinja Paavoseppä
5511f64ded Android: Fix QtTextureView inverted opacity condition
The Android TextureView class wants to know whether the view is
opaque, while the condition has been evaluating whether it should be
transparent. Invert the condition to let Android know correctly whether
the TextureView should have transparency.

Change-Id: Ic636f78dd3c691e85456c579e4559b8bc7a077a2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 8b601e6dbecdd85b77e0a7796dc3e5b908dfb5ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-06 09:22:46 +00:00
Tim Blechmann
e7f10f7e76 corelib: serialization - fix macos unity builds
CarbonCore defines `DEBUG`, which can nameclash with the `DEBUG` define
in the json parser when using unity builds

Change-Id: Ic9f666a1da98aaebe30836abf877228f2f83004c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cadc239c485ee4f1ab3587f3c53c548238c40fa5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-06 07:18:23 +00:00
Juha Vuolle
b21556bf2b Add missing QRestAccessManager constructor documentation
Fixes: QTBUG-121859
Change-Id: Ie8d9033a8efe36767f47509afe1a46c788cb13ca
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d5f3a9095bfc5e8b2725dd11a6fb4761f2a54027)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-06 06:11:13 +00:00
Juha Vuolle
5f821c72ea Add missing QHttpHeaders::isEmpty() documentation
Change-Id: Ib0d19cabc09d96b3920ade3db4d46b0bb0a6decb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 118ee59d8c30fd6c8609f003b694fb843559573f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-06 06:11:12 +00:00
Tim Blechmann
1e5892f74a core/gui: fix odr violation
When linking Qt statically, QtCore and QtGui are not separated into
different DSOs.
when both statically linked versions of QtCore and QtGui are linked into
the same binary with LTO, gcc emits:

```
/usr/src/debug/qtbase/6.3.0-r0/git/src/gui/painting/qicc.cpp:105:
warning: type ‘Tag’ violates the C++ One Definition Rule [-Wodr]
/usr/src/debug/qtbase/6.3.0-r0/git/src/corelib/kernel/qtranslator.cpp:78:
note: an enum with different value name is defined in another
translation unit
/usr/src/debug/qtbase/6.3.0-r0/git/src/gui/painting/qicc.cpp:106: note:
name ‘acsp’ differs from name ‘Tag_End’ defined in another translation
unit
/usr/src/debug/qtbase/6.3.0-r0/git/src/corelib/kernel/qtranslator.cpp:78:
note: mismatching definition
```

we therefore define the `struct Tag` in an anonymous namespace or the
QIcc namespace

Change-Id: Ib4edeede35c51322ab1959d70fb87359b196e59b
Pick-to: 6.6 6.5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6b13e0ca593592b34ea34837335db0d5cefdf630)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-06 05:03:19 +00:00
Thiago Macieira
6c89a9d606 QDBusAbstractInterface/Doc: fix example to match the description
The docs say "This example illustrates function calling with 0, 1 and 2
parameters" because it was copied from the synchronous call()
documentation. But the snippet didn't do that, because back in Qt 4 when
this was created, it was too difficult to exemplify that for
asynchronous use. It now no longer is, with lambdas.

Drive-by update the docs for both functions to refer to each other.

Fixes: QTBUG-121873
Pick-to: 6.6
Change-Id: I664b9f014ffc48cbb49bfffd17b089b7f77c1cde
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 9e73917537368d1904cc227da3332e970ad23752)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-06 03:36:27 +00:00
Ahmad Samir
1753af3841 QFileSystemModel: don't crash with setIconProvider(nullptr)
The method takes a pointer, so the code shouldn't crash when passed a
nullptr.

QFileInfoGatherer::getInfo() still needs to generate a descriptive
string for the file, so we refactor QAbstractFileIconProvider::type()
to put the implementation into a reusable static function
QAbstractFileIconProviderPrivate::getFileType(const QFileInfo &info).
This unfortunately involves constructing a QMimeDatabase on the fly,
but the docs say that is fine.

Drive-by change: use nullptr instead of `0` for pointers.

Pick-to: 6.6 6.5
Fixes: QTBUG-99178
Change-Id: Ia32ea0a26701d593e74fbecced7be8d9e0aa0f52
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 2a8b27bf6c523de6f3f466f8062279c093940a60)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 23:15:07 +00:00
Tor Arne Vestbø
8543be7355 iOS: Guard traitCollectionDidChange against lack of QGuiApplication
During shutdown we may get traitCollectionDidChange for our QUIWindow,
as it may outlive the QGuiApplication and the QWindows due to hanging
around in an auto-release pool.

Pick-to: 6.6 6.5
Change-Id: Ifc6471b933fb1b4d1e83e9b734aac31044dce03e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 4dbc267945df841508a217fbdb6faf15c6f457fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 23:15:07 +00:00
Ivan Solovev
6e269fe18e Implement QCborContainerPrivate::compact()
... and use it in QCborContainerPrivate::replaceAt_complex() to avoid
unconstrained memory growth in certain scenarios.

Remove the `reserved` parameter, because it was referring to the
elements array, not to the byte data, so it cannot really be used
in the implementation.

Fixes: QTBUG-109073
Change-Id: I2e8fe7e4a4bf7a0ce06c87ca657f2bc01bae0341
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 83f0796192d9f0ed3bc005dbcf68b98de62955b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 23:15:07 +00:00
Tor Arne Vestbø
f0bc5cac4f iOS: Guard against displayLayer after platform window is gone
During shutdown the UIView might outlive its QIOSWindow platform
window. If we receive displayLayer calls, we need to bail out,
to avoid crashing when trying to send the expose event.

Pick-to: 6.6 6.5
Change-Id: I2f36a4dd825e91b348bc57a06e6aa6b1a12fd249
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 483523ad9f9807e84ab6aa0f48712df0524dbe28)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 23:15:06 +00:00
Jaishree Vyas
97a39fb8f6 Doc: QDomDocument doc refers to QXmlQuery which doesn't exist in Qt6
Remove QXmlQuery from the docs

Fixes: QTBUG-120530
Pick-to: 6.6 6.5
Change-Id: Ic7927375701fbcdf106f90fbea8ea3aac2df8f5a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6be61763a0d2477d47031116381ec37704d155a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 23:15:06 +00:00
Tor Arne Vestbø
34e3bdcb5e iOS: Remove QUIView from superview on QIOSWindow destruction
Unlike on macOS, our UIViews are children of a QIOSDesktopManagerView
that we use to do window management, so we need to remove the view
from its superview, even if represents a top level QWindow.

The only exception is top level foreign windows, which are used to
represent a native UIView for the purpose of containing a Qt view
hierarchy within. As we don't know anything about the foreign view's
superview hiearchy we shouldn't touch it.

Pick-to: 6.6
Fixes: QTBUG-120369
Change-Id: I6a43bb0a4e72d0d1525a7cc33d572ea7477215b3
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit bc7e728fcfd2cfdbff29fa9d1b0f8dae718a0f8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 23:15:06 +00:00
Eirik Aavitsland
27625a33c5 Update bundled libjpeg-turbo to version 3.0.2
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 3.0.2

Fixes: QTBUG-121737
Pick-to: 6.6 6.6.2 6.5 6.2 5.15
Change-Id: I0085f0f859dd9c95ed203fd22bd9702fd1e9d721
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 972bd4ed46be6ad905f2cd8bd84776cf3f1f3220)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 20:02:10 +00:00
Jarek Kobus
c160f3340e QObject: fix installEventFilterOrder() test flakiness
Don't rely on timer precision and use int counter instead.

Amends 1fe88bf4cd919d4b5cadb4be2cf0193525c54673

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I057b4dd51014784ec9b244301b43583f3de6ddd1
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 0d0810e2dcc8a9ee28935af5daadc2ef36ed25a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 20:02:10 +00:00
Edward Welbourne
f48faee770 Make TEST_CTOR macros use the "do { ... } while (false)" pattern
They were expanding as simple blocks, so their uses didn't end in
semicolon, which looks wrong when reading the code.

Pick-to: 6.6 6.5
Change-Id: Ibea7b01ac165045604b6eb7a838765b2061c368a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 5d451d514cc35402b04288372483223d6c893c47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 20:02:10 +00:00
Edward Welbourne
41c786781a Update QLocale and calendar data to CLDR v44.1
(This turns out to be identical to v44, for our purposes.)

The CLDR license has been revised at v44 to "UNICODE LICENSE V3",
which is now included (as LICENSES/UNICODE-3.0.txt) in addition to the
old license (still in use, presumably, by UCD - at least until its
next update). Some new QLocale::Language entries are needed. There is
no change to the time-zone data.

Some tests needed changes:
* Various Arabic locales now use U+0623 (Arabic letter aleph with
  hamza above) in exponent separator, replacing plain U+0627 (Arabic
  letter aleph); it is still followed by U+0633 (Arabic letter seen).
* Where likely sub-tags used to fill in world, 001, as territory for a
  language, they now (e.g. for Prussian and Yiddish) give specific
  countries.
* Tamil locales now have something of a mix of inherited and localized
  forms for AM/PM, which looks a lot like a mistake in CLDR.

Conflict resolution at 6.7: a test fixed in dev is not present in 6.7,
as it wasn't reworked or given the new test-case, so that's omitted.

[ChangeLog][Third-Party Code] Updated QLocale's data extracted from
the Unicode Common Locale Data Repository (CLDR) to v44.1. The license
changed to Unicode License V3.

Pick-to: 6.6 6.5
Fixes: QTBUG-121485
Task-number: QTBUG-121325
Change-Id: Ide1a68016129526d7a5aa3fc67f1a674858696bc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 063026cc503e0c02af781caf920f5abfa0416268)
2024-02-05 21:02:10 +01:00
Tor Arne Vestbø
64f6664f5c Don't set ExplicitShowHide on children when showing parent widget
As a result of using QWidget::setVisible to show the child widgets we
would end up also setting ExplicitShowHide. This is not in line with
the intent of ExplicitShowHide, which is to flag a widget as explicitly
shown/hidden by the developer, which in turn prevents Qt Widgets from
toggling WState_Hidden when the widget is reparented.

By using QWidgetPrivate::setVisible instead, we can show the child
without setting ExplicitShowHide.

As side effect of this is that we no longer reset WA_WState_Hidden
from QWidgetWindowPrivate::setVisible(). This is an issue when the
setVisible call comes as a result of destroying the QWidgetWindow,
as that is an implicit hide, and should not result in the widget
having WA_WState_Hidden. QWidget handles this case in hideChildren
by not calling QWidgetPrivate::setVisible -- instead doing its own
reset of WA_WState_Visible. We don't want to untangle this just yet,
so as a workaround we detect that the widget is already !isVisible(),
thanks to hideChildren having hidden it, and then skip the call
to QWidgetPrivate::setVisible that results from QWindow::destroy().

Task-number: QTBUG-121398
Change-Id: Ib5b4d9c84f0569124c5f3ca2169cabff18934e2d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5ba0982b2879a1a4c13bf97467b8e5ad296e57a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 20:02:10 +00:00
Tor Arne Vestbø
c8a543e3ec Simplify tst_QWidget::closeAndShowWithNativeChild
The nativeHiddenChild is not used for anything, and shouldn't be
needed to trigger the failure condition.

That said, I was not able to reproduce the test failure on macOS
14 with the test neither pre or post patch, nor with any of the
test cases mentioned in 51300566ffe2ece2455e1d0479a556c5dbb3bb8e,
nor with 51300566ffe2ece2455e1d0479a556c5dbb3bb8e itself, so this
has seemingly been fixed or worked around some other way in the
meantime.

Task-number: QTBUG-121398
Change-Id: I299e7f4b71ebdb17870348a3d5b0c49a93228c8b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f85c988980f73398762d4bd5c1a8a1799d182bdd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 20:02:09 +00:00
Tor Arne Vestbø
0b76a0b322 Add logging, clarifications, and tests for QWidget show/hide behavior
Task-number: QTBUG-121398
Change-Id: I94b4c90c3bd515279417c88497d7b9bd5a362eae
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b393b26c70cc40c37173cba8c22d66484041087c)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-02-05 20:02:09 +00:00
Tor Arne Vestbø
527b5f6ff4 Don't rely on QRasterWindow::resizeEvent for marking window dirty
The de-virtualization gotcha might result in client code not calling
QRasterWindow::resizeEvent, which we use for dirty state management
after e0eb2818face4ffb7dafd87464f355d4654b7be0.

In practice this wasn't an issue, because QPaintDeviceWindow handles
paint events by calling markWindowAsDirty first, but we should not
rely on this.

Instead plumb the resize event to QPaintDeviceWindowPrivate, which
QRasterWindow implements and can override the behavior of.

Pick-to: 6.6 6.5
Change-Id: I5c0747da10f0275b77f56be32690d796fa48cdb4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6cb497c1570ee427460962b2c0abe3b6dd8c4ae6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-05 15:51:24 +00:00
Liang Qi
3e563542b3 QGenericUnixServices: make sure the picker returns a color
This amends b646c7b76c7787cff57bca0fde04d9f58abdfbb8 .

Pick-to: 6.6 6.5
Change-Id: Ic7183c06a93085d65b31c86380889b78c714548b
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit f07d8309d6c61397677703cfa195927aee0cd50e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-03 20:40:23 +00:00
Thiago Macieira
e32853b75d qHash: provide the long double overload on Darwin systems
Commit c0791ac76ec7cfdc3945efa67a6f72ee3623413c didn't explain why it
was #ifdef'ed out. It's just an alias for double. Maybe compilers at the
time used to complain if you used it, but I can't make Apple's clang
produce a warning now.

Change-Id: I664b9f014ffc48cbb49bfffd17b02293403e9571
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit c5f22c54cbff8c31ab9e5111e74faae4e188e99b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-03 18:08:37 +00:00
Ahmad Samir
6b4805333f QMetaObject: clean up includes
Remove duplicate ones and regroup them.

Add a comment explaining why qthread(_p).h isn't guarded by an
`#if QT_CONFIG(thread)`; thanks to Fabian Kosmale for the explanation.

Change-Id: I9b13fd62ab92fa6d2ffc4d004d77e95e95f5fb08
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 28db390ce686ec8af70334e80ceae5ee2ebf87df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-03 11:48:27 +00:00
Volker Hilsheimer
bd179a8d2f Fix usage of std::enable_if_t to SFINAE out QProperty APIs
Declare an IfUntypedPropertyData alias and use that consistently.

Amends 311f8896322bcd39d33369c8311a8c89ccdad449.

Change-Id: If36ef8e2f9ce25e0ffe7b4b448c31ea5866acfc3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 216af5d7f9675a408e22167b097f221beeeb88db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 23:48:31 +00:00
Volker Hilsheimer
78e2a49a48 Reapply: Remove const/ref debug operator for QDockWidget
QObjects are usually passed by pointer, so we leave the override
taking a pointer.

This amends bbeff2a3350dd3396400865525d509b784c2d93e, and reverts
the previous revert in b148a362c36a9b34b0c21c60530353d6bf6b92cb.
Now that we have removed the incorrectly added operators from the
6.6 branches entirely, we can remove the unnecessary const/ref
operator from 6.7.

Task-number: QTBUG-119952
Change-Id: Id196367ddf3ffb443db44194002f850dcfec5d79
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4b64df56509dd770002ec083ee64f3ec23a8b682)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 23:48:29 +00:00
Giuseppe D'Angelo
43362244a1 QLineEdit: disable cursor blinking on hide
QLineEdit activates the blinking cursor timer when it's shown,
but never deactivates it, resulting in constant wakeups even for
hidden line edits.

Note that this is a workaround. Qt is supposed to send a focus out
event to line edits that get hidden. In some corner cases, it
doesn't, and only a hide event is sent.

Change-Id: Ic0645512051466ca9b1e84c54cef34c22287338b
Task-number: QTBUG-52021
Pick-to: 6.6 6.5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit e35dcba5bb8cdcf578a514ad6e03ae64002c2c3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 22:52:19 +00:00
Tasuku Suzuki
eeede2d800 Fix build with -no-feature-animation
This amends 8eaf01ef818c1b980e2bbce1e8ddd2de638f5028

Change-Id: I8e30f232b732b0acb0b6c7070ecfa216fabd64da
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 2b8a604c40814fb25db3e02f9a7776cde9bc1c7e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 22:52:19 +00:00
Ghenady Kuznetsov
43de61139e Fusion style: add right side indent to groupbox title
Add right side indent to the title if groupbox alignment is set to
Qt::AlignRight | Qt::AlignVCenter.

Fixes: QTBUG-121049
Pick-to: 6.6
Change-Id: I9aac295c824ad774410efd679f59075e4251b611
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 3aa9388056f56b65b33cd2929a690584e21a02b2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 22:52:19 +00:00
Wladimir Leuschner
e64861d416 QWindows11Style: Draw MDI SubWindows in Windows 11 style
Fixes: QTBUG-120633
Change-Id: I6ad4052ca45f7c90cd52a9d2440b508730d3685d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit a1f12273b2e355033ab2a9478d1e9702210a0733)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 22:52:19 +00:00
Alexandru Croitor
cfdffa17a5 CMake: Fix configuring a standalone test on Apple platforms
Configuring a test as standalone would fail with the following error:
 Invalid max SDK version: It should be a major version number,
 without minor

This happened because _qt_internal_check_apple_sdk_and_xcode_versions
expects QT_SUPPORTED_MAX_MACOS_SDK_VERSION to be available, but it is
not yet set due to Qt6 package not being found yet.

Avoid the issue by exporting the version requirements into both
Qt6ConfigExtras.cmake and Qt6BuildInternalsConfigExtra.cmake.

Make sure to assign the variables only once.

Amends a29bff3d80219f54d0837b0e6e0577192011dea1
Amends a0bdd2195f24d8a7d880ba506afc16b41337218e

Pick-to: 6.6
Task-number: QTBUG-119490
Change-Id: Ic297eeaabf22c8c42ded1a766906f88fdb91fd3d
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit cec2e42052a04cd2481c20bd4be5de2ba5ccaec2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 22:52:18 +00:00
Shawn Rutledge
7fa10ab76e QMovie non-anim: use QImageReader::imageCount but not nextImageDelay
Since 3f4d6279c4b0d04422efff478a5e2fb36259dbaa (khansen 2005) QMovie
calls QImageReader::read() until QImageReader::canRead() returns false.
That's apparently to support animated image formats in which the
frame count is not known at the beginnning (i.e. not specified in
the image format's metadata). But non-animated multi-frame formats
are expected to return valid values from QImageReader::imageCount();
and those also tend to keep returning true from canRead() regardless
of how many frames have been read (the interpretation of canRead()
is "does the file have the expected format?" rather than "are we
about to read too many frames?"). So, when a multi-frame image is abused
as an animation, QMovie was able to keep reading the same frame
repeatedly and pretend that the frame sequence goes on forever.
It also tended to read frames as fast as they could be decoded,
because nextImageDelay() is not usually provided, because multi-frame
image formats don't specify a frame rate in their metadata.

So now we change QMovie's behavior for image formats where
QImageIOHandler::supportsOption(Animation) returns false:
trust imageCount(), but not do not trust nextImageDelay().

But to actually jump to the next frame in this case, we also need to
call QImageReader::jumpToNextImage().

Altogether, this makes QMovie support "flipbook" animation for
multi-frame image formats, such as tiff and pdf.

Added "read frame x of c" logging in qt.gui.imageio category.

For testing, we use a pre-existing multi-frame Obj_N2_Internal_Mem.ico
file, to avoid depending on the tiff plugin.

[ChangeLog][QtGui][QMovie] QMovie now handles non-animated multi-frame
image formats (such as tiff): QImageIOHandler::imageCount() is observed,
and the default frame rate is 1 FPS.

Pick-to: 6.6 6.5
Fixes: QTBUG-117429
Change-Id: I6dad2a684e12c78a68288402e223a59427bf649e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 7c313f18654d18fe253e1f1c55d6f4d92660888a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 22:52:18 +00:00
Shawn Rutledge
ff8928d3cb Update md4c to 0.5.2
Followup to c29a235833410fde4cb4d502f89129bccd7403f0

[ChangeLog][Third-Party Code] md4c was updated to 0.5.2.

Task-number: QTBUG-121442
Pick-to: 6.6 6.6.2 6.5 6.2
Change-Id: I097d9aa5f54c59c301a91fb824adf949daae3af2
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 16bcdba8e7adae79729c6347e711bd0a976dbbe7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 22:52:18 +00:00
Ahmad Samir
2e6e0c6bb4 QObject: add unittest to check the order of eventFilter() calls
installEventFilter() prepends new objects to the eventList, so that
events that are posted while processing events are left to the next
round of event processing.

This is a baseline test to check that subsequent commits preserve the
current behavior.

QCOMPARE_GT is available since Qt6.4, so make the check backportable to
older releases too.

Pick-to: 6.6 6.5 6.2 5.15
Task-number: QTBUG-120779
Change-Id: I5ed5e9c2917a9be62de4af19c3b72889399b4fe6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 1fe88bf4cd919d4b5cadb4be2cf0193525c54673)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 19:50:50 +00:00
Alexey Edelev
fa6f2783ae Use separate property to store implicitly detected QT_QML_ROOT_PATHs
Use _qt_internal_qml_root_path when collecting the qml root paths using
_qt_internal_collect_qml_root_paths. The property is only applicable for
Android builds. This suppresses the QTP0002 warning for the cases when
android application has both QML executable and QML library modules.

Amends 575b8a7fa289a2e27984a6c322069f9e1b499024

Pick-to: 6.6
Change-Id: Iccadbe1f6ed697a94dba11af3dd054baec8daf9e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit d954d53c1ddcffda394c4f44663b4c86a61ed452)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 15:28:34 +00:00
Lucie Gérard
98d5d291e7 Change configure license
According to QUIP-18 [1], all build system files should be
BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Task-number: QTBUG-121787
Change-Id: I88e3640b32e6b4bd83c49c14df6aecd7c824aef7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 35fbb6561028a59702b12d6ff5e7cf310202ed0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 15:28:34 +00:00
Volker Hilsheimer
6925dcbf79 JNI: Don't use forwarding reference in ranged for
The elements we iterate over are always jobjects, i.e. POD, so iterating
over values is at least as efficient, and less unnecessarily clever.

Change-Id: I6142dab84f3d37d82613ecf27cc03dde7810e541
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 9f0dc59cd62f7afd18b36e6064f2d4b8ff2a7c6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 15:28:34 +00:00
Marc Mutz
ac399ca897 StreamStateSaver: disable copy/move
The class has a user-defined destructor, so it mustn't be copied or
moved (which here is the same as copying).

Amends 3c93286f08a80b6e1821d7d63d361742b25c6578.

Pick-to: 6.6 6.5
Change-Id: I1b23588309654f34aedc0269e1d1c9511ddda2bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 1b3c8d6e95a81d307a9f7bb556aabcf7fea04588)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 15:28:34 +00:00
Joerg Bornemann
907497b87d CMake: Fix *-metatypes.json creation, take III
Use the work-around for CMake issue #19005 for Makefile generators
and Visual Studio projects.

Pick-to: 6.6 6.5
Fixes: QTBUG-120317
Change-Id: I3d15f23937133a5dd4d1c2a88af0fc34d5608a77
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 654f3c5634ac9efc2257177351c8dea7c8d8875a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 15:28:33 +00:00
Tim Blechmann
d5134f2123 kernel: silence -Wextra-semi
silencing gcc's `-Wextra-semi`

Pick-to: 6.6 6.5
Change-Id: I0e70465585be5ba4d90c691cd0fbd43e1288e694
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 6fc93f9765201de19b52823a4c0fd661711aa971)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 11:15:26 +00:00
Edward Welbourne
5bff9b1ec0 Documentation tweaks in QDate(Time)?::toString()
Include the \since markers they need, plus changes in past versions.
Purge a stray blank line.

Pick-to: 6.6 6.5 6.2
Change-Id: I4edaa0ffaf59323e0af6412727f2a85866813ab8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 8c178a540faf27fdab6977b13507d94735f89e21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 11:15:24 +00:00
Lucie Gérard
d754b96c4e Change license of .qdoc files
According to QUIP-18 [1], all .qdoc files should be
LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

[1]: https://contribute.qt-project.org/quips/18

Change-Id: I4559af21fc9069efa9bf0cbd29c5e86cfdac9082
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 865d0133fcb54c0e22f53dde71ebbca9cbcaf78e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 09:47:31 +00:00
Friedemann Kleint
8a762c8857 Menu example: Use theme icons
Change-Id: I7f77457b439919e7a7882f23e21e648d8965859a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4aa2e594ff055e46c56734a2c0838c214c6bce88)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-02 08:48:31 +00:00
Jøger Hansegård
e2fbb431cb Deploy FFmpeg dlls with windeployqt
When we add support for dynamically linked FFmpeg, some FFmpeg libraries
will be available in the bin directory. windeployqt should then copy
these libraries to the application directory if the ffmpeg media backend
is included.

This patch extends windeployqt with support for deploying these FFmpeg
libraries.

Potential issues:

1. This patch hard codes the FFmpeg library names that we currently
   depend on, such as 'avcodec' or 'swresample'.
2. We don't take version number of the FFmpeg libs into account. This is
   done to reduce the maintenance burden when we upgrade FFmpeg, and
   should not be a problem as long as we have a single version of FFmpeg
   in the online installer.
3. Finding the library names is a bit quadratic in complexity, bound by
   the number of libraries in the bin folder, but should not be too
   slow.
4. We need to update windeployqt if we add or remove ffmpeg libraries.

An alternative would be to identify all dlls that the ffmpeg media
plugin depends on, and then deploy all files that exists in the bin
directory instead of hard-coding library names. This would, however be a
bit more fragile because we would not be able to warn if a library was
missing.

Note that this patch is a workaround. It is needed because Qt does not
properly support CMake's runtime dependency features with platform
plugins. Even if we added FFmpeg binaries to the dependencies set, they
would not be visible at install time.

Pick-to: 6.5
Change-Id: I4b23e50429d16e8487bf43ce9982ff37d02ffbe2
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
(cherry picked from commit 138eebcc099e5e95ce04315ac7e1899f59399ca1)
2024-02-01 13:51:24 +00:00
Volker Hilsheimer
ed07354be6 JNI: Fix QJniObject::callback test case
Don't call the native function directly, call the Java function that
calls the native function.

Change-Id: Icdcf250313a38f6e4bc2b90fb7b0adbfa5a890fb
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit cfcd56a78fae5d4f4c79f9e76d6bcd57f8a3cde2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 13:51:24 +00:00
Alexey Edelev
bf6b4167bc Introduce QTP0003 which controls the BUILD_SHARED_LIBS impact on user projects
Since 6.7 we consider the BUILD_SHARED_LIBS when creating libraries
using Qt CMake API. This change may affect the user projects that rely
on the old strategy of selecting the default library type. To preserve
the old behavior this change introduces the QTP0003 policy that allows
user to control whether the BUILD_SHARED_LIBS should or shouldn't be
considered in library creation process.

The policy doesn't affect Qt repos, we assume that we want the NEW
behavior by default.

Fixes: QTBUG-121707
Change-Id: I4bcfbd8966839731624e3f7ef9e0d6bb2782ac50
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 31b75303d7f9126dcc9bb0e94f0ea4ef1b9c0a71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 09:14:36 +00:00
Topi Reinio
55f56b9dd1 Doc: Fix argument names in QRgbaFloat::fromRgba64() \fn signature
Fixes the following documentation warnings:

(qdoc) warning: Undocumented parameter 'r' in QRgbaFloat::fromRgba64()
(qdoc) warning: No such parameter 'red' in QRgbaFloat::fromRgba64()

(Which repeat for green, blue, and alpha.)

Change-Id: I22d281b716865eec649b9fb63f2113f982fdf8ea
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 92dc4c5c9451f70060bf379742b91c8cacbb7df6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 09:14:36 +00:00
Topi Reinio
2e5a5e23fc Doc: Fix undocumented parameter in QFlags::operator=()
Fixes a documentation warning:
  (qdoc) warning: Undocumented parameter 'other' in QFlags::operator=()

This warning is reported by the latest version of QDoc, but fixing
it causes another warning in the currently-provisioned QDoc.
Therefore, raise the warning limit temporarily to pass the
documentation check in CI.

Change-Id: I14863baebf712cda6f4da6d989e3ab83ffea7f85
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit d76828a1c73ecb5858142f63bea4bb4ea8bf2a25)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 09:14:35 +00:00
Mårten Nordheim
482962ffca Bench QSet::unite
It was shown to have poor performance compared to contains() and
insert().

Pick-to: 6.6 6.5
Change-Id: I61cfbc8c34e325d677d7954118ef68057df640cb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 000cb2dadc16e5bd585da459de44f1902943ea56)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 09:14:35 +00:00
Marc Mutz
a06a78bb04 [docs] Fix C'n'P error in QTRY_VERIFY2 example
It's not the _WITH_TIMEOUT variant (the timeout is missing).

Amends a change preceding b24bb12f6a93b98e9bc44c99e151b995eb7cea71,
the commit that moved all the documentation into qtestcase.qdoc in the
first place. I didn't track the change back further than that.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I79ccd84a5dbed20012fa1a2d3561945f8a7638d5
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4af3cf275fc9f5e721fab6b05fc05cf7bdbe5c99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 09:14:35 +00:00
Yifan Zhu
91d4dd50fa qxkbcommon: map XKB_KEY_XF86Calculator to Qt::Key_Calculator
cfd935fe6c26800befc10889afc0aebde311acca removed the erroneous mapping
from XKB_KEY_XF86Calculator to Qt::Key_Launch1, leaving it unmapped.
It should be mapped to Qt::Key_Calculator, just like
XKB_KEY_XF86Calculater.

Fixes: QTBUG-121713
Pick-to: 6.6 6.5
Change-Id: Iaa28e38792f43a7950a3c38397869a6ffed332d1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 86e92972dd1df463f8da859f651ba0eb76dacd50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 06:06:31 +00:00
Tor Arne Vestbø
c967ee08c8 macOS: Don't condition deferred exec on specific NSAlert to be the modal window
When a QMessageBox is created with setModal(true), the user can in theory
choose to show() it, and then return back to the main event loop, instead
of calling exec(). We tried to support that case via a single shot timer,
called on the next pass of the event loop, that checked if the applications'
current modal window was the alert, and if not, showed it at that point.

That logic failed when there were more than one alert show at the same
time.

We do maintain a stack of the modal sessions and their windows in the
Cocoa event dispatcher, so we could use that to check if a modal session
had been started for the alert's window, but a similar solution is to
just check the alert window's visible state.

Fixes: QTBUG-121557
Pick-to: 6.6 6.6.2 6.5
Change-Id: I6f52a53e8f678bb8a071e334a09ab30669d95bbf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
(cherry picked from commit 7edff3f15ae21c2310437e0711f84442a21cb6a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:25:34 +00:00
Liang Qi
7927145625 tests: fix a crash in tst_QItemDelegate::reuseEditor() on Wayland
Pick-to: 6.6 6.5
Task-number: QTBUG-107153
Change-Id: Ic041302753bee4e2292b2afd898dd176966cf951
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 75d1db6aedfe7e627af8881dd2e3b8988af8767c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:25:31 +00:00
Topi Reinio
5a7e7942cd Doc: Qt Network: Fix references to renamed functions
As part of the API review process, in QNetworkRequestFactory:

(set|clear)Headers() were renamed to (set|clear)CommonHeaders(), and
request() was renamed to createRequest().

In addition, QHttpHeaders::has() was renamed to contains().

Update references to the old names in the documentation.

Change-Id: Ib79ae99de26be2f3af60787c8b86c3c20cb30067
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 711def1290439d19e7ed9068704bb2160edab968)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:25:30 +00:00
Jacek Poplawski
3340b82ee9 Make sure the sqrt value in qdrawhelper is non-negative
It's possible for the "det" variable to exceed 0 and be negative.
This scenario is already handled in one case, this change will fix second case.

Fixes: QTBUG-120907
Change-Id: Ib30213b3455b5c6f3b8b8384e78e7b43158f93b5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ba75e7770f7facf5f841e72ca0a4fd2a1a1fb6e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:25:28 +00:00
Kai Köhne
2c53d990f7 SQLite: Update SQLite to v3.45.1
[ChangeLog][Third-Party Code] Updated SQLite to v3.45.1

Pick-to: 6.6 6.6.2 6.5 6.2 5.15
Change-Id: I8083d0750e52b1035919821c25cef9855afea2f9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 40a87ca1b421457fc2a31cf385eb5a0eda83486f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:25:00 +00:00
Alexey Edelev
2d77750bf7 Change the way we detect the need of adding Qt<Module>Plugins.cmake
Currently we assume that only modules that have plugins built in the
current build tree need to generate and install the
Qt<Module>Plugins.cmake file. This approach is weak since other Qt
modules might still want to provide the plugins of the certain types,
even if the module that the plugin type belongs too didn't have plugins
initially.

The fix unblocks the formally 3rd-party plugin installation and loading
chain.

Pick-to: 6.6 6.5 6.2
Fixes: QAA-2266
Change-Id: Ifc616e26a00674371c8e2fe2ca12237d153e5707
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 180afc7321c85f7f36d085b76d1be74c99da2462)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:57 +00:00
Joerg Bornemann
564e3ed628 CMake: Warn if DEPLOY_TOOL_OPTIONS is used on Linux
...or rather when it's used with the generic deployment tool.

Task-number: QTBUG-121708
Change-Id: I161564923a43c82150f581874ba20a9ad6de310f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e39d13bc873a651007d45b23e1d87a676224cba2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:54 +00:00
Marc Mutz
ce5b1750fd update_public_suffix_list.sh: print suggested topic:
This was in the 6.2 and 5.15 versions of the script, but not in dev,
6.7, 6.6, 6.5, and so was promptly forgotten.

Pick-to: 6.6 6.5
Change-Id: Ic0a1708a29eccd7efe41aa4670ea55f1edb6be0b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 324fe120ba405f0eeca0b1a00cc5aee0ea99f76f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:51 +00:00
Marc Mutz
d61a333705 QBitArray: fix potential truncation in QDataStream op>>()
In Qt 5, a QBitArray could not contain more than INT_MAX bits, because
the then-size_type, int, cannot represent more, even if the underlying
storage could hold 8x as much, and the serialisation format, using
unsigned int, could represent 2x.

Therefore, reject old formats with sizes that exceed INT_MAX elements
as corrupt.

Likewise, the Qt 6 serialisation format unconditionally uses 64-bit
sizes, but 32-bit platforms still cannot represent more than
numeric_limits<qsizetype>::max() (= INT_MAX) bits in memory. This is a
valid stream for 64-bit platforms, though, so ideally, this should be
using SizeLimitsExeeded, which, however, is only available from Qt
6.7. So, for now, and until we have SizeLimitsExeeded, mark the stream
as corrupt here, too.

[ChangeLog][QtCore][QBitArray] Fixed undetected overflows in the
deserialisation (opertor>>()) from QDataStream.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ib24cf9218c06a3a05185723c77d4313611c2dd40
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0808beace332631f8100b5700577f10f63e4630c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:48 +00:00
Tinja Paavoseppä
c86002f7ab Android: Set up style also when using QtEmbeddedLoader
Embedded loader was missing style set up, leading to a crash
when platform theme style data was loaded. As a drive by, change
the style set up to use Context instead of Activity, since it doesn't
require Activity.

Fixes: QTBUG-119532
Change-Id: I434233e173cc2c90d981bbf2aa0044117a20b17f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit bd5ae42cf86857fa08c2607eb8c9e434317374f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:45 +00:00
Tor Arne Vestbø
f57539d4f5 Add QWidgetPrivate::isExplicitlyHidden() helper function
To aid readability.

Task-number: QTBUG-121398
Change-Id: I3cb231584c2b7aee72e9f01c669fed1e01fbe475
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4634fbf34e1674846e1666bcdb3055f82e3096b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:42 +00:00
Eirik Aavitsland
03bf71b7ff Update bundled libpng to version 1.6.41
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.41

Pick-to: 6.6 6.6.2 6.5 6.2 5.15
Change-Id: I3285bfa11f61c571ffda1b365011a5c6a798ca68
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 528032c02771ddc35d054ff8d414b382904b607e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:39 +00:00
Volker Hilsheimer
5e04fb478a JNI: fix declaration of ElementType in QJniArray::makeObjectArray
List might be a reference type, in which case it won't have any members.

Change-Id: Iac2c08c42f31ebc67b31be157f73ae318d328a18
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit ddc67dcc5a270a3739514c23b88ed8612f0ae1f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:37 +00:00
Volker Hilsheimer
53497c0a01 JNI: pass POD parameters by value
All calls to the fromVarArg() conversion helper are made with JNI types
from a va_arg list, so they have to be either primitive types, or a pointer
(jobject, which internally is a _jobject *). There's no benefit from
moving those or passing them by reference; the most efficient convention
is to pass them by value.

Change-Id: I6fed9b202be3c6a265117684fecd51d03ccbb534
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 43f66e619176e4903aa62a30dc5ae2122e22f13a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:34 +00:00
Volker Hilsheimer
db5e112419 JNI: simplify implementation of native function wrappers
When declaring native callback functions with the JNI type system, then
we actually register a helper function with variadic arguments, and
implement that to forward the arguments to the declared function, which
then might use higher-level types as arguments. We deduce those
higher-level types through a variadic template, and use std::tuple as
well as std::apply to generate the calls.

Simplify the implementation by using std::make_tuple, and replace
q20:remove_cvref_t with std::decay_t; this is what std::make_tuple uses,
and we don't need to maintain functions and arrays as such.

Found during 6.7 header review.

Task-number: QTBUG-119952
Change-Id: I7cd206c6b372c2ec62a10feb5f9253f5607f01a9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 76cf922980cf0cde7cb03f4bec8f17eab94a5767)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:30 +00:00
Volker Hilsheimer
e20f2a6c8b Stabilize tst_QFileSystemModel::showFilesOnly test case
Amends 83e5d74864a8780445db4b34e406afc53b331039.

A model index returned by QFileSystemModel might become invalid when
events get processed, so don't store the result of setRootPath to re-use
it in a QTRY_COMPARE function. Instead, always ask for a fresh model
index.

Also, use std::chrono::duration::count correctly; it returns the "tick",
not the corresponding milliseconds, so (10s).count() returns 10 instead
of 10000. Explicitly use 10000ms here.

Un-blacklist the test on macOS again.

Task-number: QTBUG-74471
Pick-to: 6.6 6.5
Change-Id: Ic98bb53c696441131bbc1055b64822faf2aec96f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 72f5b35b3d7704db6ef16e4c60751ed8444363be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:27 +00:00
Joerg Bornemann
108990dc13 qt6_deploy_translations: Don't deploy the "qt" meta-catalog
The "qt" meta-catalog is some relic from the past that pulls in the
translations for qtbase and qtmultimedia. The qtbase translations are
deployed by default, and the qtmultimedia translations are deployed if
qtmultimedia is used by the project.

Change-Id: I53e5920d39f87162c418fb3f4cff7927ec9b5488
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 62bea90207b6fde116ef6fbb926565b648708d57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:24 +00:00
Joerg Bornemann
b09c637c49 Doc: Add table for *_DIR parameters of qt_deploy_runtime_dependencies
The tables allows us to show how the parameters correspond to variables,
and it gives us the ability to add notes.

Add the note that LIBEXEC_DIR is available since 6.7.

Task-number: QTBUG-121708
Change-Id: I9421bdc692b0df45dc356c17fb90da8799d18ef9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 313b7c56bd4f2053483c1addea89d8e293bc433b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:20 +00:00
Joerg Bornemann
01a0b81998 Doc: Address qt_generate_deploy_app_script issues from API review
Task-number: QTBUG-121708
Change-Id: Id0beb7c3045513e1665bd4062f7236243898b7c1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5d1ddee4cc38f684ed635a2b917c61db80a27ff6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:16 +00:00
Joerg Bornemann
cbfc5a0a95 Doc: Add note to deployment variables
...that mentions that they're only needed for advanced use cases that
aren't covered by the higher level deployment commands.

Task-number: 121708
Change-Id: Id31aece7ae7685ea5f4940e6c4adf62ae8216528
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 609a9bc93967403726d0139bbf63162cb61d3fa2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:13 +00:00
Joerg Bornemann
7ffe548334 Doc: Address qt_deploy_runtime_dependencies issues from API review
Task-number: QTBUG-121708
Change-Id: I8b7b3a7d03ab757f3cb6e55f27f0e4ba0e4a5bbd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1902f98a9d02d576d38059081a395d9cf6a342af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:10 +00:00
Edward Welbourne
e0746c52bd QDate(Time)?::toString(): eliminate QCalendar() defaults
Since QCalendar is non-trivial, parameters of this type should not
have a default in the declaration; better to have an overload set with
the calendar-less overload out-of-line passing the default.

This actually restores signatures that existed previously, but that
were merged with the QCalendar-taking overloads at Qt 6.

Fixes: QTBUG-121528
Change-Id: Ib10ced67a2398108a31c7e95d5e865b7959bed4d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 534e836b69b2f8c5f779b66b05c01bb00b9233f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:07 +00:00
Joerg Bornemann
101846afa9 Doc: Address QT_DEPLOY_LIBEXEC_DIR issues from API review
Task-number: QTBUG-121708
Change-Id: I25a05fc26e9950a8b84770347dbcea1912832990
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b8a78054cf540f082766b1a4d76e42426c1edff9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-02-01 03:24:05 +00:00
Simo Fält
0869134212 COIN: Enable setting Debian target distro with env variable
Change-Id: I8cc0e9127ee7dd1e810812688ad32e759510cbe9
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit d4568bcfdbf17866436eae8d96ceb7ae035ecf5d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:58 +00:00
Ghenady Kuznetsov
3154bf2a7b Fusion style: add indent to groupbox title
Add indent to the title if groupbox alignment is set to Qt::AlignLeft |
Qt::AlignVCenter.

Fixes: QTBUG-121049
Pick-to: 6.6
Change-Id: I25e2fe4e73b920baf4c678b6b0e758d1da7cf632
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 4725bbb3ee41ced9f97d42d73505b2513ff9c576)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:57 +00:00
Marc Mutz
1c1ce73699 Bootstrap: remove QBitArray
It appears to be used only in qlalr, which is, however, not
bootstrapped.

Pick-to: 6.6 6.5 6.2
Change-Id: Idc16d957bf687238c7b0ee603d8b092e2048ef18
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e57f7b1b01b9b34a51a4ee3f898ef7f1fb013f17)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:57 +00:00
Aleix Pol
9483d87ef3 QOpenGLFramebufferObject: Avoid illegal call to glTexImage2D
According to the documentation:
GL_INVALID_OPERATION is generated if the combination of internalFormat, format and type is not one of those in the tables above.
https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml

We were allowing the RGB values be passed as RGBA, after this change we
don't do so anymore.
This would result for KWin in:
Mesa: User error: GL_INVALID_OPERATION in glTexImage2D(format = GL_RGBA, type = GL_UNSIGNED_BYTE, internalformat = GL_RGB8)

Pick-to: 6.6 6.5
Change-Id: Ifde8a570eff01be573f780655d8cedbb96f5ba2b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit ba9e57d65f15c935632b0ad22db0bead9a7d5f90)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:57 +00:00
Ievgenii Meshcheriakov
e42e26d689 Update Unicode data version string
This amends c4e550703c2bdc1ee710507b8df9c0c9a118402e. The data version
update was just forgotten when updating to Unicode 15.0.

Pick-to: 6.6 6.5
Change-Id: Ibb3e9cb81e9bbcb5d4aaf4e4df6231485531c128
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 1e7f1e5b73b931931178bc884d3469439adf8c5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:57 +00:00
Alexandru Croitor
6aed870919 Revert "CMake: Fix *-metatypes.json creation for non-Ninja generators"
This reverts commit ab6950acab5f799e5b3f097a87300e7c1dd1cf04.

Reason for revert: It breaks test_qml_app_deployment test in qtdeclarative for iOS and Xcode

Pick-to: 6.5 6.6 dev
Fixes: QTBUG-121729
Task-number: QTBUG-120317
Change-Id: I356882a97f63534aa17133a4fbbb1db90295dfba
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2024-01-31 11:36:57 +00:00
Juha Vuolle
4518717dec Take QJsonDocument as a parameter
Instead of separate QJsonObject and QJsonArray types.

Resulted from API-review

Change-Id: I977d692d3709a8c3aa872683ddda54a143c25e67
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 26993046283605a806f34ba604e7dcef20f34ba5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:56 +00:00
Juha Vuolle
7f50c19152 Rename QRestReply data accessors as read* functions
This naming should make it clearer that (successful) calls to
readJson(), readBody(), and readText() consume the data received
so far.

Resulted from API-review

Change-Id: I09ca9eac598f8fc83eecb72c22431ac35b966bf5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit bd78ff024599d33cfcb411ff17727a0f4447bc7e)
2024-01-31 13:36:56 +02:00
Łukasz Matysiak
94d61feb83 Skip compilation of tst_QLocalSocket::verifyListenWithDescriptor on VxWorks
This test uses socketpair which is not available on vxworks, so it fails
to compile.

Task-number: QTBUG-115777
Change-Id: I46f3b4ebd937dc4ca2511381dd58451434e6a2fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4b4a6f6d8e3111f0d9e78285e5951bd89ae37812)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:56 +00:00
Akira TAGOH
1b90474986 Support the named instances of Variable Fonts
In the fontconfig, the fonts will be populated with the variable font
and the named instance from the variable font. In this patch, it will
skip the variable font, and populate the named instances from the variable font.
The FcFontMatch function ignores the FC_INDEX when match the font,
changed the code to match the FC_INDEX by iterate the font list.

[ChangeLog][Fonts] Added support for the named instances from the variable fonts.

Fixes: QTBUG-111994
Fixes: QTBUG-112136
Co-authored-by: Peng Wu <alexepico@gmail.com>
Change-Id: Ic598d69a1e76109958fafa1226ea927656092319
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 185add27b2f7a4aa477e7988260bfaccb930f95c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 11:36:56 +00:00
Marc Mutz
3b8de80dfe QJsonArray: symmetrize QDataStream op>>/<<
In operator<<(), stream the QJsonDocument directly, instead of
toJson(Compact).

This is how QJsonDocument operator<<() also does things, but that
knowledge should be need-to-know, and QJsonArray doesn't, seeing as
operator>>() just streams a QJsonDocument, and then calls toArray().

Pick-to: 6.6 6.5
Change-Id: Ia378bf0fb04ce33e3af24a2ce67778e89c41e31a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 264d54953e8b53f2454fbf8361b851923b8115a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 06:51:41 +00:00
Marc Mutz
1dfbb919db Http2: don't barf on > 4GiB cumulative headers
The only user of the vector passes begin()/end() to BitIStream, which
appears to be 64-bit-clean.

Change-Id: I4ad0b9e9547008fecc4c816cc92ff9db4b2066e3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 297341396203c5afed6420fa3789485c0996f846)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-31 06:51:35 +00:00
Tinja Paavoseppä
7aaa351742 Android: Add classes to embed QML into native Android
Add classes that make it possible to add QML as a View into
a native Android app:

QtView: Base class for QtQuickView, handles non-Quick dependent
operations. In essence a Java ViewGroup class which loads a
QWindow and embeds it into itself.

QtEmbeddedLoader: Extends QtLoader for embedded case, creates the
embedded version of QtActivityDelegate and provides an embedded-specific
path to loading Qt libraries (Mostly just allows users to set the name
of the main lib)

QtAndroidWindowEmbedding namespace: Deals with calls from
QtEmbeddedDelegate to create/destroy QWindow and from QtView to
show the window.

Take the QtEmbeddedDelegate introduced in an earlier commit
into use, and add functionality for loading QWindows for
QtViews and managing QtViews into it.

Add a factory for creating instances of QtEmbeddedDelegate.
The factory holds a map of QtEmbeddedDelegate objects and
creates them, with the Activity as the key. This is to make
it so that the same delegate can be used by multiple views
which share the same Context.

Known issues left:
* keyboard focus not working, as with other child windows

Task-number: QTBUG-118872
Change-Id: I94a5f9b4f904c05cc6368cf20f273fcf10d31f17
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 702c420f51d9d56ca056315387f224ec2dba3ff3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 22:07:35 +00:00
Thiago Macieira
3ad47fadb9 tst_QHostInfo: remove QProcess dependency
Our ideal scenario was to run python to run its getnameinfo()... so just
use getnameinfo() directly. This also avoids the problem of Python not
being present and our falling back to nslookup.

Change-Id: I5dd50a1a7ca5424d9e7afffd17adfc830386306f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 7b981a4f1a60d8bda22f7f1d21cb2c72ec843ea0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 22:07:31 +00:00
Thiago Macieira
672c1f87b0 tst_QHostInfo: reorganize the #includes
Change-Id: I5dd50a1a7ca5424d9e7afffd17adfb5d0bb9a54c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 133c91865067a390d05376fc4073556d3fd3a083)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 22:07:31 +00:00
Ahmad Samir
e8f42cf3ec QFileSystemModel: blacklist a flaky unittest on macos
Task-number: QTBUG-74471
Pick-to: 6.6 6.5
Change-Id: I4cda7794300c1a9d941e1543ee66b37efb0dea15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 23d2aaa4f8aefdc395d18162c28493e520e209fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 22:07:31 +00:00
Marc Mutz
3d182679b4 QBitArray: avoid overflow in size-to-storage calculations
Unlike other containers, a QBitArray's size() is not limited by
storage, but, esp. on 32-bit platforms, its size_type: A INT_MAX
size() QBitArray only requires 256MiB of storage.

So we can't rely on "won't happen in practice" here and need to avoid
the potential UB (signed overflow) in the (size + 7) / 8
logical-to-storage-size calculation by using unsigned arithmetic.

Use the opportunity to Extract Methods storage_size() and
allocation_size(), which differ by one (d[[0] contains the size() mod
8), making it clear what's what.

[ChangeLog][QtCore][QBitArray] Fixed a bug with QBitArrays whose
size() came within 7 of the size_type's maximum.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I5d94bae9c9c210ba1e36f8cf03609125c81bd15d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit c6aa399d062c8b31c2ab88acf564a24cdff7b3c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 22:07:31 +00:00
Noah Davis
327dcc078d QPainterPath: Fix boundingRect and controlPointRect ignoring start point
The boundingRect and controlPointRect did not use the start point from
the `QPainterPath(const QPointF &startPoint)` constructor until the
`dirtyBounds` or `dirtyControlBounds` member variables were set to true.
Those two are false on construction. This bug was fixed by adding a new
constructor for QPainterPathPrivate that initializes the `elements`,
`bounds` and `controlBounds` member variables with the start point from
the constructor.

There is also an autotest to verify that the top left of the
boundingRect and controlPointRect are at the same position as
elementAt(0) when the start point constructor is used.

[ChangeLog][QtGui][QPainterPath] boundingRect() and controlPointRect()
now use the start point from QPainterPath(const QPointF &startPoint).

Pick-to: 6.6 6.5
Change-Id: I7bf30364406c14ed60f75d24b78a9a5535f75d93
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit a4f44e06988e91c21c85e0e9f29d656d61f9c68e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 22:07:30 +00:00
Tinja Paavoseppä
4f6cbed4db Android: Create QtWindow layout and set parent in the calling thread
In the QtWindow constructor, creation of the layout and setting
the parent window were posted on the Android UI thread, leading
to them being called at a later point. If QAndroidPlatformWindow
did not have a parent at the point it was created in, but
setParent() was called shortly after, the QtWindow.setParent()
call with the actual intended parent got invoked before the
Runnable posted in the constructor got ran, leading to the
parent being overwritten with the null one passed to the
constructor, essentially leaving the QtWindow as a top level
one, while the QAndroidPlatformWindow was a child window.

The above would happen more often with foreign child windows,
sometimes causing hang ups when the parent of the foreign
child window was shown.

Creating the QtLayout outside of the Android UI thread seems
to be safe, as long as we only modify its view hierarchy inside
it.

Task-number: QTBUG-116187
Change-Id: If1ed1983f5d6ba56e625148ee6a61771234a2aa1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 8df46c8890a843a651c86d198540d6318dbaa9a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 18:52:30 +00:00
Ahmad Samir
a114fd524e QMetaObject: revert adding QMetaObject::indexOfEnumerator(QBAV)
This partially reverts 4ecbe42ff44ace881ed4962744e9cd6c8fa65dab .

The discussion is still ongoing to decide whether the new overload
should take a QBAV or QAnySV. See
https://codereview.qt-project.org/c/qt/qtbase/+/514588 for the details.
For the time being remove the new overload from the API so that this can
be backported to 6.7 (while keeping both dev and 6.7 in sync to ease
future backports).

Change-Id: I4a279653d1941faeafd95dde7a8c741009c00c72
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b3441b4127813148a701b7d538453bfdbe2315a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 18:52:30 +00:00
Juha Vuolle
4eba2323f9 Change QNetworkRequest/Reply rawHeader functions to take QASV
QHttpHeaders uses QASV for the header name field, and this aligns
these functions with that. Furthermore having QASV as a parameter
will allow a wider range of string types to be passed as a
parameter (convenience).

Resulted from API-review

Amends: 56bb4ac484adb544925b6d7b58e4fd1d77d49503

Change-Id: Iff42b75393b6470a2c34a1913dbe615bf21238db
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 8feb41e4462c9879a831d1c753d4200c3287e557)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 18:52:30 +00:00
Thiago Macieira
34d1d7a858 QT_C_STYLE_CAST: move the parentheses to the macro, in C mode
Amends 104a0a9ecdb18d65e4d9075d87e8860c6c9d8335.

Right now it's no problem for the only two places we use it, but it
could be a problem if someone accidentally forgot when using the macro.

Pick-to: 6.6
Change-Id: I5dd50a1a7ca5424d9e7afffd17ae0a09dc7dd8c1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit c1266c36353629e2253aa897dfc96d4fbbc8c5a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 18:52:30 +00:00
Axel Spoerl
f477c78577 QDialogButtonBox: Fix focus chain and default button assignment
QDialogButtonBox::layoutButtons() rebuilds the focus chain based on the
button layout. It relied on the fact that the last button in the layout
would point back to the first button. That is not the case, if
- a focus frame gets inserted in the chain, and
- the default button is not at the layout's first (=left) position.
In that case, the chain stops at the button left of the default button.
The default button can not be reached by tabbing forward. Back-tabbing
still worked.

By not "closing" the focus chain, the focus proxy was set to the first
button found in the layout. That is wrong, whenever the default button
is not at the first layout position. When the box got focus for the
first time, pressing "Enter" could lead to a non-default button being
triggered. A Yes/No message box would have No as its default button.
On Linux, it would pop up with "No" being highlighted, but "Yes" having
focus. Pressing Enter would trigger Yes, instead of No.

tst_QMessageBox::staticSourceCompat() heuristically defines the
button expected to be triggered by Enter. On Linux/KDE, it would pass,
when the wrong button was fired.

=> Always "close" the focus chain, by linking the last and first
buttons.
=> Make the default button the button box's focus proxy.
=> Change tst_QMessageBox::staticSourceCompat() to always expect No
being fired by Enter in a Yes/No box.

[ChangeLog][QtWidgets][QDialogButtonBox] Default button becomes
focus proxy of a QDialogButtonBox. This ensures that Enter triggers
the default button, instead of the first button in the layout.

Fixes: QTBUG-118489
Change-Id: Ic626d3d0fe7ba8b924c21734332e98532f11c80e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d4f38a363251fcb5cdfb24d7a1aceb7b630f7e8f)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-01-30 15:11:17 +00:00
Axel Spoerl
a8d20fe2db Pass correct default button in QMessageBox::showNewMessageBox()
showNewMessageBox() shows an "old" message box, if a default button
argument was passed and the buttons argument doesn't contain a default
button. It passed the int value of defaultButton to showOldMessageBox,
where it was interpreted as a normal button.

The StandardButton::Default flag was not set on the default button.
This relied on the QDialogButtonBox owned by QMessageBox to show the
expected default button by co-incidence. As this was not always the
case, tst_QMessageBox::staticSourceCompat() even tested wrong expected
results.

=> Add the Default flag to the default button, before passing it as an
int value.
=> As a drive-by,
- replace c-style casting with static casting.
- add braces to multi-line if clause.

Task-number: QTBUG-118489
Pick-to: 6.6 6.5
Change-Id: I9cf93c8f93d6ab80e7be5ab25e56bc59d3d6209c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d71b73c145a35a84547918abe4b0916a7ced6a1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 16:11:12 +01:00
Juha Vuolle
0ea24c99eb Update QRestAccessManager documentation
To accommodate the deduplication and non-owning changes
in previous commit.

Resulted from API-review

Change-Id: I61eb071503d6714c7fd42b3fe533698a8dcd2e27
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
(cherry picked from commit 26d1e0e83e8467b292fd0abb0a563bb914b9b609)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 10:17:50 +00:00
Juha Vuolle
7fd767478a Update QRestReply documentation
To accommodate the deduplication and non-owning changes
in previous commit.

Resulted from API-review

Change-Id: Ie1c4e9959c1ba7e8ed2be6607d9f6497ae15af39
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit efa178d42c5e9e8c6dc526430f201f16a67149c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 10:17:41 +00:00
Juha Vuolle
afc1f2a6cc Make QRest* APIs non-owning and non-duplicating
Note: documentation will be updated in a follow-up commit

This commit makes QRestReply and QRestAccessManager
classes lighter, non-owning wrappers. Furthermore their
APIs don't duplicate the wrapped QNetwork* APIs.

This makes it easier to use / opt-in to these helpers
in pre-existing applications which are based on
QNetworkAccessManager and QNetworkReply.

Since APIs are no longer duplicated, the QRest
classes are more obviously a convenience _wrapper_,
as opposed to being an alternative vertical stack.

In practice this change consists of:
- QRestAM never instantiates QNetworkAccessManager,
  but accepts it via constructor. It does not take
  ownership of the QNetworkAccessManager.
- QRestReply accepts QNetworkReply via constructor. It
  does not take ownership of the QNetworkReply
- Signals and most duplicated functions are removed
  from both QRestAM and QRR.
- QRestReply is no longer a QObject
- Since QRestAM doesn't have much to report anymore,
  the debug operator is dropped.

Resulted from API-review

Change-Id: Ib62d9cc2df41cac631396a84bb7ec4d2d54b0c8c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9ba5c7ff6aa42c5701cf950d2137467a2d178833)
2024-01-30 12:17:31 +02:00
Marc Mutz
a57f89251c QGlobalStatic: fix atomics in ~Holder
Back when we set the guard and _then_ destroyed the object, the
atomic_thread_fence was correctly placed between the guard setting and
the dtor invocation.

We know nothing about the payload type. For all we know it could be
some fancy lockless data structure. So in general we need the acquire
fence to synchronize the reads done by the dtor with stores performed
to the object in other threads. The acquire fence did that for us.

But when we reversed the two operations, the fence has moved to after
the dtor call, leaving the dtor unprotected. Move it back to before
the dtor call.

That leaves the store to the guard unordered w.r.t. the execution of
the destructor. To fix, make it a store-release instead.

Amends e3e2674100b1ecbad7117f15c7aa13a704a7d34e.

Pick-to: 6.6 6.5
Change-Id: Ic7adbe17c8b474e82af4e84950c0109984b495d1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b6537a9513d274866da2f46827f54e6004196097)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-30 10:07:04 +00:00
Eskil Abrahamsen Blomfeldt
3576e60992 Fix infinite loop in QTextLayout with setNumColumns()
If the line width is negative, then we might exit the layout
loop before consuming any text, and thus the loop will never
finish. This is a side effect of a change for maximumWidth:
991c056438b311566bc4ea543af0f33dfd5dffbb.

49a63d375972079ae3000c8b7d512d58d4de32bb fixed this issue for
QTextLayout::setFixedSize(), but I forgot to do the same in
the overload of QTextLayout::setNumColumns() which includes
an alignment width and therefore sets the line width in addition
to the column count.

Basically, we just make sure the line width is never negative so
that the width > line.width condition also means the width > 0.

Pick-to: 6.6 6.5
Fixes: QTBUG-115459
Change-Id: If904bfc64cd74e819a0864db55fa9555073d0781
Reviewed-by: Vladimir Belyavsky <belyavskyv@gmail.com>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit be6c651be4ccfa4f70009bcbb51bef39638e0fba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:56 +00:00
Juha Vuolle
9f6e20a5fd Move WellKnownHeaders code to top
Small rearrangement to make diff on later variant/union commit
more readable

Task-number: QTBUG-119002
Change-Id: I3f6120b5dcd324b6493072d2eb58209866fb7dc6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f757662486f2b44cc7cab702c7e89edbc594f4ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:56 +00:00
Shawn Rutledge
f643656e88 Clarify that the textmarkdownwriter feature includes GitHub features
Markdown support in Qt has always been symmetrically including all the
features to the best of our ability: we can write all the same features
as we can read (including github extensions like tables and checkboxes),
except that we standardize the output (so it's not always identical to
what was read: headings always have hashes, not setext-style; code
fences and thematic breaks are regenerated, so we don't keep the same
style as the original; and so on), and we probably still have a few
bugs. And in fact QTextMarkdownWriter does not (yet) have logic to
restrict itself to CommonMark, even if it's requested by means of the
QTextDocument::MarkdownFeatures ctor argument. (Of course if
QTextMarkdownImporter reads a document with CommonMark-only restriction
applied, and then you rewrite the document with QTextMarkdownWriter,
presumably you would not have any GitHub features in the output.)
So the existing output from configure -list-features was misleading:

texthtmlparser ........... Kernel: Provides a parser for HTML.
textmarkdownreader ....... Kernel: Provides a Markdown (CommonMark and GitHub) reader
textmarkdownwriter ....... Kernel: Provides a Markdown (CommonMark) writer
textodfwriter ............ Kernel: Provides an ODF writer.

Amends e4079eca49adce16e31dac2a18d49d7a55817891

Change-Id: Ic2d9664388bbf17cef41ca0eaad600485a1bb7ec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3bcfd55cb3bc45c92345cc69b361030534ddb140)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:56 +00:00
Volker Hilsheimer
0dbe271b9c QJniArray: make reverse-iterable
Add rbeing/rend overload, relevant typedefs, and decrement operators.
As a drive-by, add noexcept to begin/end functions.

Found during header review.

Task-number: QTBUG-119952
Change-Id: I32d9a7d50a1f03550944c2247516c455d4822fe7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit cc5251ed59ea6ecf0cc666ae5321be6de5383e90)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:56 +00:00
Volker Hilsheimer
7ff956c426 QJniArray: add missing post-increment operator
Augment test case. Found during header review.

Task-number: QTBUG-119952
Change-Id: I326395397167edb05ff1f45f7151614c02b7e7eb
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e5074cd3540e165f771aa5bfea36d09553eadc77)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:55 +00:00
Volker Hilsheimer
ee895907f8 QJniArray: assert that source container is not too large
Java still only can handle arrays of at most 2^31 entries, and the JNI
API for working with arrays is using types that are essentially int.
Assert that the container passed in is not larger than that.

Found during API review.

Task-number: QTBUG-119952
Change-Id: Ia0cbdbf098cf5b2c8ec50f0dd24dadf833bf40d0
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 23fb1c50eecaed2f5a3ebfe95e72892c054e4414)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:55 +00:00
Volker Hilsheimer
7f9e5ccd55 QJniArray: don't subclass QJniObject
QJniObject is not prepared for being subclassed (no virtual destructor),
and doing so is formally UB.

Instead of making QJniArray(Base) a QJniObject subclass, give it a
QJniObject member and make it convertible to/from QJniObject. Existing
code still works with this change, even though it removes all the
inherited QJniObject APIs for accessing fields and methods. However, as
the Java array classes have a very narrow and well-defined API anyway we
could, if needed, add those as C++ member functions instead of going
through calling-by-string.

Found during API review.

Task-number: QTBUG-119952
Change-Id: Ic4437116eed5e15226449bdabe48ab657cb14dc3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 101ab278913e3bacc7c0596ae0a5bf3c0fa2f922)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:55 +00:00
Volker Hilsheimer
0604ce57ea QJniObject: fix signature of LocalFrame::newLocalRef
The implementation calls a const member function on the QJniObject
passed in, and no move happens. And the parameter is not a universal
reference either.

Found during header review.

Task-number: QTBUG-119952
Change-Id: I9479df798178b089277aa230f50f4e73f38ceb2c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit a6151e2d35b67e628eb1a6932bec39e100a2d692)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:55 +00:00
Volker Hilsheimer
2cb6d38089 QJniArray: add missing typedefs
Add missing nested typedefs for both the QJniArray container and
the QJniArrayIterator. Expand test case to make sure that some standard
algorithms (such as std::distance and ranged for) work with those
types.

Found during header review.

Task-number: QTBUG-119952
Change-Id: I96f348215c6f1e0e1ce777d9bdd2f172d7e52974
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 8f04615bcddbe4d8d00f2f7e977e13f93f90fddb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:55 +00:00
Mårten Nordheim
036e9811d2 Update public suffix list
Version 883ced078a83f9d79a98933145425c221a5e51f0, fetched on
2024-01-25.

[ChangeLog][Third-Party Code] Updated the public suffix list to upstream
SHA 883ced078a83f9d79a98933145425c221a5e51f0.

Pick-to: 6.6 6.5 6.2 5.15
Task-number: QTBUG-121325
Change-Id: I95e82b5c351218c1641e11e7a166ae21be2c5ad6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit a17c10a63b3a86c71ebe6df54e56c9bce3ed5f18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:55 +00:00
Mårten Nordheim
a9da350b1c PSL: add changelog entry to the suggested commit message
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I468ff1a4e9397259eda2d98f8b5bfcf7e892f10a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 0db7d7e54c2399739d1e44a88a5d21997bade08b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:54 +00:00
Ivan Solovev
91fa0d97fc QDate(Time)?::fromString(): do not use QCalendar as a default argument
QCalendar is not a trivial type, so using it as a default argument in
various fromString() overloads introduces an extra overhead.

In this case the function actually always needs a QCalendar object,
and a default-constructed QCalendar reproduces a valid gregorian
calendar. But getting rid of a default argument still gives us the
benefit of constructing the object only in the library, not at every
call site.
So, split each overload into two - with and without a QCalendar
argument.

Amends 41f84f3ddb780ec751e3fc706dd242fc4a99de7a

Found in 6.7 API review

Change-Id: I7329276cbda0e5471dc5348af92fc8c9ca4e0738
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 59db912e860ddd045ea779fa579f2915535d0cf7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 17:24:54 +00:00
Marc Mutz
9d9b912ade QBitArray: correct inline keyword
The mutable operator[] method was marked as inline only at the
definition, not the declaration. This is known to cause compilation
failures on MinGW when the function is used in other inline
implementation (cf. e.g. QTBUG-56459). It's not, atm, but fix the
issue proactively.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: If805122d9f8dbd72641173509c4b860c20fc1cdc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 7310d2bd5562d1a88b69a544ab9b88c13cc3f978)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 14:05:22 +00:00
Alexandru Croitor
22ffc088e8 CMake: Simplify default CMAKE_BUILD_TYPE logic
Previously we had four-ish locations where the CMAKE_BUILD_TYPE was
force set.
Twice in QtBuildInternalsExtra.cmake via
qt_internal_force_set_cmake_build_type_conditionally(), depending on
some conditions. This was executed right at
 find_package(Qt6 COMPONENTS BuildInternals)
time.

And twice in qt_internal_set_default_build_type() via
qt_build_repo_begin() / qt_prepare_standalone_project() that goes
through QtSetup.cmake. This was executed only if the relevant functions
were called, rather than directly at find_package() time.

The exact logic of which build type ended up being set was very
confusing.

Refactor the code to decide the build type in one single location
when qt_build_repo_begin() / qt_prepare_standalone_project() are
called, rather than directly at find_package() time.

The actual logic when we override the build type depends on many
factors:
- when an explicit CMAKE_BUILD_TYPE is given, honor it, unless it's
  a multi-config build
- when it's a multi-config build, don't set any CMAKE_BUILD_TYPE,
  use the value of CMAKE_CONFIGURATION_TYPES
- when it's a qtbase build, compute a default unless an explicit value
  was given
  - the default is Debug if FEATURE_developer_build is ON
  - otherwise the default is Release
- when it's a top-level build, only choose a build type for qtbase
- when it's another repo build, use the original build type unless
  another was given explicitly (including in a top-level build)
- when it's a standalone tests build
   - if qt is multi-config, the tests will be single config, due to
     various CI failure reasons, this hasn't changed
   - if qt is single config, use the original unless an explicit
     value was given
- when it's a single standalone test build, use the original unless
  an explicit value was given

To determine when an explicit CMAKE_BUILD_TYPE was given in contrast
to when it was default initialized, we now have one single function
that uses a few heuristics.
The heuristics are needed because we can't reliably determine an
explicitly given 'Debug' build on Windows, because CMake default
initializes to that.

The heuristics include:
- checking whether CMAKE_BUILD_TYPE_INIT is different from
  CMAKE_BUILD_TYPE
- checking what the CMAKE_BUILD_TYPE was before the first project()
  call when CMake default initializes
  - we save the previous value in the qt.toolchain.cmake file
  - also in QtAutoDetect during qtbase configuration
  - also when building the sqldrivers project
- honoring the value of QT_NO_FORCE_SET_CMAKE_BUILD_TYPE

As a result of the above changes, the build type will be set exactly
zero or one times, for a particular build directory.

Note that the configure script also has some logic on which
CMAKE_BUILD_TYPE / CMAKE_CONFIGURATION_TYPES to pass to CMake
depending on whether -debug / -release / -debug-and-release /
-force-debug-info were passed. But once the values are passed,
CMake will honor them.

Amends 48841c34d2e86a741ec9992b9704c0fa5973503c
Amends 8c912cddebe544010e7da3f87af5b21f3328d7ec

Task-number: QTBUG-114958
Task-number: QTBUG-120436
Change-Id: I30db14d1e8e9ff9bd2d7ea1d2256cdeb9493ca0d
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 49902cc6ce228c9365c54b0dbe777ae63720310c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 14:05:22 +00:00
Juha Vuolle
384e56e764 Remove unused include from qrestaccessmanager
A leftover, the class used to have some SSL functionality.

Change-Id: Ie987fe086b3e7e5583a9e69dd80e670b131d2832
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 1ea51e1f2dfedbea306a16b2a2996ed13c29f7fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 14:05:22 +00:00
Marc Mutz
12fdb3bc1f QTest: hold WatchDog in optional<> instead of QScopedPointer
Means we don't need to allocate it on the heap and optional<> fits the
semantics of an optional object better.

Change-Id: Id02c4847c2357c3033dce94b68787ed37d6ca276
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9a08f2fbc8476111b1d7a42f0b9b9eb4e71deeaa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 14:05:22 +00:00
Marc Mutz
1b559b25a6 QSpan: make adl_begin() etc SFINAE-friendly
The definition of iterator_t, and, therefore, of is_compatible_range
depends on this, otherwise say, 0, is being treated as a valid range
and hits a hard error in adl_begin() when trying to call begin(int&).

TIL: decltype(auto) does _not_ SFINAE.

Fix by calculating the return type manually, re-enabing SFINAE.

Pick-to: 6.6
Change-Id: Icacd70554f4050ecaeb396c9ae60bc4f21a220c9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 94e122c594a3697b98dcc99a9e332b0f5e816d2d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 14:05:22 +00:00
Marc Mutz
346b5931a7 QTest: DRY test function invocation
Wrap the QMetaMethod::invoke() calls in a helper function in
preparation of filtering execeptions as part of QTBUG-66320. Rename
the existing helper function to make the old documentation comment
redundant.

Pick this back to LTS branch in order to avoid needless code
divergence going forward.

Pick-to: 6.6 6.5
Change-Id: I34ae24bf23ea21d7063016257908f925fc087298
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 5e237f1af21af363a395aef09f93115c5882b443)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 14:05:22 +00:00
Marc Mutz
28a88b5986 moc: store the FQN in JSON superClass objects
Tooling can then use this information to find the correct base class,
even absent C++ scoping information.

Pick-to: 6.6 6.5
Task-number: QTBUG-101141
Change-Id: I5350da8d2d9aaf5ec86027357131ebac1eb50372
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 672a824639a927e7e3061e84dfa35e06eb26a7fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 14:05:21 +00:00
Łukasz Matysiak
aca842ceb2 Handle EWOULDBLOCK the same way as EAGAIN when writing to sockets on Unix
On most platforms EWOULDBLOCK is defined to be equal to EAGAIN.
However on some platforms (like VxWorks) it is not the case.
Because of that, error returned from ::write is not handled properly on
such platform.
Since C++ does not allow duplicate switch labels, check if EWOULDBLOCK
and EAGAIN have different values before adding EWOULDBLOCK to the switch
statement.

Task-number: QTBUG-115777
Change-Id: I659cb946f239733f5c57b2000fb4e3d296ed9153
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1d46bb3c920a3e4c9fc4d09f759cd6ffae4080d1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 14:05:21 +00:00
Ivan Solovev
5073c581af tst_manualqdatastream.cpp: update the license
The file was added in fd48ce0b73c74dafd5db27bc1f2752ef665df7ef
by a TQtC employee, so the header should mention The Qt Company Ltd.

Change-Id: Ib191d2d63656c42f783db87de489814d387dfbca
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit beebf6450c3720029ba5038b46c6db883504a142)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 08:52:00 +00:00
Ivan Solovev
06eac4ebc8 tst_manualqdatastream: fix gcc error
GCC has a bug [1] that does not allow to specialize templates
outside of a namespace.
An attempt to build the test results in the following error:

 tst_manualqdatastream.cpp:18:15: error: explicit specialization in
 non-namespace scope ‘class tst_QDataStream’

Fix it by converting the template specializations into simple function
overloads.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85282

Change-Id: I7803cce1687ca8ae992f1a57394346eb6fc90c8b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b9c8c57e3f8f2a07c22059d9c8e7210469198200)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 08:51:57 +00:00
Ivan Solovev
6e58122cca QDataStream: add a new SizeLimitExceeded status code
This status is supposed to be used when the stream tries to read
or write more data than it is supported by the current platform.
For example, reading more than 2 GiB of data on a 32-bit platform will
result into this status, but it will work fine on a 64-bit platform.

This patch uses the new status in read operations.

Amends fd48ce0b73c74dafd5db27bc1f2752ef665df7ef

Found in 6.7 API review

Change-Id: I675b1ee25fafba174ce8f94c3470dbb7893d6d9e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 36cc9fc54a1b581e5fd9377e0ddbcd1670ab447f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-29 08:51:54 +00:00
Ahmad Samir
d1fca6a103 QFileSystemModel: respect dir filters
Given a dir A that has some files and a subdir B, when a model is set to
only show files, setting the root path to A, the filters are initially
respected. Setting the root path to B then back to A, the filters would
be ignored and B would be visible in the model.

Traversing the path elements in node() led to dir B getting added to
the bypassFilters hash table, which made filtersAcceptNode() bypass the
filters.

I couldn't find a commit explaining the logic behind using bypassFilters
(the trail goes cold at the 'Qt 4.5' mega commit). The only clue I found
was the "// always accept drives" comment in the code, which hints at
this being useful only on Windows(?).

Fixes: QTBUG-74471
Pick-to: 6.6 6.5
Change-Id: Icb9055524a28990c591e924634a63e29a49835aa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 83e5d74864a8780445db4b34e406afc53b331039)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-27 04:50:41 +00:00
Shawn Rutledge
cad0204e81 Remove obsolete md4c patch
This was added in 1591a959876bc5a37aacc817e637400c72bf6623 on top of an
older version of md4c, but those casts now exist in upstream code,
which we upgraded to in c29a235833410fde4cb4d502f89129bccd7403f0

Pick-to: 6.6 6.5 6.2
Change-Id: Ia1a939ed69bcd52ac8afd91dbd574767b59032d6
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit bdfe05ecef72a46c7572e37d8506c4256ba83fc9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-27 00:06:51 +00:00
Kai Köhne
73cf291849 Doc: Update Copyright in md4c license text
Amends c29a235833410fde4cb4d502f89129bccd7403f0

[ChangeLog][Third-Party Code] Updated md4c (optional part of
Qt Gui) to version 0.5.1.

Pick-to: 6.6 6.6.2 6.5 6.2
Change-Id: I7c41fc65fbc92670c1fe4bd0b6d2f46674bdb435
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit c92de95bedcd6f3487b254f37270e207ee7b9894)
2024-01-27 00:06:39 +00:00
Joerg Bornemann
ab6950acab CMake: Fix *-metatypes.json creation for non-Ninja generators
This amends commit db9009721a11f482b601a228eb6d0e1658d997b0, which fixed
the *-metatypes.json creation for Makefile generators. User feedback and
the comments in the underlying CMake issue #19005 suggest that all
non-Ninja generators are affected.

Fix this by activating the work-around for all non-Ninja generators.

Pick-to: 6.6 6.5
Fixes: QTBUG-120317
Change-Id: I537ff7be9c658b7053f7f5df6cbced460be43270
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3a4397af2e5076a3425e92d8bbeae37b4267c389)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-26 19:51:16 +00:00
Tomasz Kozłowski
8ec7b80b90 Add required network libs for VxWorks
It is needed for proper inet socket address working
on this platform.

Task-number: QTBUG-115777
Change-Id: Icde7ff7baf257762339f5f72a783c92f6b297a46
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 09a21c73a03dd9a9604e5e8dc69a7f631b8197a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-26 18:48:48 +00:00
Fabian Kosmale
d2f663eebc moc/QMetaProperty: Remove limitation on non-own-class notify signals
The moc generated code does a sanity check that NOTIFY signals actually
exist in the parent class when they cannot be found in the class moc
currently runs on.
The logic there was however too simplistic, and couldn't deal with
signals taking a parameter.
Fix this, and take the opportunity to use a proper static_assert instead
of generating a "normal" compile error.

We do not do any checks for the presence of QPrivateSignal, as the whole
point of QPrivateSignal is that it should be private (and not e.g.
protected).

Moreover, we adjust QMetaProperty::notifySignalIndex to take
single-argument notify methods into consideration as well when
encontering an unresolved notify index.

Fixes: QTBUG-115989
Change-Id: I8a056a15777f3132691e207b4b9ab6c2c9b2126d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit ac001bef798b79f4932d7ca8f4fb812159ba75ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-26 14:49:20 +00:00
Edward Welbourne
6df9074a1a QWinTimeZonePrivate::availableTimeZoneIds(): cache result
This follows up on commit d59e539b3a1252aa22783c4fdf1e22b35e5a4292,
doing the same for one of its callers. The mapping from windows IDs to
IANA ones is hard-coded (using CLDR-generated data), so the
(now unchanging) availableWindowsIds() list shall always map to the
same list of IANA IDs.

Pick-to: 6.6 6.5
Task-number: QTBUG-120682
Change-Id: I4d610c24110064236b375cab04cde90bbe07735f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 83871413636407f196c2ef7ca4e5b0a846c646ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-26 14:49:14 +00:00
Marc Mutz
44b6b3870a QHttpHeaders: make default ctor non-allocating
... by allowing d == nullptr to mean the empty state.

Needed to add a few guards and specialize QESDP::detach() to be able
to detach from nullptr.

This also gets rid of the partially-formed moved-from state. It's now
guaranteed to be empty.

Change-Id: If874d7c69d91eb4babe667ae577f261610d52fd3
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 61130d73d47249fb1106ed86f8da908c96fe11c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-26 14:49:10 +00:00
Eskil Abrahamsen Blomfeldt
55b2011bcd Fix clipped text when combining multiple writing systems
When a QTextLine consists of multiple different scripts and the
fonts had negative bearing, the background for a script item could
overdraw the previous item's text, causing it to look clipped.

This was because the background and text was drawn in a single pass,
and moving the background drawing into its own pre-pass fixes the
issue.

[ChangeLog][QtGui] Fixed an issue where drawing text from different
writing systems in the same line and including a background could
cause parts of the text to be clipped.

Pick-to: 6.6 6.5
Fixes: QTBUG-121040
Change-Id: I3f79e6d33c09a2a92853bc8752dbe11a0bea2dd0
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 8be3c9f4867ce7982387b075739b8f55c5c45753)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-26 14:49:05 +00:00
Eskil Abrahamsen Blomfeldt
5b2f352042 windows: Avoid infinite recursion with certain fonts
Amends 922d195020d54d7e599d135f6a5e0338100e08f1.

Another infinite recursion was found in the case of populating
font families for cases where the typographical name is different
from the populated name.

The specific font triggering this had two "preferred name" entries
in its name data. This was one for Chinese (PRC) and another for
Chinese (Taiwan). Our GDI backend does not do matching based on
locale, but will prefer the English if available, otherwise it
will just pick the first one. The font in question does not have
the English preferred name.

For this particular font, we would select the Chinese (Taiwan)
name as preferred and since it had not been populated, we would
populate this. However, on Chinese (PRC) locale, Windows would
report this according to the Chinese (PRC) name. We would once
again translate this to Chinese (Taiwan) and go into an infinite
recursion populating it.

The quick fix is to mark the preferred family as populated before
entering the recursion, so that we do not re-populate it a second
time later.

Ideally, the font database would match the preferred name based
on locale, but since we are moving away from the GDI font database
and this is already handled better with the DirectWrite database,
just fixing the recursion is sufficient here.

[ChangeLog][Windows] Fixed an issue where an infinite recursion
could occur if the system had a font with multiple preferred names
in non-English languages.

Pick-to: 6.6 6.5 6.2 5.15
Fixes: QTBUG-118238
Change-Id: I6ded369f1c908e51c0ba2ad9127538faf07e192e
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 11344f57235b5c8149d231c1331f86bcff51bd50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-26 14:48:49 +00:00
Volker Hilsheimer
6a295a0e71 Simplify new QIcon ThemeIcon constants and API
Originally we thought that exposing the string literal through the API
would be useful for people that want to know what icon they will get
when using a specific constant. But since the mapping from platform
independent icon name to platform specific icon name is anyway hidden
in the engine implementation, this is no longer useful.

Based on header review comments, simplify this by making the ThemeIcon
list of constants a scoped enum.

If it's really useful for e.g. designers to know which exact icon they
get on a specific platform, then we could, in a future release, add a
static QIcon::themeIconName API that returns the platform specific icon
string for a ThemeIcon constant.

Change-Id: I231eb98fefb4ac82d38209b4e1257bb3caadeb08
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3042d40be79f28eaa1828474bc8109d0dbe152b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-26 14:48:38 +00:00
Marc Mutz
4179204bd7 QHttpHeaders: Self-Encapsulate Field d->headers
Use QHttpHeaders::reserve() and QHttpHeaders::isEmpty() instead of
going directly to d->headers. Will help in enabling a nullptr d.

Change-Id: Id530f8922b17058ec47530523ed43e08927c3ce3
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit f5056a0b53bcc3f095efb5664201e4a0daea9c1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-26 10:38:25 +00:00
Marc Mutz
268d7b202a QHttpHeaders: add a missing detach()
Before calling a mutable member function (in this case,
QList::reserve()) on one of the Private members, we need to ensure
exclusive ownership of our external state, otherwise we have a Data
Race, because QList::reserve() is not thread-safe (only re-entrant).

Change-Id: I1249de9449865cbf6ab519b0d38b3bf4e743f16d
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 119a6b51869b7ffba4fa49bc07e78a243fe4a9ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-26 10:38:21 +00:00
Marc Mutz
d7d9442368 QHttpHeaders: move verify() into public class
Prepares for d == nullptr.

Change-Id: Ie338f1635d64076d2d2b387fe0de8b3b1a8d0386
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 55ee5481bc95bc201c4fd1514481e58186d7ccb5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-26 10:38:15 +00:00
Wladimir Leuschner
f41d03329d QWindows11Style: Disable Animations for inactive QRadioButton
Fixes: QTBUG-120264
Change-Id: I18b55b8e26a132b8e6dca2c669c7cec8c5f82e69
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit f1d690ccff0ea391ba223f5920b51bec7f60724b)
2024-01-26 06:49:42 +00:00
Ahmad Samir
e22bc8fcdc QFileInfo: de-duplicate docs wrt. fetching info of a symlink's target
Not the symlink itself.

Drive-by change: fix a typo, `treats` not `threats` :)

Pick-to: 6.6 6.5
Change-Id: Iac793cf80bdd17e6424e877de780fce0b28236bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 5ae4e1a2936683abd94c4a66d2fcb277d756f866)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-26 03:14:29 +00:00
Orgad Shaneh
ea2f804cf6 Build: Use sh instead of ls for ELF configuration
On RHEL variants, if coreutils-single is installed, ls is a script
that contains:

#!/usr/bin/coreutils --coreutils-prog-shebang=ls

Replace ls with sh, which is supposed to be a binary (or a symlink
to one) everywhere.

Pick-to: 6.6
Change-Id: I2a43ac9e3332a470951bbf3335f2fdf3ae5c698c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1026e2c98c602ec51bcb722a6597bc7a37a4e6ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-26 01:04:43 +00:00
Alexandru Croitor
ea47b017d4 CMake: Warn about unsupported generator for all qt submodules
Previously we only warned about unsupported cmake generators when
configuring qtbase.
Now we do it for other submodules as well.

Pick-to: 6.6 6.5
Task-number: QTBUG-120602
Change-Id: I9d78db546bcf1238604362b248d41d4516b60b2a
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9932f2dd479baefb915ad841c95855d61b764ab6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-25 22:15:15 +00:00
Tor Arne Vestbø
dbda879127 qWaitForWindowFocused: Pass timeout as QDeadlineTimer
We should avoid int-based timeouts nowadays, and prefer std::chrono,
or for timeouts where Forever is a valid state, QDeadlineTimer.

Discovered during API header review.

Change-Id: Ia56a67084c7a2f989951755fed5ffc161ed8f79e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 3f2a9523a442e44ef52ebca30da9b5d3188df6bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-25 22:15:15 +00:00
Marc Mutz
e15dd3f169 QMetaTypeModuleHelper: fix -Wweak-vtable
The only implemented virtual function, convert(), is inline, so the
vtable and type_info for this class were duplicated in QtGui,
QtWidgets, and any other library that may use this.

Fix by exporting the class and de-inlining convert(). The vtable is
now pinned to qmetatype.cpp.

To prevent MSVC from exporting the trivial static helper function and
possibly rendering its constexpr non-functional, make it a template.

We have two macros for this purpose, with different semantics: The
Q_WEAK_OVERLOAD macro is related to overload set management, not to
keeping function out of the ABI, even though it does that, too. And we
have QT_POST_CXX17_API_IN_EXPORTED_CLASS for ABI control, but this
function is not using post-C++17 features, so since both macros need a
comment, and both don't fit 100%, I used the shorter one.

Task-number: QTBUG-45582
Change-Id: I2ce4a7110e09def1a595d717c073df844213611c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8d88f1282bb614ba8fdc0990f733f74639a13cea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-25 22:15:14 +00:00
Volker Hilsheimer
fc636e7d66 QChildWindowEvent: make constructor explicit
Found in header review.

Task-number: QTBUG-119952
Change-Id: If98415f7c5115e8d1875f5f03e399b2919bb250b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fcaf9a476f91dd95252dedd2422091420713a24a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-25 22:15:14 +00:00
Axel Spoerl
9ed3cc0b51 QMessageBox: Move enum static assertions to cpp file
Move static assertions for StandardButton and ButtonRole enums from
header to cpp file.

Use qToUnderlying instead of casting and assert types where possible.

Amends 773f9ab0189bbb439c3066695c947b11a20c484f.

Found in API-Review.

Change-Id: Ia52886e6e33a3b94b327d17d1453e18febe6dd50
Found-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Task-number: QTBUG-119952
Pick-to: 6.6 6.5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4cd2baae9abc07200c70cb007ce12b800a786927)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-25 22:15:14 +00:00
Mårten Nordheim
d5cdfe33a2 Http2: fix 401 authentication required w/o challenge
The code did not handle the path where we didn't have a challenge.
We cannot recover from that so we just have to fail the request.

Amends fe1b668861e8a3ef99e126821fcd3eeaa6044b54

Pick-to: 6.6 6.6.2 6.5 6.2
Fixes: QTBUG-121515
Change-Id: Ie39a92e7439785a09cad28e8f81599a51de5e27f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit ffe0271a21e9574d1c9eab5fb9803573e17e0f22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-25 22:15:14 +00:00
Thiago Macieira
acdaef4ebd QFile::moveToTrash: add documentation about run time and fail conditions
All of the implementations will attempt to perform a filesystem rename,
so the runtime is constant for a single file and possibly for a
directory full of files too.

The macOS and Windows implementations use the OS API so they run with
slightly elevated privileges. That means they don't fail under normal
conditions. The XDG implementation will fail if the file or dir being
trashed resides on a volume which doesn't have an existing trash
location for the current user and one such cannot be created either, or
if the hardlinking/renaming fails (usually with EXDEV).

Pick-to: 6.6
Change-Id: I76ffba14ece04f24b43efffd17abd67e20196f2b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 6d1b4d574021bc2d036e61526b01a2dea5876b5b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-25 22:15:14 +00:00
Ahmad Samir
92fb1f7e76 QFileInfo: de-duplicate docs wrt. QResource paths
Pick-to: 6.6 6.5
Change-Id: I8a99a3aacc68bf43da21e1101c838154d06aef6e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9fc8bd00967ae89c2174d10c2f38d654edc99a1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-25 19:34:51 +00:00
Mårten Nordheim
af9bf8712e Update Zlib to 1.3.1
[ChangeLog][Third-Party Code] zlib was updated to version 1.3.1.

Task-number: QTBUG-121325
Fixes: QTBUG-121444
Pick-to: 6.6 6.6.2 6.5 6.2 5.15
Change-Id: I0a72b7966916ccb825c7a8ae251e09b2914f0cf4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit 1579f19cf71aa220da3e8f7417a22baeb87a0f65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-25 16:12:03 +00:00
Tinja Paavoseppä
82052e5c3a Android: Let QtLoader handle different Contexts when initializing
QtLoader now calls the correct methods when initializing static classes
and retrieving ContextInfo based on the type of the Context (Activity
or Service). This is done to avoid the need for code duplication when
introducing other QtLoader sub classes that deal with the same Context
types, such as the loader for the use case where Qt is used from a
native Android app.
Abstract methods and their implementations in subclasses
aimed at handling this removed as a result.

Change-Id: I6cda8e4733594a6a3963cf0fd8217de2fbd408f8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 24a0d958a72e94c3e39b3a995ca0b2789b942dbe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-25 07:06:16 +00:00
Timur Pocheptsov
1e0a6b3160 QCocoaA(11)y: do not try to access an element if rowIndex == -1
This ends up in out of bounds exception.

Pick-to: 6.6 6.6.2 6.5
Fixes: QTBUG-120469
Fixes: QTBUG-121008
Change-Id: Id895f311bbb59a3734ecadd0d2472a4018332e16
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 75a918d487aabacd2d377e1e79baea7d30deb5ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-25 07:06:16 +00:00
Marc Mutz
463e6698da [docs] QVersionNumber: fix a typo
Use "Constructs" instead of "Construct" in the initializer_list ctor
docs, because it's what all other ctor docs also use.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ie84d208b81a062851d95fb336553e8e7c57d4b73
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 6147b3f5b2da44b26ff736e3ec850f7cd4cd2ccf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-25 07:06:16 +00:00
Volker Hilsheimer
edc4e55545 Revert "macOS: Don't crash when starting a drag with empty mime data"
This reverts commit 09afa7575276d7b500f17671a1ca9ca677767b44.
It broke Qt Designer, which creates QDrag objects without any mime
format. It's likely that user code does the same to support internal
drag'n'drop.

Pick-to: 6.6 6.6.2 6.5
Task-number: QTBUG-119216
Change-Id: I8b74f2d9b89588cd35bca9ca20973810036a2635
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 97bb0ecfe628b5bb78e798563212adf02129c6f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-25 04:33:15 +00:00
Shawn Rutledge
72747668fc Update md4c to 0.5.1
Fixes: QTBUG-121442
Change-Id: Ifa4d6d25a9ea967c520f84397906b0af5cde1722
Pick-to: 6.6 6.6.2 6.5 6.2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit c29a235833410fde4cb4d502f89129bccd7403f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-24 23:48:00 +00:00
Shawn Rutledge
2f5fe6a9a1 Avoid detection of heading in tst_QTextMarkdownImporter::thematicBreaks
In md4c 0.4.8, three or more hyphens immediately after text were seen as
a thematic break:

some text
---

But in 0.5.1 it makes the text into an H2 heading (even though this
style of heading would normally have the text fully "underlined" with
hyphens). The CommonMark spec 0.30 says

  If a line of dashes that meets the above conditions for being a
  thematic break could also be interpreted as the underline of a setext
  heading, the interpretation as a setext heading takes precedence.
  Thus, for example, this is a setext heading, not a paragraph followed
  by a thematic break:

  https://spec.commonmark.org/0.30/#example-59

So the new behavior seems more correct. But rather than testing so
deeply, just disambiguate by adding a newline, since Qt may be expected
to work with various versions of md4c, and such minor behavior
differences are not expected to come up often in practice.

QTextMarkdownWriter already adds a newline when writing such markdown.

Pick-to: 6.6 6.6.2 6.5 6.2
Change-Id: I5a4bf8720d994616274eb8534b4d7085399130fc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 3bd4c1b670b8b973e8a782bcaec7078027f6ea36)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-24 23:47:50 +00:00
Liang Qi
4a530991f5 tests: make tst_QAIV::removeIndexWhileEditing() work on Wayland
This amends 04415264489cd96a4a542a2ae7db1c14558397a5.

Pick-to: 6.6 6.5
Fixes: QTBUG-121498
Change-Id: I7606bbe482edcc7395f0ff5634d374ab4784b19b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 8b234c5f873ea53fe111052816ac03421e5dbd5f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-24 20:35:21 +00:00
Christian Ehrlicher
f14f12c2e1 QObject: Let moveToThread return succcess state
Add bool QObjectPrivate::moveToThread() which returns the success state
of the attempt to move the object to the new thread. For Qt7 the public
signature of QObject::moveToThread() should be changed to directly
return this value.

[ChangeLog][QtCore][QObject] QObject::moveToThread() now returns a
boolean success state.

Change-Id: I8441c8155a76b804b473ab9c45c2be6840ef1677
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e752c77b35185fa51cdc3684329a9733abe2be3b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-24 20:35:20 +00:00
Venugopal Shivashankar
a375e52aa3 CMake: Accept additional arguments for qt_internal_add_docs
The current implementation of the API accepts only two
arguments, {target} and {qdocconf}. It passes a few
environment variables to build targets, providing info.
about the Qt version being used. QT_INSTALL_DOCS is one
of these environment variables, and it is the install
path for all the Qt module/addon documentation sets.
QT_INSTALL_DOCS is also the path where the global QDoc
configuration files are available.

If a project uses the qt_internal_add_docs to create
the build targets for the documentation, and the Qt
version used to configure the project is a pkg installed
using the qt-online-installer, the QT_INSTALL_DOCS path
is always wrong. Such projects should either maintain a
CMake setup for documentation or configure and
build Qt from source with the correct QT_INSTALL_DOCS
path, which is then passed to qdoc.

This change enables passing additional indexdir
and other arguments to QDoc, which is useful. For example,
if QDoc cannot find all the cross-module link targets,
you could either pass extra indexdir argument to resolve
the links or turn off the link errors.

For example, if your qdocconf has the following depends
entry to enble linking to other modules:

    depends += qtcore qtmultimedia

And the documentation for these modules are not part
of the Qt installation used to build the projects, you
could pass additional index dirs to enable cross-module
linking.

    qt_internal_add_docs{target_name qdocconf
                         INDEX_DIRECTORIES /absolute/path/Qt6/Docs /one/more/Qt6/Docs /another/Qt6/Docs)

Change-Id: Ieac271ddf92990d722602487c41af7f18546d096
Done-with: Topi Reinio <topi.reinio@qt.io>
Task-number: QTBUG-121457
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c024af0d12e35891e19752c1f7cd6fb3371d09b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-24 19:01:41 +00:00
Venugopal Shivashankar
b1138180cc CMake: Enable overriding the QT_INSTALL_DOCS environment variable
The QT_INSTALL_DOCS is configured with incorrect path sometimes,
especially while configuring qtbase with QT_HOST_PATH,
which also lets you build documentation for the essential modules
such as QtCore, QtGui, and so on. If the default QT_INSTALL_DOCS
path is wrong, a way to override the path would enable building
documentation for the essential modules without having to build
parts of qtbase.

Change-Id: I686e0bc103f9722aa98f3c02d2a5af9e645cc9d9
Done-with: Topi Reinio <topi.reinio@qt.io>
Task-number: QTBUG-121459
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5f6f4903a63976fce6468098008318ebeca15cb3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-24 19:01:39 +00:00
Volker Hilsheimer
0571bf6d8a Inline one qDrawPlainRoundedRect overload
Don't export both, the one is just calling the other, so make it inline.
Give parameters descriptive names that match the documentation.

Found in header review.

Change-Id: I48b221a4fcc476483fee2842ec0a5cadd628b803
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 703f922b18110ed90018bd05526661937c3067f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-24 18:41:20 +00:00
Volker Hilsheimer
67272100fb QFileDialog::getOpenFileContent: default new parent parameter
Amends 7c5cf8cae054954975a3e262f7fe3cd9897d67f4, which
removed the old function that didn't have any parent parameter
from the API, and added a new one with the parent parameter in
its stead.
However, to make sure that the new function is source compatible
with existing code, the parent parameter must be defaulted to
nullptr (which it already is in the new version of
saveFileContent).

Found during header review.

Change-Id: I3e734905be9788ae1b206c7a65328e604667f5e4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit bed7788402fe0cab9eb36d37e9fff9e65b3fbfe6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-24 18:41:18 +00:00
Joerg Bornemann
799139c519 CMake: Fix *-metatypes.json creation for all makefile generators
When using one of the non-Unix makefile generators ("NMake Makfiles JOM"
or "MinGW Makefiles") then it possible to trigger an error when running
qmltyperegistrar: ..._metatypes.json: illegal value

We create the metatypes JSON file initially empty and then "fill" it
with a custom command. This command is not triggered when using Makefile
generators. See CMake upstream issue #19005.

Our work-around for that issue was only triggered for the generator
"Unix Makefiles". Now, it's triggered for all makefile generators.

Pick-to: 6.5 6.6
Fixes: QTBUG-120317
Task-number: QTBUG-121472
Change-Id: I329cb0d3e9ba0997d618821e7bcbc20284561419
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit db9009721a11f482b601a228eb6d0e1658d997b0)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-01-24 08:27:29 +01:00
Volker Hilsheimer
6f959d4b05 QJniArray: fix const_iterator declaration, make it default-constructible
Iterators are required to be default-constructible and
value-initialized iterators must compare equal.

In a const_iterator, the pointee should be const, not
the iterator itself.

Found during header review.

Task-number: QTBUG-119952
Change-Id: I036c0a62ade8c59dc5d62c0823b375223719af3f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 100071af82963e712cb055e5d98795376d89e65c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-24 03:48:51 +00:00
Marc Mutz
6a5b47ecac QSsl: QMetaObject is defined in qobjectdefs.h
... not in qmetaobject.h.

Don't include more than we need.

Found in API-Review.

Amends b856790d67ad25f5cd8e374cb299a129acbea2ff.

[ChangeLog][QtNetwork] The enums in namespace QSsl are now Q_ENUMs.

Change-Id: I67ec107ce5ab266cfad8a628e7ba3496d2484766
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 93a4478c5f71d7705c2da5957660219508aef769)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 23:17:45 +00:00
Ghenady Kuznetsov
0303852c23 Fusion style: wrongly used PixelMetric enum
Wrongly used QStyle::PM_ExclusiveIndicatorHeight, which is height of a
radio button indicator instead of QStyle::PM_IndicatorHeight, which is
height of a checkbox indicator in pixelMetric() calls for checkbox
subcontrol of groupbox.

Pick-to: 6.6
Change-Id: Ifbf7783fd4494d1e00ee28c27fa5f62b319b8787
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit b820aa7a04be0308b00c32b0e884421fbbb89269)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 23:17:41 +00:00
Thiago Macieira
59b94a3158 QStorageInfo/Linux: use FS_IOC_GETFSLABEL to get the labels
This ioctl was introduced in kernel version 4.18 and before that it was
used for btrfs alone. It is currently (kernel v6.7) supported by:
 * btrfs
 * ext2/ext4
 * f2fs
 * gfs2
 * xfs
See man ioctl_fslabel(2)

This means we won't need to list the /dev/disks/by-label directory if
you only have mounted filesystems like the above or tmpfs (which doesn't
support labels).

On my system, there are still two cases that cause the listing:
 * a mount point not readable by my user, such as /.snapshots and /root
 * a FAT32 filesystem mounted on /boot/efi

Change-Id: I76ffba14ece04f24b43efffd17ab3dced74ffd2c
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 14115da183d2271dbc25446e4f9eda478722eff8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 23:17:36 +00:00
Marc Mutz
a3b4b060cf QHostInfo: fix lookupHost() signature immediately
... and not just for Qt 7.

Found in API-Review.

Amends dd50d58af267bd3b79d1ca31b920d72b925d5a37.

[ChangeLog][QtNetwork][QHostInfo] The lookupHost() static function now
takes const QObject* receivers (was: (non-const) QObject*).

Change-Id: I22b11e06cfba4e96975239cabed8b379cf3f4fa4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 4b3d6be5f5a175a4c66b527eb2df49d62dc30056)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 23:17:36 +00:00
Alexandru Croitor
dcaab5eb8d CMake: Fix unity build for qtgraphs
qtgraphs defines a target in one directory, and then calls
qt_internal_extend_target with NO_UNITY_BUILD_SOURCES in another
subdirectory scope. That in turn calls set_source_files_properties
but only for the latter subdirectory, and not the main target
directory.

Because CMake has per-directory-scope source file properties, the
'no unity sources' option was effectively ignored.

When using CMake 3.18, make sure to specify the TARGET_DIRECTORY
option so that the source file properties are added to the scope of
the defining target.

Pick-to: 6.6 6.5
Change-Id: I4190d4073a2955aa7053b5faaaa57f683bc768a2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 081e50d768114aeeb8f0d284989986d4debc6ec3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 23:17:36 +00:00
Juha Vuolle
3ab3051100 Add the new Android bluetooth permissions to the manual test app
Otherwise the bluetooth permission requests fail on 12+ Android.

Fixes: QTBUG-114941
Pick-to: 6.6 6.5
Change-Id: I545299e38a7b30df840863ac880ad5bdff5fbc5e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 30bacf78f4cd3a33dee13fa2dbdea2e745b11219)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 23:17:36 +00:00
Jonathan Ketchker
51675a881b Fix code style - add missing trailing comma
For better consistency and git changes tracking add trailing comma at
the end of the last value of an enum.
See also code-review at:
https://codereview.qt-project.org
/c/qt/qtbase/+/528392/comment/663ba25a_51ed514b/

Change-Id: Ibcfcfb1ba1a8ba4b59297bf17103181a0ee6eafc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit afa6cbed649add8abcef7f07e97e83b16983ff16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 23:17:36 +00:00
Alexandru Croitor
e07404343d CMake: Fix sqldrivers project to allow building as Debug MSVC config
When the user:
- has a non-developer-build -debug-and-release Qt
- and tries to configure the sqldrivers project with
  -DCMAKE_BUILD_TYPE=Debug
our build system discarded the user request, and defaulted to
'Release'.

That happens because CMake sets CMAKE_BUILD_TYPE_INIT to 'Debug' by
default on Windows-MSVC, and we have no marker to differentiate
that the 'Debug' value was user-specified.

We have such a marker
- via the
  __qt_auto_detect_cmake_build_type_before_project_call variable
  when configuring qtbase / top-level qt
- via the
  __qt_toolchain_cmake_build_type_before_project_call variable when
  configuring via the qt toolchain file (although that doesn't apply
  when configuring a multi-config build for obscure reasons, which
  should be addressed).

A conservative fix is to add a new variable / marker called
__qt_internal_standalone_project_cmake_build_type_before_project_call
which the 'sqldrivers' project will set with the build type that is
detected before the first project() call, and use that to decide
whether to override the build type, similar how we do with toolchain
file variable.

We could reuse one of the previous variables, but I figured it's better
to be explicit with a new one. And hopefully we can clean up the whole
logic in a follow-up commit.

Amends 48841c34d2e86a741ec9992b9704c0fa5973503c
Amends 8c912cddebe544010e7da3f87af5b21f3328d7ec

Pick-to: 6.6 6.5
Fixes: QTBUG-120436
Task-number: QTBUG-114958
Change-Id: I37e3d8041088fe6084a9976ecc80ddd62d73ef81
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 5b5fa7b75a2465e085c7df61c64755bb65b51f1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 23:17:35 +00:00
Alexey Edelev
9ad537254a Cut off the IMPORTED targets from the sync header dependencies
IMPORTED targets obviously have nothing to sync. So we should ignore
them when collecting dependencies for header sync.

Pick-to: 6.6 6.5
Change-Id: Ief68ff5eb2eb13a3fe1608445e8f5e6abb5971b4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 868e91474c085bd3bf8c5635fc069731afc2e44a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 23:17:35 +00:00
Volker Hilsheimer
64a5370817 QJniArray: fix prototype of member functions
Remove the redundant template parameter. As a drive-by, swap
pointer members using qt_ptr_swap instead of std::swap.

Found during header review.

Task-number: QTBUG-119952
Change-Id: Ibed9c7e7866672401b9dd87ff6e33db8f61e7282
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 3fd49e95a9db3f4c6805c7fcf85fbebe1d6463d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 13:07:20 +00:00
Tor Arne Vestbø
4f4ffa8a67 QWidget: Clean up state that depends on QWindow from ~QWidgetWindow()
We were assuming that QWidget was in full control of QWidgetWindow
destruction, via deleteTLSysExtra(), and that we could limit any
cleanups to that function.

But in some situations QWidgetWindow is destructed from other code paths,
in which case we were left with dangling pointers to the QWidgetWindow
in both QTLWExtra, as well as the backingstore.

This can happen if there's a child widget hierarchy where there is not
a 1:1 mapping between QWidgets and QWindows, for example if the window
attribute WA_DontCreateNativeAncestors has been set. In this situation
our normal recursion into children in QWidget::destroy() stops at the
first widget without a window handle. When we then delete the top level
QWindow, the QWindow destructor will delete any child QWindows, which
includes our leaf QWidgetWindow.

We should probably fix up QWidget::destroy to continue looking for
children, even if we don't destroy the current child. But independently
of that we should make sure the QWidgetWindow cleans up when it's being
deleted, regardless of how it ended up there.

There's further room to clean up the deleteTLSysExtra() function and
friends, but that's been left for a later time.

Fixes: QTBUG-120509
Pick-to: 6.6 6.6.2 6.5
Change-Id: Ib691df164d7c9c83cb464c0a6bf3bc2116e8ca43
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 12203e94f5a34b59b6a7389402c854e823135a35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 13:07:20 +00:00
Volker Hilsheimer
cb06477327 QJniArray: add test case for QJniArray::size
Fix build of the test by removing the reference from the
container type before accessing the nested typedef.

Change-Id: Ic35f312bac70b8f8f80149a3432329070c8c8c7d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 2c9525a501a33b880e49b57a7c5fa5f11d70bc0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 13:07:20 +00:00
Joni Poikelin
7878c8b6f3 Fix out of bounds access during QTextDocument cloning
Fixes: QTBUG-120962
Pick-to: 6.6 6.5
Change-Id: Ib2a35acd5a0d673b39556a4aa930e37eb40b39b2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 96f1ef1c1c43a965697022f99105c11613129e3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 13:07:19 +00:00
Marc Mutz
65a1becad2 QTest: Extract Method qCaught() from THROWS_(NO_)EXCEPTION
We've already done a lot in 59600a514ba99ed62b46237d8f160dea84474190,
but we can do more:

Thanks to std::exception_ptr, we can drag the handling of unexpected
exceptions completely to out-of-line code, leaving only the catch(...)
as inline.

As a nice side-effect, we no longer need the nested try blocks in
QVERIFY_THROWS_EXCEPTION to work around GCC -Wexceptions or MSVC C2312
complaining about two handlers for the same exception type (which can
happen when exceptiontype is std::exception itself).

This may not handle __cxxabi::__forced_unwind correctly, but it
doesn't need to: Tests should not need to call THROWS_EXECPTION on
code that could emit a pthread cancellation; tests are controlled
environments.

Keep the old qCaught() function for BC. We don't promise BC in
QtTestLib, but it doesn't cost much.

Change-Id: I1e1627c6341b09197a8a79669fde061c47e6ba47
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit f0dcbb66e8c54d497d5d118a13a7a0b4fc1b3d94)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 13:07:19 +00:00
Thiago Macieira
d51033b374 QProcess: align treatment of early start errors
There are a couple of possible runtime errors that could happen before
the state was changed to QProcess::Starting. This aligns the Unix code
with Windows, which has the state transition at the top, and with the
documentation which says we will enter QProcess::Starting state.

Complements commit 956b2495285251e4840ec32885ffa2cfbb7bd79c, repeating
what it did for Unix (removing the overwriting of the error message that
openChannel() sets) on Windows. We also need to ensure cleanup() is
always called.

Pick-to: 6.6
Change-Id: I76ffba14ece04f24b43efffd17aafdd47f908bf1
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 79e1389fb9ea4e43e61ab35e41ed275cb76eedbc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 09:28:26 +00:00
Mårten Nordheim
068d36dbc1 tst_bench_{qhash,qset}: set deterministic seed
There's a lot of variation in the benchmark graphs for QHash
presumably caused by variation in seed.

Optimally we would set deterministic seed for all
benchmarks, but we don't know whether or not it is
one until the macro is reached.

Pick-to: 6.6 6.5
Change-Id: I4e412e4d4e2cc65eada94ed123243ed0047dd9cf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit aec39bd136defe9e6646b9edfcdd2f02d62471f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-23 09:02:01 +00:00
Thiago Macieira
26f24693cd QStorageInfo/Linux: merge doStat() and initRootPath()
The doStat() function was too simple. Plus, we can now avoid having to
come up with an non-zero-but-unused device ID for some corner cases.

Change-Id: I76ffba14ece04f24b43efffd17ab3a79e54e636d
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 96e5d0d5c19c09a2b0db5bd067deac06232a48ed)
2024-01-22 13:30:27 -08:00
Christian Ehrlicher
b9bcaae226 SQL/MySQL: Fix compilation with MySQL 8.3
With MySQL 8.3 mysql_fetch_field() was removed which was used in
QMYSQLDriver::record(). There is no real replacement function so we
use 'SELECT * from table LIMIT 0' to retrieve the schema information.
Additionally mysql_stmt_bind_param() was deprecated and needs to be
replaced by mysql_stmt_bind_named_param().

[ChangeLog][SQL][MySQL] Fixed compilation with MySQL 8.3.

Pick-to: 6.6 6.5 6.2 5.15
Fixes: QTBUG-121183
Change-Id: I149836bd5674d0784255baf416d437c424992f20
Reviewed-by: silverqx <silver.zachara@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 41c842d3f7eecdf736d26026427033791586c83a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 20:18:10 +00:00
Thiago Macieira
d688eab7da QStorageInfo/Linux: move retrieveVolumeInfo() up because it won't fail
initRootPath() may fail, so let's make sure we do extract some
information from the FS even if that does. Issue introduced by
3e330a79ec8d273630660eefae42995018421c0c ("QStorageInfo/Linux: rewrite
the label retriever to use device IDs")

Task-number: QTBUG-121140
Change-Id: I76ffba14ece04f24b43efffd17ab2df71af8c4e0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 264b7a67330fb1a3fd0f896603e75ada46326875)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 19:40:35 +00:00
Laszlo Agocs
b375dac923 Do more QRhiWidget cleanups based on API review
Change-Id: I339fb2ac2546b9d7b4b88cba89191e7a4311017f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 80e7bcd3688619b7394c9e2ce2cd61c72143f0bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 19:40:32 +00:00
Alexey Edelev
98831dea76 Make the QtNetwork private symbols visible
Export QHttpNetworkConnection and QHttpNetworkReply classes, this is
required to use the freshly introduced QHttp2Stream.

Change-Id: I4920d342af943b393afa78a187b562549fa919e0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0047affafb3d1b6086c0fc59c50ea9f3b46effe7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 19:40:30 +00:00
Tinja Paavoseppä
60c33a2501 Android: Remove parent before adding window to screen
When a window's parent is set to null, remove the corresponding native
view from its previous parent layout before adding it to the layout
for top level windows. If the removal from the previous layout is
done after adding the window to the screen, an exception will be
thrown due to the view already having a parent.

Fixes: QTBUG-121232
Change-Id: I1c065b5158d32150042d25fb64f10cf48f83f9f4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1062373b8e2f8ecf63b7a60a34ca9d0b83466de3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 15:36:18 +00:00
Nicholas Bennett
ebccd49dbb Docs: Review and improve QString documentation
Changed section titles to sentence case.
Added or removed commas as required.
Simplified language were appropriate.
Varied terms to improve engagement.
Corrected resultant text to within the 80 character
width, so there will be whitespace change warnings.

Fixes: QTBUG-119553
Pick-to: 6.6
Change-Id: I5f40605fde4639a6dfcdb3816f32ad7599572fae
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
(cherry picked from commit ef01f32388ad2eb69aa58879b56a7891a492619b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 15:07:58 +00:00
Axel Spoerl
fe2a4baa49 QAppleTestLogger: Add source link to failure messages
The apple test logger did not include the failure location in the log
output, because the assumption was that the structured logging would
report the file and line separately.

Unfortunately we can't do that using the os_log machinery just yet,
so we bring in the manual location printing as in the plain text
logger.

Change-Id: Ief0a6a6e04d628c98ed09c09334b694504cbff2c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 08ddf846aed3a14c485aa1d68bc3157e2420f316)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 14:57:35 +00:00
Topi Reinio
aab6df9541 Doc: Update copyright year to 2024
Update copyright year in documentation template and
copy-notice paragraphs.

Pick-to: 6.6 6.5 6.2
Change-Id: I0ff70bbd5925078e80e6799ac80cfc8e6e68a2a0
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 091096fed7c69b8c61b313dc1b3b6fe40d42e0b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 14:57:35 +00:00
Alexandru Croitor
9348368772 CMake: Fix Threads global promotion issue when using static openssl
and an older CMake 3.22, which is shipped by default on Ubuntu 22.04.

If for some reason there's a static openssl library lying around in
the default sysroot (or any ssl search path), like in
 /usr/lib/libssl.a,
then CMake's _OpenSSL_test_and_find_dependencies
will try to find_package(Threads) because it assumes it has a
dependency on the Threads package.

Because we do qt_find_package(WrapOpenSSLHeaders) in
qtbase/configure.cmake
and we do qt_find_package(Threads) in
src/corelib/CMakeLists.txt,
we would create the Threads target in the root directory scope, and
then try to promote it to global in the corelib subdirectory,
which fails with

CMake Error at qtbase/cmake/QtPublicTargetHelpers.cmake:260
  (set_property):
  Attempt to promote imported target "Threads::Threads" to global scope
  (by setting IMPORTED_GLOBAL) which is not built in this directory.
Call Stack (most recent call first):
  qtbase/cmake/QtFindPackageHelpers.cmake:211
  (__qt_internal_promote_target_to_global)
  qtbase/src/corelib/CMakeLists.txt:4 (qt_find_package)

Newer versions of CMake's FindOpenSSL actually try to determine if
the Threads package is really needed.

To avoid the issue entirely, just look up Threads before we look up
the OpenSSL package.

Pick-to: 6.6 6.5
Change-Id: Ia3cde93e26ba004f64105a5b457098e1b9870885
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 85c462855be95afd2afebd345cb4655c00f9824e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 14:57:34 +00:00
Ivan Solovev
c32b15f119 Make public QLocale's constant for the two-digit-year base
The private QLocale::FirstTwoDigitYear constant, which is used as a
default value for the parameters in some methods, causes troubles for
Qt for Python Team, because they need to use the default values in the
binding code. It also potentially create some inconveniences for the
users who want to write functions wrapping these methods.

The name is also confusing, because, when read out of context, it
implies that there might be SecondTwoDigitYear, etc...
Rename QLocale::FirstTwoDigitYear to QLocale::DefaultTwoDigitBaseYear
and make it public.

Now when the constant is public, we can use it in QDate, instead of
introducing another constant, so do that.
The qdatetime.h header already includes qlocale.h via qcalendar.h,
but, rather than relying on this transitive include, add it
explicitly.

As pointed out by Thiago [1], the static constexpr members of exported
classes need out-of-line definitions, so add such definition to
qlocale.cpp.

Amends 41f84f3ddb780ec751e3fc706dd242fc4a99de7a

Found in 6.7 API review.

[1]: https://lists.qt-project.org/pipermail/development/2024-January/044888.html

Change-Id: Ib3c6f1d5b181968bf311fd0435173e025a369865
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit cde7d5d3ff56fdf219771c65bf93f3f08757f154)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 14:57:34 +00:00
Thorbjørn Lindeijer
4f1752a6b9 Increase precision for QGraphicsView::AnchorUnderMouse
* Use a more precise view center for views with odd width/height
* Use the QPointF version of mapToScene to avoid rounding
* Round instead of truncate when setting scroll bar values

These changes increase the precision of AnchorUnderMouse, which is
important when for example wheel scrolling is used to change the scale
of the view. Without these changes, the view shifts slightly with each
change in the transform.

[ChangeLog][QtWidgets][QGraphicsView] Increase precision for QGraphicsView::AnchorUnderMouse and QGraphicsView::centerOn

Pick-to: 6.6
Task-number: QTBUG-96879
Change-Id: I8199196c671e4aa96732f382e8057468f676b8d7
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit d99b0cfed21e05f6e84b97fe8edb68271a34deb2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 14:57:34 +00:00
Juha Vuolle
3db7bd5d63 Remove QHttpHeaders::names()
We need a way for users to consume the complete contents of
QHttpHeaders.

Until now, the only way was

    for (const auto &name : h.names())
        use(h.value/combinedValue(name));

which is quadratic.

Adding the usual iterators and operator[] would require us to
expose the underlying value_type, which we're not ready to do, yet.

So we added nameAt() and valueAt() functions in previous commits to
enable efficient indexed iteration without the need to expose a
value_type. Having added those, we can now remove names(), which had
the wrong value_type (QByteArrays are by definition UTF-8 in Qt, while
header names are L1), and is no longer needed to facilitate iteration.

In QNetworkRequestFactory, temporarily use toMultiMap() because we
need the combinedValue() of all headers here. The fix will be to make
QNetworkRequest QHttpHeaders-aware, but that's a Qt 6.8 thing, even
though we should still de-pessimize this code for Qt 6.7 with private
API.

Resulted from API-review.

Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit fd6dc2e9e7ce12d73e095a70b3259ea649f4a62d)
Change-Id: I7b52e7df4444487f865ebfb7c9d94227f470829d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-01-22 13:45:24 +02:00
Juha Vuolle
5119d4dab8 Add QHttpHeaders::nameAt() function
We need a way for users to consume the complete contents of
QHttpHeaders.

For now, the only way is

    for (const auto &name : h.names())
        use(h.value/combinedValue(name));

which is quadratic.

Adding the usual iterators and operator[] would require us to
expose the underlying value_type, which we're not ready to do, yet.

So add nameAt() and (in a previous commit) valueAt() functions to
enable efficient indexed iteration without the need to expose a
value_type.

Return by QLatin1StringView, not QAnyStringView, because that
statically encodes the actual encoding used (and required by HTTP
specs and promised by the class documentation, so it won't need to
change). For the setters, we want to be accomodating QString,
QByteArray, etc, which is why those take QAnyStringView.

Resulted from API-review.

Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 196594003742f0bf1c075ed5b2ec93e06f237206)
Change-Id: I0af34c6da06dad1d14b2d25e9230a1c04b4e7c23
2024-01-22 13:45:21 +02:00
Juha Vuolle
6c0d08d16a Add QHttpHeaders::valueAt() function
We need a way for users to consume the complete contents of
QHttpHeaders.

For now, the only way is

    for (const auto &name : h.names())
        use(h.value/combinedValue(name));

which is quadratic.

Adding the usual iterators and operator[] would require us to
expose the underlying value_type, which we're not ready to do, yet.

So add valueAt() and (in a follow-up) nameAt() functions to enable
efficient indexed iteration without the need to expose a value_type.

Resulted from API-review

Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4bb12dab6a13c6deee713a77efa9ce996adc97a9)
Change-Id: I2ee509d89e6f9080c17a4cef947f80f312d75180
2024-01-22 13:45:18 +02:00
Axel Spoerl
9e8761e8e9 QFontEngine: Silence bogus gcc warnings
gcc warns about using uninitialized variables in
QFontEngine::getTrueTypeGlyphIndex. The warning is bogus, because all
variables subject to the warning are initialized by passing their
pointer to qSafeFromBigEndian().

Initialize them anyway to silence the warnings.

Pick-to: 6.6 6.5
Change-Id: I25e062f25e2b06701af5edca27a9e56b939daa79
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit e957ed97e0a7f6974db7d9f7ea52d94785464880)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 11:06:58 +00:00
Ed Cooke
cb6cdad078 QPushButton with a menu remains in sunken state after menu closed
Regression fix, introduced in:
7199498fb9cbfb5afc043ddb0e630c8ffad5240b

QPushButton with a menu will have a sunken state, QStyle::State_Sunken,
when the menu has been closed. Expected behavior is that the sunken
style is to be removed when the menu is closed.

A boolean called "menuOpen" is never set to false after being set to
true in the popupPressed() method. When this boolean is true, a sunken
state is painted.

Fixes: QTBUG-120976
Pick-to: 6.6
Change-Id: I3e721da5dfbb6db200aa2de7366ac5dc73c873e0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 343551ffae66048599e5360085d1b77f64b9336e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:39:48 +00:00
Ahmad Samir
170bf4ae73 QProcess: use enum types in tests instead of plain int
Change-Id: Ibba85d28c2a5329f9224ffdc893f2dab8e672ee9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 17b414f75a7e033e74da01d95b0371a090e357cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:04 +00:00
Thiago Macieira
7d12cf673a QMimeBinaryProvider: move CacheFile up in the file
Amends 329722a322a80d5ea8d6f9aa993c2fc4995b08a4 ("QMimeBinaryProvider:
manage m_cacheFile with a std::unique_ptr"), which added the
std::unique_ptr<CacheFile>.

This is required because in C++23 std::unique_ptr's destructor became
constexpr and is therefore instantiated more eagerly. The type must be
fully defined (not forward-declared) when the std::unique_ptr member is
initialised in the QMimeBinaryProvider constructors.

Fixes: QTBUG-121204
Pick-to: 6.6
Change-Id: I76ffba14ece04f24b43efffd17ab9a861aff89b8
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit c8db469fd584cfd2bee34b572601b19bfb2cd921)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:04 +00:00
Thiago Macieira
f3782300d2 QStorageInfo/Linux: fix getting information on unmounted btrfs subvols
Amends 1cd6c6c69e9813c791f8bebb6c0c9214ce765060.

Btrfs can have subvolumes and each one of them is assigned a device ID
when the filesystem is loaded into the kernel. But subvolumes don't all
have to be a mountpoint of their own: if we insist on matching device
IDs, as initRootPath() was doing, we'd fail at finding the mount point.

Fixes: QTBUG-121140
Change-Id: I76ffba14ece04f24b43efffd17ab39f503000dd7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 987abb92538f8657d861611b1ced4e7eaa660adf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:04 +00:00
Thiago Macieira
90a723b7cd QProcess/Doc: clarify that early crashes happen after started()
This is notable when dynamic linking fails, because that happens before
the first line of main() (or equivalent) of the child process, so even
banners printed by that function may be missing.

Change-Id: I5201966b308e48989c06fffd17aa9837156e23f4
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit 458a9d288a14abed6ee0573e6574a9e99f4f7f58)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Thiago Macieira
078c68462e QProcess/Doc: clarify that started() may be emitted very early
On Windows, process creation is synchronous so we will always emit
either started() or errorOccurred() before QProcess::start() returns.
This condition doesn't currently happen on Unix systems, but we could do
that because we're now using vfork() on most platforms, so the child
process has either successfully execve()d or _exit()ed before
QProcessPrivate::startProcess continued.

Drive-by reorganization of the code to remove the one-line \note in the
middle of the docs.

Pick-to: 6.6 6.5
Fixes: QTBUG-120968
Task-number: QTCREATORBUG-30066
Change-Id: I4d0668e0fae5299551ff91480828a68e62fdacec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 8e1f9169cac78b0df4dab17ed05765fdab842d07)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Tinja Paavoseppä
03ca126bb6 Android: Add a context delegate for embedding QML to native Android
When we are embedding a QML view to a non-Qt Android app, there are a lot
of functionalities that are shared with the refular Qt Android app, but
some are not. We should not, for example, try to control the hosting
Activity.
Create a base class that both the QtActivityDelegate, used for the
standard Qt for Android app, and the delegate for the embedding case
can extend.

In this commit, the QtEmbeddedDelegate is very simple, the
biggest difference to QtActivityDelegate being it does not create
a QtLayout or instantiate a QtAccessibilityDelegate.
It does start the Qt app, without waiting for a layout, and register
to listen for changes in the state of the Qt app.

Taking the embedded delegate into use, loading the embedded QML
views and their handling is added in a follow up commit.

Task-number: QTBUG-118872
Change-Id: Id390a2b35c70b35880523886bf6fcf59d420cb42
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 06d2aa91eb4faafc0e52faafeb184d6d3da671ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Christian Ehrlicher
66b732244a QTextImageHandler: Use QUrl::toLocalFile to convert to local file name
Simply stripping away the first six characters does not work on Windows.

Amends 2d87c4d881b74619fef966ffb0d7a00cb4ccea50

Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-120577
Change-Id: If48ba026785cab784f46109e34ac80e39a990b79
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 52a41bac775bea9057acbc4344a29bb7e63297e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Morten Sørvig
3778e618d6 wasm: finish comment and remove debug output
Change-Id: Iff832637ca600f382e99534c07f7cf35b0b6cdde
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9c03678f5c1cd293eded1c4a2c343190b99d3d6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Tor Arne Vestbø
90aab36604 tst_QWidget: Add test that WA_NativeWindow results in window handle
Change-Id: I63a653a552be2a6435e0c068e47c2442e53642cb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 0c2a16c49c58fca02a4f3df0a31ee915d69065c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Axel Spoerl
16ab2eba72 tst_QMessageBox::staticSourceCompat(): improve diagnostic output
The test function casts QMessageBox::StandardButton variables to
integers, to pass them as arguments and verify expected buttons.
In case of a test failure, this makes it hard to figure out, why a test
was failing.

Add a local macro to cast int values back to the enum before calling
qCompare(). That way the enum keys will be displayed in the logs.

Task-number: QTBUG-118489
Pick-to: 6.6 6.5
Change-Id: I23e766d5026cff3e4775db56e58f808809709e4c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fd710fbba3d24f6192625f586eea57309630f8ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Morten Sørvig
5491198cbd wasm: actually save dropped files to /qt/tmp
We were reporting the correct url, but saving to the
root of the file system.

Change-Id: I3e1fd63efb77dd75ccf7a8f44a3211965fe11be8
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 5b53f9b3f8e5f0b642e9e9c48cd7574f23e77233)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Morten Sørvig
564e1748f2 Compile with getOpenGileContent() API changes
getOpenGileContent() takes a parent now, and the compat
API is behind a QT_WIDGETS_REMOVED_SINCE(6, 7) which
the manual tests can't access.

Change-Id: I81784baed178bb8efd1a848d32c9ee4510971e26
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 63a00ef2c09f11c9aec291cf1ab0f01d13b840bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Morten Sørvig
2a57d5b592 wasm: update manual test to handle dropped files
Verify that the file is saved correctly to the local
file system by loading it and printing the sha1 of
its contents.

Also add indents in order to improve legibility. The
output lines should now be correctly nested.

Change-Id: I698c016253656aef29f04129da5f01a9dc35191e
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit a2294287ad3edd729f165280a71b8dd7a5345b1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Krzysztof Sommerfeld
6a35538d3d Exclude VxWorks from trash bin tests
The XDG trash bin code in 6.7 onwards doesn't compile because VxWorks is missing the POSIX at-file system calls and we're working with WRS to find out more. Currently there is ongoing request to add this and more POSIX system calls.

Task-number: QTBUG-115777
Change-Id: I83fd2ab7130362c06c694195e7b33b6ba8011101
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9735b105588d74c47d4195d367bcac89d3472643)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-22 10:06:03 +00:00
Volker Hilsheimer
1c92de3944 Doc: fix QStandardPaths::displayName qdoc warning on macOS
The function definition at the location of the documentation is not used
on Q_OS_DARWIN, so qdoc cannot tie the documentation to it, leaving
broken links and qdoc warnings when building the documentation on
macOS.

Fix this by explicitly specifying the function that's being documented.

Change-Id: Icf2ad1eba9e9ec8cbeea3818b414f740fa31083f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
(cherry picked from commit f63e5318261de755dfeb3d8faedc52333a37c96d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-20 02:53:31 +00:00
Tor Arne Vestbø
2804455965 tst_QWidget::renderInvisible: Use QImage::Format_ARGB32_Premultiplied
The test renders QCalendarWidget, which ends up in the QStyle code
eventually. On macOS we use a CGContext to draw the native style,
into the test's image/paint device, but CGBitmapContextCreate does
not support QImage::Format_ARGB32. It needs either a premultiplied
alpha, or no alpha at all.

The unification of the palette for the calendar, as is done for
Windows, is also needed on macOS.

Change-Id: I5b26e5434b84e4b14eb8784875b76810e0a14230
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a5292ad2f58252f392ad272f8c99a31c43d175a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-20 02:53:30 +00:00
Mårten Nordheim
590e1c9cdb invokeMethod: std::forward universal-ref argument
Spotted in API review

Change-Id: I4ab660bb9955176f40b4123e775d65c17edbeeb8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 99da7c23c3ef8b2525fc570180da017589e840f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-20 02:07:42 +00:00
Fabian Kosmale
f1bd8bcaba QMetaObjectBuilder: Avoid arithmetic on null pointer
In Prepare mode, "buf" is a null pointer. We never dereference it, but we
still compute an offset from it to obtain a pointer to a (then unused)
QMetaObjectPrivater.
clang's UBSan complains about this, so initialize the pointer to nullptr
instead when in Prepare mode.

Pick-to: 6.6 6.5
Change-Id: Id9d78058f72bb1b44440d07f565374f3eb3c20fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d3d224f546d933acef53f7592fea7d69072f7d55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-20 01:21:19 +00:00
Mårten Nordheim
a338e222cc SignalDumper: protect access to ignoreClasses
It's a shared list that, in theory, can be written to by multiple
threads. Protect it with a mutex.

To make the change in a clean way, move all the .contains() checks
into a separate function so we can simply hold the lock in there.

Pick-to: 6.6 6.5
Change-Id: I99ff185346d52e43a3f59f2910a7b2fa6031e3e4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit c60db318836cf22b0f00b78ea189ba33fcf7b1c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-20 01:21:18 +00:00
Morten Sørvig
d7c17432fe highdpi: Update high-DPI in QWSI::handleScreenLogicalDotsPerInchChange
Update m_active early during DPI change to make scaling
calls made during the DPI change use the new value.

The existing call to updateHighDpiScaling() in QGuiApplicationPrivate::
processScreenLogicalDotsPerInchChange() is supposed to
take care of this, however that call is made after
the geometry change event is crated (with incorrect
geometry)

Change-Id: Ia0f6006c90355ec69ef92b88a020089ab21e072d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 454068232eae457c8f62f94b70e17b0ef8b7a74a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 22:17:24 +00:00
Paul Heimann
93ddf89037 iOS: Avoid category method name clash for UIResponder
As described in Apples documentation, own methods which are added to
existing classes should be prefixed to avoid category method name
clashes. This prefix was missing from the function
currentFirstResponder() which caused issues when closing the virtual
keyboard on some iOS devices.
(see https://developer.apple.com/library/archive/qa/qa1908/_index.html)

Pick-to: 6.6 6.5
Task-number: QTBUG-119601
Change-Id: I82fb8a8beeb0a3234594357f1e1db67b0ae3da36
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e51b2d70de65f2ac674afb9c7da2a10c7067f142)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 22:16:47 +00:00
Volker Hilsheimer
64c906f59e QFont::Tag: optimize toString by not searching for terminating null
The compiler knows how large the array is, so pass the size and drop
the terminating null.

Change-Id: I5795c89834b8395f04d1777d737d080f19be2a21
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
(cherry picked from commit a73f10aee422bbbee22c63ff1c436cb3193938e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 22:16:15 +00:00
Alexey Edelev
f9d97ee04a Force CMake to look for static versions of xcb components
Add the USE_XCB_<component>_STATIC switches that force using the
static versions of xcb components if necessary.

The xcb components needs to be built with -fPIC option, to make the
static linking possible.

When Qt is built staticaly USE_XCB_<component>_STATIC needs to be
passed to the application command line, since in static case xcb
libraries are resolved and linked when configuring application, but
not when building Qt.

Pick-to: 6.6 6.5
Task-number: QTBUG-120769
Change-Id: I274e9cf4a6a111dc87ad84bb7f49cad76a3d364a
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 6ce6ff1c529a7a4a09f211980cc749c2b3aa0dab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 20:45:08 +00:00
Marc Mutz
004ccc54d9 QCalendarBackend: disable copying
Silences clazy-copyable-polymorphic.

The Q_DISABLE_COPY_MOVE() disables the implicit default constructor,
so bring it back with =default.

Amends aa8393c94fea01a4806b204fd3aa343a4e90666b.

Pick-to: 6.6 6.5
Change-Id: I44f0b19208d3865fb84e277bcaf65d7f4541d368
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit b211d8a8c0196a96b2aa324c9e3d991ae378c7f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 20:14:19 +00:00
Christian Ehrlicher
fb453fe28c Examples/sqlbrowser: improve coding style
Fix the coding style to match the current Qt style.

Fixes: QTBUG-68661
Fixes: QTBUG-120909
Change-Id: I314ca9da8a03727e3e0336a23fce1ce9d065d3a4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 2690822428deec4f0c08f4d118d69a7c6036369e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 20:14:10 +00:00
Marc Mutz
02ba4b14dc QCheckBox: deprecate stateChanged()
[ChangeLog][QtWidgets][Deprecation Notices][QCheckBox]
stateChanged(int) has been deprecated in favor of
checkStateChanged(Qt:CheckState).

Found in API-review. Amends 5a96d13bb5abd5339cf21dd1de7a17152c71f0fc.

Change-Id: I6ff4aa38c2f43622ba4b127420aff83790785455
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3512fb1ec5ff088772170540c4e91b1886fbea45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 20:14:09 +00:00
Ivan Solovev
15aec9a37d Introduce macros to simplify testing comparison
The problem with the QTestPrivate::testAllComparisonOperators() and
QTestPrivate::testEqualityOperators() functions is that if they fail,
they point into the helper function, but not into the actual test that
called the helper function. This is specially annoying when some test
calls the helper function multiple times.

This patch introduces the helper macros QT_TEST_ALL_COMPARISON_OPS and
QT_TEST_EQUALITY_OPS that wrap the respective function calls together
with the QTest::currentTestFailed() check. If the test has failed,
the macro generates a meaningful debug message with the original file
name and line number.

This patch also applies the new macros to qtbase.

Task-number: QTBUG-119433
Change-Id: Iad709de45e5bf53c82e7afa8e9f51e9275c1e619
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 1353c6f85757ad9d9f77bc754bf16c7fb185df00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 15:53:48 +00:00
Ivan Solovev
84fde7ef2f qfloat16: make relational operators constexpr when QFLOAT16_IS_NATIVE
When qfloat16 uses float as an underlying type, the operators cannot be
constexpr, because operator float() is not constexpr.
However, operator NativeType() is, so we can make the relational
operators constexpr when we are using a native 16-bit float as an
underlying type.

To avoid code duplication, introduce new temporary macros for
constexpr and Q_DECLARE_PARTIALLY_ORDERED_LITERAL_TYPE.
Extend the tests to verify that the operators are constexpr when
native float16 type is used.

Task-number: QTBUG-119433
Change-Id: I001b087d78c398c71b71a504b65c316199dd4792
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit cfc385ce3fc674d48ea2bfbaac6d3f907795b1a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 15:53:44 +00:00
Edward Welbourne
c112981789 Prepare to support taking CLDR data from its github upstream
We've previously used the zip-file form, but that's not been published
for CLDR v44.1 - the advice on the list was to use github
instead. That, however, has ↑↑↑ as a special value for fields, meaning
to inherit from a prent locale. So special-case that value. I have
verified that v44 from the zip file produces identical results to v44
from github, with this minor fix. As it happens v44.1 also produces
identical results.

Pick-to: 6.5
Change-Id: I6eb0aedda7556753cdc83bb9d76652fbb68dc669
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit bcdd51cfae24731a73d008add23d3c1e85bbd8d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 14:38:36 +00:00
Edward Welbourne
cbc3c63633 Make QLocale self-consistent on Windows
The constructor and update() method for the system locale were using
GetUserDefaultLCID(), where query() and the fallback locale first
checked the LANG environment variable, leading to inconsistent results
if the user set the environment variable to something different from
the system's configured locale.

Break out the logic of parsing %LANG% into a static helper, replace
the existing parsing with a call to this and add a helper to get the
right ID to use, possibly via it, using GetUserDefaultLCID() as
fall-back. Drive-by: initialize substititionType in its declaration.
Also look up %LANG% each time we want it; it's not that expensive,
given how rarely this code is called, and client code could change its
value at runtime. Partially inspired by a patch from Wladimir
Leuschner <wladimir.leuschner@qt.io>

Pick-to: 6.6 6.5
Fixes: QTBUG-120961
Change-Id: Ie706c7089bd2b3757a3eab627723ec34a5e2b07f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fcd2a219c4c222309152f1ea2a3124ddc17d4ea5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 14:38:34 +00:00
Jan Arve Sæther
bb61ff9175 Add Qt::AA_QtQuickDontUseDefaultSizePolicy
This flag should be set in order to opt out of that Qt Quick Layouts
takes implicit (built-in) size policies into account, a feature that was
introduced in Qt 6.7

Task-number: QTBUG-117597
Change-Id: I206cd61534b2103b2c3a9b4abc97fec8c88799d1
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 4ae537e67c99160f5dcac99f40d03a7921456556)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 09:44:42 +00:00
Marc Mutz
7b5df411db QMetaTypeModuleHelper: mark instances constexpr
Static and thread-local objects should be constexpr or constinit if possible.

Task-number: QTBUG-100485
Pick-to: 6.6 6.5
Change-Id: I29088798a50d6278252c9088e7c191c4214b2e5b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 88c3cd6e08c86bfb5bb676ceed4c92344f8ed91c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 09:15:35 +00:00
Axel Spoerl
ede7d80b39 Test restored state in tst_QDockWidget::hideAndShow()
4c60a11d8f935abb762a83b0ab99cefa6db3060c had to be reverted, because it
broke restoring the state of hidden, floating dock widgets.

Extend tst_QDockWdget::hideAndShow() to test this functionality.
Blacklist test function on Apple, because Apple machines on CI show
dock widgets with the main window.

Task-number: QTBUG-120191
Change-Id: Ibc6121a99f15f33d62ca0a9376dbe9fafbe20290
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3195e34742731406a923b545bd85a5a33e970a42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 07:54:38 +00:00
Thiago Macieira
8902ed8f89 QUuid: Fix Id128Bytes alignment on some architectures
This partially reverts eb0abd9789062d95bc62dbbc29b2038dc40472b1 so we
depend on __SIZEOF_INT128__ in this structure, not on QT_SUPPORTS_INT128
so the Id128Bytes union has a quad-word integer as a member at all
times, even in QtBluetooth's removed_api.cpp.

That's required because on some ABIs, the presence of this member causes
the type to be passed differently, usually in registers (we fixed the
stack problem with the alignas(16) in that commit).

The "Itanium Software Conventions and Runtime Architecture Guide" did
the same back in 2001; section 8.5.1 says integers from 65 to 128 bits
are passed "Next Even" and so are aggregates with alignment of 16 bytes.

This rule seems to also exist in the AArch64's AAPCS64[1], which says,
in rule C.10, that the type should be passed in even registers:
 C.10 If the argument has an alignment of 16 then the NGRN is rounded up
      to the next even number.
(NGRN = Next General Register Number)

It's unclear whether this applies to the union type as a whole or to its
individual members. If the latter, then Clang may be buggy.

[ChangeLog][Important Binary-Incompatibity Fixes] The QUuid::Id128Bytes
type had a loose definition that could cause it be passed incompatibly
between functions, in some architectures, depending on whether GNU
extensions were allowed. This is now fixed, but may cause code compiled
with Qt 6.6.0 and 6.6.1 to fail when recompiled with 6.6.2 or later.

[1] https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#682parameter-passing-rules

Fixes: QTBUG-119248
Pick-to: 6.6
Change-Id: I6e2677aad2ab45759db2fffd17a86a208f788cb7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6f9db71154662a648f19a86ca86585eddbe2f9ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 02:50:23 +00:00
Thiago Macieira
5cb192ebb3 filetest: add moveToTrash() operation
Change-Id: I76ffba14ece04f24b43efffd17ab43f3f2ecde59
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 89b4a236a4b8310c3bef269414609db3204d0513)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 02:50:21 +00:00
Matt Aber
3e29815084 Fix export of QDeferredDeleteEvent, should be Q_CORE_EXPORT
When QDeferredDeleteEvent was declared in qcoreevent.h, it
had Q_CORE_EXPORT. After moving to qcoreevent_p.h, it changed
to Q_AUTOTEST_EXPORT. The correct macro should be preserved.
Noticed that this change was needed to make GammaRay work
with Qt 6.7

Change-Id: I6fab494d9f60b1261edce6f326a3b96467ff7da1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit bc3b18764aabf95a50a65e090863c54b6ac57e3e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 02:20:46 +00:00
Aleix Pol Gonzalez
4f9c75901e ibus: avoid a crash when context is not ready
This amends 84cf0e2be54d9ad183db063fd429b792c67edd18

Pick-to: 6.6 6.5
Change-Id: Ia560f785764d4ba0e4aa66943effb9f16a38e699
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Inho Lee <inho.lee@qt.io>
(cherry picked from commit 0d923c2097578682b8553707834ccf52d7cd52e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 00:33:34 +00:00
Ahmad Samir
9e8d939127 QTest: remove static keyword from the new qWaitFor() chrono overload
This is a function template defined inside a namespace, `static` makes
no difference here.

Change-Id: I2eb52b4fb4432c269b2449ae37550bd0be0dbbce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 85108e1938fad7b6ca1ce267fb10cda5933dbc50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-19 00:33:34 +00:00
Mårten Nordheim
f6039b08b3 QH2Connection: Fix issue with unity-build/odr
The static function appeared in two places, and in a unity-build
this fails quite visibly.

Change-Id: I60000d01194a2c79ca9c101f2a6d3f77f469f1a7
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
(cherry picked from commit a3a48815cc9430d6f5c736a312ea4ea5c0895205)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 21:12:32 +00:00
Axel Spoerl
be4f933c0a Revert "API Review / QDockWidget: Remove const/ref debug operator"
This reverts commit ca2f46c04c26ed4649cb6c2c62d3b2e52cd8d5ad.

Reason for revert: <BIC in 6.6 found by Marc Mutz>

Pick-to: 6.6
Change-Id: Ia5b8849e55ebccb514bc753ce1d31855d91e2406
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit b148a362c36a9b34b0c21c60530353d6bf6b92cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 21:12:32 +00:00
Axel Spoerl
4a45799609 Add missing include in tst_QHttpHeaders
A QMultiMap is used, while only qset.h is included.
FTBFS w/o precompiled headers.

Include qmap.h as well.

Pick-to: 6.6 6.5
Change-Id: I5f6e1d204bfa94cc6a81f6883c7a7b0ee1e9963c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 84b792fa98b3a21119f16b0cd9443f90b1ad504d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 21:12:32 +00:00
Ivan Solovev
b5f1794d4d TestLib: consistently wrap comparison helper macros into do {} while
The CHECK_SINGLE_OPERATOR macro is used inside FOR_EACH_CREF macro,
which, like all other FOR_EACH_* macros in Qt (see qdebug.h or
qmetatype.h), expects its parameter to have a scope or a semicolon.

All other CHECK_* macros are *not* used inside FOR_EACH_CREF, so
they can follow a more traditional approach with the
`do { } while (false)` scope without a trailing semicolon.
This allows to use them in the code like:

 if (condition)
     MACRO(args);
 else
     OTHER_MACRO(args);

In the example above, if MACRO ended with the semicolon, adding
one more semicolon would have discarded the else part of the
conditon, leading to compilation error.

Amends bfb237d19a5319bfa020ad0cefaff72e8d94a9be.

Task-number: QTBUG-119433
Change-Id: I9a7f17416ba7c37a50f022f685b54e2643e4a9e2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit ecafbc4d5d9a4c12f44de856dec544404c633a6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 21:12:32 +00:00
Ivan Solovev
1b5211a542 Improve documentation of Qt ordering types
Apply some documentation improvements that were suggested before FF.

Task-number: QTBUG-119433
Change-Id: I9b1d83c69821e25ae4cd8db0cbf3fa6d6330a6dc
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit aae6cf8d15837c9a29503d5fdeceb2a4b5befc55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 21:12:32 +00:00
Tor Arne Vestbø
267a34e490 cmake: Improve folder structure for Xcode and Visual Studio projects
CMake has a built in file extension list for "Source Files", that does
not include qml files. We can't extend that file list with a regex,
so we need to add qml files individually as a finalization action.

We also stuff generated files (both auto-gen as well as other generated
files) into a separate source folder, to focus the project on the user's
files.

Change-Id: Ic9a4d9daad088b1874bcf81e75c776537f3ff531
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 06ea3e3994b38e5fe9ac4f33044b0efa1f1be294)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 15:39:28 +00:00
Marc Mutz
e5d1c778ad QH2Expected: use Rule Of Zero
It doesn't always pay to be explicit about SMFs. In the present case,
clang-tidy complains that the move ctors of the class aren't
noexcept. It's a false positive, but just removing all the =default'ed
SMFs makes it go away, too.

Amends 0dba3f6b713a657eb3bf2037face72d16253eb92.

Change-Id: Ib641d4eed9e214b41c143b60494e82790da6fda8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit fab57c25e22239516dec737f2d42a7fccae9d37f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:49:32 +00:00
Ivan Solovev
ecfdb8b180 QEventLoopLocker: use macro to implement move-ctor
We do have special macros for this case, so use one of them!

Amends c2956f8f7685b624d7693ff644125d0f594c585d

Found in 6.7 API review.

Change-Id: I205966d6f7363abf1a26f59b04555b1a48a4e696
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 26b8e99b1ce616a063fcbd0d67f44ba9e7712f23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:32:59 +00:00
Ivan Solovev
f2b9258cdb qcompare.h: fix comment for std lib implementation selection
Amends 4b6f757020382ed157bf6beb572549f05e881359

Found in API review

Change-Id: I9154c6ad0236776054816bcdde03737290a633ad
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit edf92b8e33f896c764c8aac549385f6e46571a0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:32:59 +00:00
Mårten Nordheim
0002ba47e6 Http: Start more connections faster after determining network layer
Previously we would more or less wait for the first connection to finish before
initiating more connections. This was just happening by virtue of
calling startNextRequest when a request was finished.

Since we have already determined the preferred network layer, let's just
try to start more connections. In case we are using https this doesn't
make a difference because we will try http2 upgrade first before allowing
multiple connections. Unless, of course, http2 has been disabled.

Fixes: QTBUG-120619
Pick-to: 6.6 6.5
Change-Id: Id3c3be59fd07120bff574d63481119e5ed9eb88a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 88f5fc47ebf558fa72b7b447f8394a0d44b6bf9d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:32:59 +00:00
Christian Ehrlicher
6224c3b0dc SQLite: Update SQLite to v3.45.0
[ChangeLog][Third-Party Code] Updated SQLite to v3.45.0

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ibf37acf5bcee4639766d445991f5265dc78593c4
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 24a95c22fc9f09ca4415946e965615d022704ca3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:32:58 +00:00
Mårten Nordheim
47ae5f9178 D3D12: Fix warn-on-error for unused parameter
Amends 445fb40081c870c0a9b1c1c3cf27b20fdd36a531

Change-Id: Iee3eaffcb7fbbdb3cec8020ee7c9280d52faa0a2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 54824e7d2bf1066014f4e6f3bb3c2a9535435779)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:32:58 +00:00
Laszlo Agocs
273c96a941 Update QRhiWidget API based on review comments
Spell out some API names in enum.

Some functions are now protected.

Remove property for autoRenderTarget.

textureFormat -> colorBufferFormat.

Used "fixed" instead of "explicit" and follow
the above naming, so that explicitSize becomes
fixedColorBufferSize.

Change-Id: I2fd6ad46033313a3febbb8846146021d5dd11010
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit acebb97b58807d1d5910c79209664b21e741a9c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:32:58 +00:00
Marc Mutz
256ac39943 QMetaTypeModuleHelper: suppress cppcoreguidelines-virtual-class-destructor
Says clang-tidy:

   destructor of '(unnamed struct at qmetatype.cpp:966:14)' is public and non-virtual
   in file:src/corelib/kernel/qmetatype.cpp line:966 col:14

       static const struct : QMetaTypeModuleHelper

Yes, these classes are polymorphic (because the base class is). Yes,
the destructor is non-virtual (because the base class' one isn't, but
it's also protected, so fine).

But these classes are not used as base classes, so suppress the
warning.

Pick-to: 6.6 6.5 6.2
Change-Id: I75be86bca36a4a0e93d72acb1a0d2fe0dca1c505
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 11d153ae1ce3ce75e76a1fcac7bf99e4cff05716)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 14:32:58 +00:00
Tor Arne Vestbø
c7bfee363e macOS: Explicitly show extensions in save dialog if filter is "all files"
Otherwise clicking an existing file in the dialog will not populate the
full file name, which is what you'd expect for a filter allowing all
files.

Change-Id: Ib9a014352d5e567e54f95414e744566615d735d8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit c53955eaa085b14ef8e5348e951f8cd2cbfa4ea5)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-01-18 10:44:45 +00:00
Allan Sandfeld Jensen
c44caa1eaa Fix FP rasterization on Win-x86
We can not guarantee 128bit alignment on 32bit windows

Change-Id: I16bd3bded16bd29f4cb84b0cdf2671e4d9a19601
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0e8086887a2c931dc687b3c344ab5004749fa3eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 10:43:10 +00:00
Eskil Abrahamsen Blomfeldt
1b90af74dd Fix build with -no-directwrite
QWindowsFontDatabaseBase::invalidate() was defined inside an
the declaration was not.

Since the font file loader is only protected by
QT_CONFIG(directwrite), we move it out from the previous block
and add an #if for the contents instead.

Change-Id: Iedc02cceb15fe3d25d21b49af1486659a4d6373b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0d1ac449bbc38aee4341dd47189de901860d7870)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 10:16:40 +00:00
Thiago Macieira
96d03949d2 QNetworkRequest: export the static constexpr (inline) member variables
All that is required is that we write the declaration as if they weren't
inline, like we used to for C++98 non-constexpr static members. Amends
090991123dd82796fe956e4153bc26ace22280ca.

This is required with MinGW and happens with both GCC and Clang: when a
static constexpr variable found in an exported class is used in a
context that requires getting its address, the compiler emit a DLL-
importing statement. For example:

 void f(const std::chrono::milliseconds &ms);
 void f()
 {
    f(QNetworkRequest::DefaultTransferTimeout);
 }

Emits with GCC:
 _Z1fv:
        movq    __imp__ZN15QNetworkRequest22DefaultTransferTimeoutE(%rip), %rcx
        jmp     _Z1fRKNSt6chrono8durationIxSt5ratioILx1ELx1000EEEE

And Clang:
 _Z1fv:                                  # @_Z1fv
 # %bb.0:
        movq    __imp__ZN15QNetworkRequest22DefaultTransferTimeoutE(%rip), %rcx
        jmp     _Z1fRKNSt6chrono8durationIxSt5ratioILx1ELx1000EEEE # TAILCALL

Fixes: QTBUG-121135
Change-Id: I76ffba14ece04f24b43efffd17aae1a98071c570
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: André Klitzing <aklitzing@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit c09219e946ed3d90349c3638afe304553bf38011)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-18 00:33:55 +00:00
Eskil Abrahamsen Blomfeldt
97dc63861e Fix race condition when destroying Freetype font engines
If a QFont is moved to a different thread (B) than where it belongs (A),
and the font cache is then purged on thread A, the last remaining
reference to the engine will be on thread B. When this QFontEngine is
later replaced with one created on B, we end up deleting A's QFontEngine
on thread B.

This caused QFreetypeFace::release() to be called on the wrong thread and
the face would never be removed from the thread-local Freetype cache in
A. Hence that cache would contain a dangling pointer to the freetype face
which we would later end up fetching.

To avoid this, we make sure the thread-local cache itself increases
the ref count of the face. That way, the only time it will be deleted
on a different thread is when the cache has been destroyed because the
thread has shut down.

If the last reference (except the cache reference) to a face is cleared
on a different thread, we keep it in the cache until later. It will
then be in a "deferred delete" mode and will be deleted as soon as
possible. This is done either when the thread shuts down, when a lookup
causes the "deferred delete" face to be returned, or when release()
is called on any font on the thread (at which point we will purge all
faces that only have the single cache reference.)

Fixes: QTBUG-118867
Change-Id: Ifa07a9cb6f4cd3e783e12a73d8b283e70d6fb474
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 5761dd55c824afb7a7809c7a0d3ce3050b03fe7b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 18:07:58 +00:00
Alexey Edelev
4b662e9a92 Allow configuring the qtbase documentation-only build
Use the QT_SUPERBUILD procedure when configuring the qtbase
documentation-only build. This only makes sense for qtbase since we
disallow building it using existing Qt installation. Other repositories
should be configured using qt-configure-module script from the existing
Qt installation and simply run 'ninja docs'.

Fixes: QTBUG-120485
Pick-to: 6.6 6.5
Change-Id: Iafed5c17bea5c61edc239f08045922497215fb73
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 02a556674f0b3f04de5ab09dca53ed8e86a8ba06)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 16:56:45 +00:00
Liang Qi
2bcfe080d9 tests: skip tst_QGuiApplication::topLevelAt() on Wayland
This amends 189f9873ae3f23377708fbf9880398fd6a078715 .

Pick-to: 6.6 6.5
Fixes: QTBUG-121015
Change-Id: I66d2a2b0162b9c7b488af840ff5d3a881b657782
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit d4f7d2aeabe2e778224d64a65667aa09b9e42a70)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 16:56:45 +00:00
Morten Sørvig
b2b1d02692 wasm: remove onLanguageChanged event handler
QSystemLocale is setting the global window.onLanguageChanged
property which may cause conflicts in cases where there
are more than one Qt app instance on the same web page.

In addition the QSystemLocale destructor never runs,
which breaks also for repeated QLocale instantiations
on the same page (for example for the QLocale auto-
test)

Change-Id: I85af0587527b2922804fc866c83864f677700e6d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3f74e2a633a809a27e8e66346e052dea48c4369e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 16:56:45 +00:00
Mårten Nordheim
c9a9469f55 Privately introduce QHttp2Connection
For use in QtGRPC.

There is some duplication between this code and the code in
QHttp2ProtocolHandler. But let's not change the implementation of
the protocol handler after the 6.7 beta release. Nor do I think we
should do it for 6.8 LTS. So let's just live with the duplication
until that has branched.

Fixes: QTBUG-105491
Change-Id: I69aa38a3c341347e702f9c07c27287aee38a16f2
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 0dba3f6b713a657eb3bf2037face72d16253eb92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 16:56:44 +00:00
Tor Arne Vestbø
6972b8deea macOS: Reset save dialog extension when resetting file name filter
We map QFileDialog name filters to NSSavePanel.allowedFileTypes, for
example turning "Text Files (*.txt)" into allowedFileTypes = @[@"txt"].
In this case, the NSSavePanel will automatically add the extension to
the user's file name, if they just type "foo".

When a filter allows all files, we reset the allowedFileTypes to nil,
but this does not reset the automatically added extension, so if the
user switches from one filter (*.txt) to another (*.*), the file name
will still have a .txt extension.

This is problematic when the save panel's file name field does not
show the extension to the user, which can happen automatically if
the user types an initial file name without an extension, overriding
what we've asked by setting extensionHidden=NO. When that happens,
the user is shown "foo", but the actual file name is "foo.txt".

To mitigate this confusing situation we do a round-trip via the
UTTypeDirectory content type, which is a valid type without any
extension. This forces the save panel to remove any extensions
added automatically by previous filters.

Change-Id: Ia17a8c2734eff656116ef77a9813113a5076e9cc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 40506954979fa7cdd34da8251f179557eb9be4f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 16:56:44 +00:00
Tor Arne Vestbø
5dabb905e7 macOS: Work around lack of native support for multi-part extensions
Multi-part extensions such as "tar.gz" are not natively supported by
macOS, e.g. one can not create a [UTType typeWithFilenameExtension:]
for such an extension, and this goes all the way down to Foundation.

As a result NSSavePanel gets confused when assigning a multi-part
extension to allowedFileTypes, because it's using NSString operations
such as stringByDeletingPathExtension or pathExtension, which also
lack support for multi-part extensions.

We've worked around this in the past by reducing these extensions to
their last component, e.g. "tar.gz" reduced to "gz", but this results
in the save panel turning the input file name "foo" into "foo.gz" if
the user doesn't provide the full file name.

Various attempts at working around the lack of multi-part extension
support by breaking allowedFileTypes into ["tar.gz", "gz"], or doing
selectively toggling of allowedFileTypes in panel:validateURL:error,
have all proved to have corner cases and shortcomings of their own.

As a last resort, we now treat multi-part extensions manually, by
disabling the allowedFileTypes filter, and doing our own validation
in the panel:validateURL:error callback.

This requires us to also manually handle automatic extension for
file names without extensions, as well as overwrite confirmation
in the cases we do add an extension manually.

The overwrite dialog and error messages for incompatible extensions
have been modeled after their native macOS 14 counterparts, using
translated strings from AppKit.

Task-number: QTBUG-109877
Change-Id: I6b7ce3c44b4c3b24802aa1f66f4593457ae4c929
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit d651cdb9885353af1ea0647733f0c002bf2d168b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 16:56:44 +00:00
Sami Shalayel
89ebbb1633 doc: add macro for QML Language Server product name
Add a macro for QML Language Server product name.

Task-number: QTBUG-120980
Change-Id: I8b7196881a1c3777f975079c22ecbeb6f868f5a6
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 4ec386eeeadfd9b6cd9e64d5907c3c20493a0b68)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 16:56:44 +00:00
Tor Arne Vestbø
2561c7cd65 macOS: Disable currentChanged signal for NSSavePanels
The panelSelectionDidChange callback is only called when the user selects
a directory in the save panel, as all other files are not selectable.
And when that happens, the reported selection is not the directory,
but the current file name (which may be based on clicking an exsiting
file, but that doesn't cause selection changes).

To avoid this confusing and inconsistent behavior we disable the signal
entirely when showing an NSSavePanel.

Change-Id: If706b8faa7027ca284ec8398f5c6e2a110e01f91
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 942f5b23c2a279499e1e59ab283f5bafc54659e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 16:56:44 +00:00
Mike Chen
7b38b5e369 Make sure hicolor is searched before dash fallbacks
Search full icon name from hicolor before dash fallback

Pick-to: 6.6
Fixes: QTBUG-121030
Change-Id: I3e3ee142c33466203639f32857fce3ea1946a9f7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 0534a93ef04f38cf6dfc0d6c03827325d651a64c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 16:56:43 +00:00
Ghenady Kuznetsov
6affa9890d Fusion style: add clip region for groupbox title
Fusion style is missing clip region for the title in
QFusionStyle::drawComplexControl().
Without that region, the top line of the frame will be visible behind
the vertically centered title.

Fixes: QTBUG-121041
Pick-to: 6.6
Change-Id: I3daf5854195e28a5ee3cb50343e2dd56e66ed940
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 9b4c35abff94a708139923a32c38a749cbdfd130)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 11:30:27 +00:00
Alexey Edelev
5a44b8392d Allow disabling sanitizers for specific subdirectories
This introduces two new function that cleans up the sanitizer flags
and disable linking of the sanitizer libraries.

The qt_internal_skip_sanitizer function clears the sanitizer flags that
are set in CMAKE_<C|CXX>_FLAGS variables by ECMEnableSanitizers.cmake.

qt_internal_skip_linking_sanitizer collects all targets that are
created in subdirectory and disables linking the asan targets.

The asan target linking can be also disabled by setting
SKIP_SANITIZER on specific target.

Change-Id: Ibbbbec0b4a6bfd37d939b8a55f8d04656f73c536
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6a921b6751ff03a3093dfb279b02ec75e32f4adc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 09:59:14 +00:00
Juha Vuolle
8fd897d4bd Add static access function to wellknown headers
Resulted from API-review

Change-Id: I438a5cf9c88b572adece99af0314eefbc4371f8f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 37549cda7276343f96e314bf8edc60116e887718)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 06:54:46 +00:00
Juha Vuolle
be67204568 Rename QNetworkRequestFactory header functions to commonHeaders
Resulted from API-review

Change-Id: Iae712e67839d27064a0155830fd201ab15693091
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 819a8f30f4cf2efe3b8e1f3f6356ff0afed0ae65)
2024-01-17 05:48:32 +02:00
Juha Vuolle
aa2a569115 Remove HTTP headers equals() / comparison
There's several ways to compare HTTP headers, and arguably
the need for it is not very high. For the time being users can use
different accessors and compare in ways that make sense for
their use cases.

Consequently since HTTP headers are no longer trivially comparable,
it makes also comparing the request factories more 'moot' because
headers are a central piece of request information. So removed
comparison from request factory as well.

These comparisons can be restored later if a clear understanding
on it's need, and on how it should be best done, emerges.

Resulted from API-review

Change-Id: Idb5ab3710268b52a8e59656db8cc7de82f0ae511
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 89dab8578c10ed4aee4e2f4b51e7c962d618c1eb)
2024-01-17 05:48:30 +02:00
Christian Ehrlicher
b08c3af998 QImageReader test: add test image to qrc file
Add the test image to the qrc to make sure the image is available no
matter where the test is executed.

Pick-to: 6.6
Fixes: QTBUG-120732
Change-Id: I24de59fd88fdc2a3317c91ac28cf81fd5511455f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 076026fd60dfa399158498e42ee1b5000174c65e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-17 01:12:03 +00:00
Lorn Potter
c413bd9366 wasm: fix drag examples for webassembly
Change-Id: I47903743685fadfe33820e7785b72d62109e77d0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 39f81d14c1c0a09ff5165fa11b8369f8ae010ef4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 22:02:03 +00:00
Wladimir Leuschner
124e63965e QWindows11Style: Fix QMessageBox drawing for light/dark mode
Fixes: QTBUG-120748
Change-Id: I4101848e2e91c489cb53b38ae6bf0171701c5c54
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 27dea6cf23c22c8ee2f82d97486f248559e57993)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 21:17:49 +00:00
Doris Verria
b2eb82a42f QMetalRhi: Reset proxyData when swapChain is destroyed
When the swap chain is destroyed, we reset the swapchain’s layer
(set it to nullptr). However we were not resetting the proxyData which
would still point to the window’s (NSView) layer. This starts to become
a problem in  the cases where the swapchain’s associated QWindow is
closed (NSView gets destroyed) and reopened (a new NSView will be
created) because when the swap chain is recreated again, since the
proxyData already exists and points to the invalid old layer,
QRhi::updateSwapChainProxyData is never called. This led to an invalid
value being assigned to the swap chain’s layer.
To fix the issue, make sure to reset the swapchain’s proxy data when
destroy() is called.

Task-number: QTBUG-113498
Pick-to: 6.6 6.5
Change-Id: I02996ecf69ad9d183cac31c9188717ec36742531
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 948b93a847e1d6b78b5eee039281b3cd078fbabe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 21:17:49 +00:00
Tor Arne Vestbø
4a1ba399ea Remove note about QDockWidget::DockWidgetClosable not working on macOS
It does nowadays.

Pick-to: 6.6 6.5
Change-Id: Ie14a84460abfebd42c93e5ae41969d9e3b4c4f5d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a99d31307600d6ca52890022605c7f1b10ccb7bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 21:17:48 +00:00
Jaishree Vyas
e2ad97eef9 Doc: Create separate Graphics and Multimedia example categories
Fixes: QTBUG-117884
Pick-to: 6.6
Change-Id: I33c7b1cbfaeae866dffb0e89a5d09d775736d886
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 98ee4d9e37a1038d46f0c0494332c0ed46dbb323)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 18:10:59 +00:00
Joerg Bornemann
06e9da856c CMake: Fix user_facing_tool_links.txt for Apple platforms
User-facing apps that are app bundles on macOS weren't linked correctly.
For example, for Qt Designer we're creating now an entry like the
following:
    .../Designer.app/Contents/MacOS/Designer /usr/bin/designer6

Pick-to: 6.6
Fixes: QTBUG-120487
Change-Id: I3eada15c4c5bf31b9b08829333d3c87f76ede7a2
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 2921a70e5d8de5bf3f4b56b90347983aa9b1342b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 18:10:59 +00:00
Tinja Paavoseppä
e47180b46d Android: Handle embedding container windows better
Initialize surface container type to TextureView to
make sure it's set also for embedding containers.
Additional checks for embedding containers when
setting parent or changing visibility.

Change-Id: Iba07bfbb9e8f16804627efbdfe78559ac2580e41
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 46b86410a9730b099fa350516c3902db0ee01291)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 18:10:59 +00:00
Tinja Paavoseppä
ccd624eacc Android: Add possibility to provide app main lib name without metadata
Normally, the app's main library's name is read from a metadata field
in the AndroidManifest.xml file, which is filled out by
androiddeployqt.
Add a protected variable in QtLoader for the app main library name
that can be set to provide the library name without the metadata field.
This is useful in cases where we don't have a manifest file filled
by androiddeployqt, for example when embedding QML to an existing
Android app.
As a side effect, change the name of existing variable for the main
library and the method to access it to make it more explicit they refer
to the library's absolute path.

Change-Id: I869547818f4d0272668a1052d7bc6916b7bf5a98
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 8e9918e476430cc30007f2acf69f0c0fe120a03d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 18:10:58 +00:00
Inho Lee
c4dfea83b6 IBus: Support a property ClientCommitPreedit
IBus added the ClientCommitPreedit property to handle
preedit in case.
If this writable property is set,
ibus_engine tells the client whether current preeditText
should be committed or not in the client side when
focusOutEvent.
(Qt's old behavior is always committing in the client side.)

Fixes: QTBUG-109576
Fixes: QTBUG-58005
Pick-to: 6.6 6.5
Change-Id: I6bb78921ce04cdd3197cba9e2fb00376d5e0ac8b
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 84cf0e2be54d9ad183db063fd429b792c67edd18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 18:10:58 +00:00
Tinja Paavoseppä
023dd3adb1 Android: Add possibility to listen for changes in app states
This is useful for example the embedded QML case, where we want to
make sure everything from Qt side is ready before we start to create
Qt windows.

Change-Id: I8148405e35cc8ebb89110f05e07cef06f8ff3709
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 6102ee6dd8f3e6cee3e3bc7544329c5c4b7843f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 18:10:58 +00:00
Axel Spoerl
b01235ca3f Revert "QDockWidget: Always show dock widgets with the main window"
This reverts commit 4c60a11d8f935abb762a83b0ab99cefa6db3060c.

Reason for revert: Breaks QMainWindow::restoreState(). Dock widget is shown, even if restored into hidden state.

Change-Id: I9808de4e0fd48871c3b234ae9bbaf6c64c8e832d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0ea37300d111beea3bb353f036d6c747f63c88dd)
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-16 14:55:24 +00:00
Kai Köhne
fef7baaf11 Remove foreach snippets from the documentation
We don't recommend foreach anymore, and have in fact
adapted two snippets already to use for(), but missed
the documentation text.

In any case, it feels a bit weird to give an example
how to iterate over QStringList in each of these methods,
so we might as well just remove this part.

Pick-to: 6.6
Change-Id: If8744e48961661ad518f5f24781c38f371d981bc
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 3b9f6b54b1cda08079ae97956478a4af55133803)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 14:55:24 +00:00
Volker Hilsheimer
1f3f99f673 Don't include windows.h in the public qopengl.h header
All we need are the APIENTRY and WINGDIAPI macros, as those are used
in the gl.h header. Define those locally for the time we need them.

Use a QT_APIENTRY macro instead of hijacking APIENTRY for when we
declare OpenGL functions with the stdcall calling convention.

A few build fixes needed in tests that used Windows types without
explicitly including windows.h first, or that (incorrectly) included
one of the sub-headers of windows.h (like winuser.h).

[ChangeLog][Potentially Source-Incompatible Changes][OpenGL]
On Windows, the public qopengl.h header no longer includes windows.h.

Fixes: QTBUG-120687
Change-Id: I3770ac8eaeee5bcf4e7234e5a2539935a8aa5a7d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit b13c610f50c714873987d8c4f30f50953ade9aba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 14:55:24 +00:00
Tor Arne Vestbø
87aa94008b cmake: Explicitly generate Xcode schemes for executables and libs
Otherwise, Xcode will auto-generate schemes for all targets, including
internal targets such as foo_autogen and build-only targets such as
ZERO_CHECK and ALL_BUILD, choosing one of them at random when opening
the project for the first time.

If multiple targets get a scheme they will be sorted alphabetically.
We could prioritize them by generating a xcschememanagement.plist
file, but that would require teaching CMake about that feature.

This aligns the CMake behavior with qmake, where we also generate
schemes explicitly.

Pick-to: 6.6 6.5
Change-Id: I3756fced37a4ff7792370da10fc49169cc271ae8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 822dc75f1a0be988b25741a8f16ddc2fbeb48e77)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 14:55:24 +00:00
Timothée Keller
15cf52cd59 Windeployqt: also allow platform-type plugin selection
Including/excluding plugins of the platforms type did not work, since
windeployqt was only ever looking for 'qwindows'. Keep the default
behavior of deploying 'qwindows.dll', but also allow users to
add/remove platform-type plugins.

Pick-to: 6.6
Change-Id: I4062a71939224d1462896d95a2541e8caced399d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit bca41b1832bf1ce76787109456094149520bc403)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 14:55:24 +00:00
Mårten Nordheim
72c2d67250 Http2: move assemble_hpack_block declaration to header
Change-Id: I5033d433d2aa499007a6e436dbb70d9c48315e8b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 8ce261f6d857e8b05c8043042fce101cb95cd868)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 14:55:24 +00:00
Tor Arne Vestbø
b9640c0ecf cmake: Mark auto-generated rcc files as generated
Allows us to hide them in a separate folder in Xcode and Visual
Studio projects.

Change-Id: I5ce7884ce50198c3b0c9654bb188f38a8a679be0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6e215a44c131598c5f75198a443d796f2709ad89)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 14:55:24 +00:00
Timothée Keller
073340a6d8 Windows QPA: don't take dpi rounding policy into account when fullscreen
With some HighDpiScaleFactorRoundingPolicy, going fullscreen can end up
not filling the whole screen. In this case, ignore the rounding (only for
the window size, not its content).

Fixes: QTBUG-115954
Pick-to: 6.6
Change-Id: Ie87196358ef28dbe2fcbc180b1740ed9f784b4a0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit da473f3a80798d84d0f1bd9175158024a548ec68)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 14:55:23 +00:00
Kai Köhne
2a18c00c2a Doc: Improve documentation around setting ALLOW_INTERACTIVE_AUTHORIZATION in D-Bus
Change-Id: I4830b375c5f8c7986985c1d6caddc51348fb45ed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4c86f9b8049ad7717988125c725492febc44010b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 14:55:23 +00:00
Joerg Bornemann
95770f1bd3 Remove temporary exclusion from unity build
Commit db9fa4a61791794823e570f8aa7f6e5eed8c5f52 excluded
qelapsedtimer_mac.cpp from the unity build. The necessary patches have
been merged, and we can remove this exclusion from 6.6 on.

Pick-to: 6.6
Change-Id: I85b353b202af1fd8eeea43753e5dc5ce18357d19
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 75f5eec2c904b5a3a274d9f1c70e14e687e6fa29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 14:55:23 +00:00
Alexey Edelev
7700d8cb61 Document qt_import_plugins behavior for dynamic plugins
This describes how qt_import_plugins works for dynamic plugins.

Pick-to: 6.6 6.5
Task-number: QTBUG-118829
Change-Id: I7b30060c11c0d8c4a1fbae6782a047737ba7d454
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 2e328ca5a8242b0c3edec8e59d1cfa02d4596202)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 09:44:29 +00:00
Christian Ehrlicher
7adfb315e5 Doc: Remove wrong comment in QStyle::pixelMetric() doc
Pick-to: 6.6 6.5 6.2
Change-Id: Iebb5794a166899c986e1c408a254184b22bc276e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit d0d5794a3decca8501d26387bc8281c61f0bd4ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 08:18:36 +00:00
Juha Vuolle
0fa4721dfa Add autotest support for QRestReply json parsing errors
Change-Id: Iffabdcafa49f16e24f182991c527b3d3217ca955
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 2d9afc8501879a0ef39bc169cdf8d0b7fa9616f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 05:06:27 +00:00
Marc Mutz
a915e2b211 QRestReply: optionally return the QJsonParseError from json()
... and remove the debug output of the internal QJsonParseError.

This allows users of the function to get the details in
machine-readable form, and to distinguish between !finished and an
actual Json parsing error.

Found in API-review.

Change-Id: Ia237b192a894d692b965f6bedb4c94d3b6537535
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 3a61de282c4740efe4a6fa1672e66efaf7c2b408)
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-01-16 06:06:27 +01:00
Lorn Potter
5fd6ad5101 wasm: don't call requestActivate for windows that don't want it
QWindows that set Qt::QWindowDoesNotAcceptFocus like QtVirtualKeyboard
should not get focus.

gets rid of message:
requestActivate() called for  QtVirtualKeyboard::InputView(0x1cdf130)  which has Qt::WindowDoesNotAcceptFocus set.

Change-Id: I649a8cff599769727beaeee11039cf1291fd502d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit e766df030bc1afe7a654baa59efe5165f6b6cda9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-16 02:09:05 +00:00
Christian Ehrlicher
a7f052319b Widgets: pass widget to QStyle::pixelMetric()
Make sure to pass the widget to QStyle::pixelMetric() as some styles
might use this (e.g. the new windows styles) to determine the correct
pixel metric.

Pick-to: 6.6 6.5 6.2
Task-number: QTBUG-1857
Change-Id: I5c32f5af8b284749732b610e56b4e3d8c8ed1946
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 43ce457cbd093fc06d99b5ac833c789ef7c893d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 23:11:35 +00:00
Lorn Potter
020a7e96d4 wasm: move keyboard input handling for touchscreens
It's better served where all keys are handled,
and fixes bug with modifier keys

Fixes: QTBUG-118503
Pick-to: 6.6
Change-Id: Ic53d1b332bd918dbc4fdd27ea4e43ad1e1ecce82
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 75ac9adeda41194e1733c69b3176fc2a368a369e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 23:11:35 +00:00
André Klitzing
59b323260f Add sys/types.h include to fix build with musl
This amends c82ed8b2795cbf6d82dfe3857fec7c16688137a4.

Fixes: QTBUG-120766
Change-Id: I2584c62d35c6ee0a9c8687a476f7eab52bd52af2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 72ee1df260d728a1e699bd4c6e03bf202c929cbd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 23:11:35 +00:00
Timothée Keller
d7069db3b0 Windeployqt: remove unused library list
When windeployqt had hard coded module information, it had
result.directlyUsedQtLibraries, and result.usedQtLibraries. The latter
was meant to add in the modules that weren't defined. Since we now read
available modules directly, there is no need for result.usedQtLibraries
since it should always be identical to result.directlyUsedQtLibraries.

Change-Id: I60e38c176b11626c1ef5a844e80bc701a9eed189
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit a05abede682db4ab20a7c1d9eb45a487e91d6a78)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 23:11:35 +00:00
Isak Fyksen
f7f5477ec5 Make adding new rows to QTestTable more efficient
Added QDuplicateTracker to keep track of used tags, rather than looping
through QTestTablePrivate::dataList for every added tag.

Removed method `hasRow`, instead calling `QDuplicateTracker::hasSeen`
directly in `newData`.

Task-number: QTBUG-118619
Change-Id: Idaab70d8c94227f75620924e0f1ead477f93b27a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 8a23e3aa323443d2ea958b1213b00031e5b13aed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 23:11:35 +00:00
Timothée Keller
2dc02a2aeb Windeployqt: add output for determining plugin/module relation
Windeployqt has a pull all in approach to plugins. This can require some
modules to be deployed despite being unrelated to the application's
dependencies. An output is added to provide information to better reflect
what windeployqt is doing in this regard.

Task-number: QTBUG-117910
Pick-to: 6.6 6.5
Change-Id: Iabf89e0faca862a90c0fcd46e5675dd43655be1d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 40cff9e93c36edcab49c08fa65760c22dc935992)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 23:11:35 +00:00
Ivan Solovev
bdf6f7f4d3 QQuaterion: fix formatting
Fix indentation, split too long lines.

Amends f9f1272e7c438b79591032877f2b386af8085c3f

Found in 6.7 API Review

Change-Id: I3e9e3647afbe1a49fe78258177aff5cb878ce030
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5e49fa2739bd43e919863b343821c22b3d583afb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 23:11:34 +00:00
Eirik Aavitsland
ca705abe06 Fix the pdf testing in the painting baseline test
The pdf testing relies on the sips tool in macOS to render generated
pdfs into pngs. In recent macOS updates, that tool has changed
behavior, and no longer produces the desired output. Fix this by using
a custom pdf page size, instead of relying on cropping behavior in
sips.

Pick-to: 6.6 6.5
Change-Id: I9b2e947424774bb4456a6aefe04288b84401a9b7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit ec324fd4afd1bf843ea601447f40c1e375efe659)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 23:11:34 +00:00
Aurélien Brooke
2634ad2e6c QShader: add move constructor, move-assignment operator and swap
[ChangeLog][QtGui][QShader] Added move constructor, move-assignment
operator and swap member function.

Change-Id: I25dbaf4cdd1190204d23121e6ecd8e3947c4b612
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 89d89f99a794d8edf9282e76a95f78c28ab4d932)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 23:11:34 +00:00
Lorn Potter
417cf07c5d wasm: provide isValid implementation for QWasmOffscreenSurface
Fixes: QTBUG-120350
Pick-to: 6.6
Change-Id: I0cb2ba66a2d27f3d96a4a6a1cb85695f6b305178
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 139d57a7e906b84672024661a58628918ceff928)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 19:53:47 +00:00
Tor Arne Vestbø
df753ab453 macOS: Add helper function for getting AppKit localized strings
If we for some reason can't look up AppKit, or if the table or
string within that table is not found we will end up using the
key as is.

Change-Id: I5d574288e421e586458266899ffdff90eeadec8f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5f15a93f16727824372bfd1a6490754440de942f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 14:00:15 +00:00
Marc Mutz
d3fba01cdc QDebug: add missing #include <optional>
Found in API review.

Amends b7657ddccbe0a5ab1cdfc61ae6b7f0501dbfb24a.

Change-Id: Ibdab7f51be09036659475bd76af28e8692235b9c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 620eb390c0b211e034872ba4a63000896d8c944b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 14:00:12 +00:00
Marc Mutz
9b3820c7d3 QObject: de-pessimize installEventFilter()
Don't loop over the list of event filters twice, do it once with a
combined predicate.

This code is still has a big impedance mismatch: the removeIf() will
always leave empty space at the back while prepend() needs it at the
front. We should fix this by reversing the meaning of the order of
event filters to mean back()-is-applied-first, so new filters can be
append()ed, but that is for another patch.

Done-with: Jarek Kobus <jaroslaw.kobus@qt.io>
Change-Id: I08324697229a54c8f66c6c320cf7232d707a08f1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit edff6a33a1e3757b9bb4831091a3db8fa99e3219)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 14:00:12 +00:00
Jarek Kobus
a16964e471 QObject: Optimize removeEventFilter
We can't have duplicated filters installed,
so break the loop when removing event filter after we
have found the matching one.

Change-Id: Idda87f3090954e020b27bf3fab62677128607f03
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b909b8dfe808ed6bbb9f4353729c8810ee0e95c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 14:00:11 +00:00
Ahmad Samir
af9b70c5ed QFileInfoGatherer: add some API docs
Task-number: QTBUG-99750
Pick-to: 6.6
Change-Id: I908e1135b895dbf6116b1dce7416b14905b886b2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0cda986eb6cdf681cb64811b416c413645cb0f3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 14:00:11 +00:00
Juha Vuolle
86e5979d51 Rename QHttpHeaders::has() to contains()
Resulted from API-review

Change-Id: I84e880dc6edb9c62fd1ddd50d477347443fd52a7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e2462b09b7dcbd52c4be0df5f01508dacf27cab5)
2024-01-15 16:00:11 +02:00
Laszlo Agocs
149da3331b rhi: gl: Pretend 4x MSAA is always supported when cannot query
With ES 3.0 and up the GL_MAX_SAMPLES query is available and is
guaranteed to be at least 4.

With ES 2.0 there is no such query.

While what we report from supportedSampleCounts() has little
significance with OpenGL (for the window's color buffer it is
anyway the QSurfaceFormat that decides, not QRhi), QRhi users
such as Qt Quick may rely on supportedSampleCounts() returning
real values and may, for example, warn if the value attempted
to use is not in the supported list. (even if MSAA is fully
functional)

Avoid getting such warnings on a pure ES 2.0 implementation
with 4x at least.

Pick-to: 6.6 6.5
Fixes: QTBUG-120474
Change-Id: I8a34a8bc9ce37ce951fdf7794247e8db44435d41
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 520d755d324a32c97cb9e25b617e99d0ab93d666)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 10:31:15 +00:00
Alexey Edelev
30bb85962e Add BuildInternals lookup to the settingseditor manual test
Change-Id: Iae39efccaac26bcd12b416c05af36a545dca59b6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 9ba5c25f1267f0c85d1020be7d8163b918cc3a89)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 09:56:13 +00:00
Hatem ElKharashy
4596aa7bfe QRadialGradient: Fix undefined behavior
The UBSan raises a division by zero in getRadialGradientValues. This can
be avoided by calculating the inverse in
qt_fetch_radial_gradient_template as a checker is done to avoid
division by zero there. (Credit to OSS-Fuzz)

Fixes: QTBUG-120332
Change-Id: I798d1efc87ee07df7ca6f401aa476013cdbffe42
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 69bed6cd3f12a3c1b0182c5a3706efa617090cfa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 09:45:46 +00:00
Tor Arne Vestbø
b814f73fb6 macOS: Show extensions in file dialog when filtering on multi-part extension
File extensions with multiple parts, such as as ".tar.gz" are not natively
supported on macOS. Asking NSSavePanel to only allow file types with such
extensions confuses it severely, so we work around it by reducing the
native file name filter to the last component of the extension.

In this situation, we explicitly tell the NSSavePanel to show the full
filename, including the extension, so that the user can more easily
see what the final file name will be.

However, as part of 7f8a80ebf87cccb57da316202e5350eb5eca9d5d we ended
up changing the logic to count the number of possible extensions for
a given file type filter, not the number of parts in the extension.

The logic has now been restored, but moved to init, so that it applies
even if the initial filter is not a multi-part extension.

Task-number: QTBUG-109877
Pick-to: 6.6 6.5 6.2
Change-Id: I244cea1cc2977f8adf7e359ea7116bbfad0e1059
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit fd817c28a03f8b6743ea678c9edf3f8f047db627)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 09:04:51 +00:00
Juha Vuolle
b7e793f627 Add streaming text support to QRestReply
Provides the possibility to read text data as it arrives, instead
of needing to wait until the whole body is received.

Task-number: QTBUG-119002
Change-Id: I64f90148fd41a77c4ae2d5dbd6194a924a9f3a86
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 4da14a67a6157c415f8228a8bae7d6b0f895df7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 06:01:15 +00:00
Thiago Macieira
1bb0cc0923 tst_QStringView: don't go through the QString constructor
Amends d351a97e85e5ed8acd7ad1357ef76dc2e0ad639f.

Pick-to: 6.6 6.5 6.2
Change-Id: I5201966b308e48989c06fffd17a9aa4d086e6039
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 80df23bc7b966c0c0f984ff20d5d0dc1e0b2e025)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-15 06:01:15 +00:00
Thiago Macieira
9962441bfd QProcess/Unix: detect ASan and TSan dynamically
Fixes: QTBUG-117533
Fixes: QTBUG-117954
Task-number: QTBUG-104493
Pick-to: 6.6
Change-Id: I09c3950e719e4b259bc7fffd1793ee472c5d5a9a
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 7c4e271fe73f4775d308d5851c07bc21cdd08570)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 20:45:25 +00:00
Axel Spoerl
49bfdf7e67 Stabilize tst_QMessageBox::hideNativeByDestruction()
The test was flaky, because of qWaitForWindowActive() after show().
It is not guaranteed, that a window has focus after show().
Use qWaitForWindowExposed() instead.

Task-number: QTBUG-118489
Pick-to: 6.6 6.5
Change-Id: I1eb8a73f2beafec00c4a6f6b34bfd36a8d6e4d93
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 599328845c7e77bc7b4fd5b4f2de000bb463a814)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 16:20:25 +00:00
Ahmad Samir
9fb14df814 QObject: clarify docs wrt. member access following Q_OBJECT and co
The macros expand to declarations that end in a private: section, which
means everything following them is private. As Fabian said in the bug
report, this is obvious when Q_OBJECT/GADGET ...etc are used in a class,
but might be a bit surprising when used in a `struct`.

Fixes: QTBUG-120297
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Iacdfc4eb3bab3554cc1142f682b11b32c3868b8f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit eb2db79064bd6e74d0b3485a650e4025d0a39c96)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 12:44:44 +00:00
Kai Köhne
eb96856806 Simplify QHttpHeaders documentation
Simplify wording, leave out historical baggage (which
is not really relevant for users that look into new code).

Change-Id: I9be1d42b6d75dd4bf6fccd6ecb47bc7cd6026ed3
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit f23154c05ba0de300d017f1c50910da324414eef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 12:44:44 +00:00
Axel Spoerl
8e67c782a6 QGenericUnixTheme: Rename ColorTheme enum value to ColorScheme
ColorScheme is used in Qt as a name for dark/light desktop mode
properties.
The enum value was named incorrectly.

=> Fix it.

Pick-to: 6.6 6.5
Change-Id: I2aa72f81e36c0997127dd6de0e23d4773509ba40
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit c4bd6ac4e5a0782d8771af1485a3b78733180785)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 09:44:11 +00:00
Andreas Eliasson
58d6b0a1af Doc: Wrap arguments to \inlineimage in curly braces
Wrap the arguments to \inlineimage in curly braces so that the
describing image text doesn't show on the page.

Fixes: QTBUG-120572
Pick-to: 6.6 6.5 6.2
Change-Id: I00f4befc64c20fb6de1dd5ddcb6ca2573fa7c355
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 5358d7a5fe394a37435a947484f1efb7ce297fa2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 09:43:39 +00:00
Tor Arne Vestbø
c69ad0a66e Tweak QObject::deleteLater() documentation a bit
The Qt 4.8 reference is not relevant. And mentioning that calling the
function more than once is safe, or why that is, is strange, as users
should still treat the object as something that will go away soon.

Change-Id: Icf24aa8ffe079e35351006dd77063df48a596fab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e02dc31fbf3ae460bea2aea068ccc969d6e852fc)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-01-14 10:43:19 +01:00
Axel Spoerl
f83ba9d3cf API Review / QDockWidget: Remove const/ref debug operator
Remove the debug operator taking a const QDockWidget & argument.

Leaving the override taking a pointer.

This amends bbeff2a3350dd3396400865525d509b784c2d93e.

Change-Id: I0fbca6ea7dbffe6269c70e5e9eb29af9f84c3600
Found-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Task-number: QTBUG-119952
Pick-to: 6.6
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit ca2f46c04c26ed4649cb6c2c62d3b2e52cd8d5ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 09:42:49 +00:00
Axel Spoerl
744313ae79 tst_QHostInfo::reverseLookup(): code cleanup
Remove redundant curly braces.
Use constFirst() instead of first() on a temporary list object.

Task-number: QTBUG-120460
Pick-to: 6.6 6.5
Change-Id: Id643b20dfa5a541fea56abfdbcf933245a8a3c9d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3c5e37fe0ff761bd4ee4eeea67881ec7b8eadad5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 09:42:10 +00:00
Juha Vuolle
7c06008369 Remove an unused, leftover, include
Task-number: QTBUG-119002
Change-Id: Ic4054e82c11eede7823389d534bbe56328ce3dc8
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit ec98afd19265cd1c70db86f3620a21625efb9c72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 09:42:03 +00:00
Jacek Poplawski
460d555e69 Make sure OpenGLContext is not nullptr
In QOpenGLCompositorBackingStore::resize it is already checked whether dstWin is valid, but dstCtx may also be nullptr at this point.

Task-number: QTBUG-120078
Change-Id: I4a6ad71dd8225b94baff05984275ad1860298dfc
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 3f724466374cc34d0aba862f009a417540df81cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 09:39:02 +00:00
Andreas Eliasson
38cd31b033 Doc: Add code example to describe targeting precompiled libs
Fixes: QTBUG-120263
Pick-to: 6.6
Change-Id: Iba7e3bf68e4fc48764e4a751e14c398355a94173
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>
(cherry picked from commit d9d48280122609b90db74bc9ac4e8e83f0b8b958)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 09:38:47 +00:00
Kai Köhne
60873058f0 Doc: Adapt to changed names of positioning examples
Change-Id: I053b8f47dd6a37c9ca49d73d5f0d8cdbc73f37b9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6b0a5fe93bb92205f0988c196251d4d2f36121e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 09:38:45 +00:00
Kai Köhne
4348debfb4 Doc: Remove dead links to Concentric Circle Example
Amends 33254fb41f29b510d

Pick-to: 6.6
Change-Id: I81fee9ba277fdc6f3609440ddcf69cf7c3924c70
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit efcfda3d84d0fb7e4b3270a7d96b3b95db8d522c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 09:38:40 +00:00
Juha Vuolle
b2acd592d2 Add QHttpHeaders::reserve()
Found in API-review

Change-Id: Ia41eb91e9e62a252b76c20c67c1c599c0f6a633d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b5665f6fab40232a81a056523608c295c8167bc6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 09:38:36 +00:00
David Faure
1ba994bb0a Fix qWarnings Could not connect "org.freedesktop.NetworkManager" [...]
Could not connect "org.freedesktop.NetworkManager" to "stateChanged" : Type not registered with QtDBus in parameter list: QNetworkManagerInterface::NMState
Could not connect "org.freedesktop.NetworkManager" to "connectivityChanged" : Type not registered with QtDBus in parameter list: QNetworkManagerInterface::NMConnectivityState
Could not connect "org.freedesktop.NetworkManager" to "deviceTypeChanged" : Type not registered with QtDBus in parameter list: QNetworkManagerInterface::NMDeviceType
Could not connect "org.freedesktop.NetworkManager" to "meteredChanged" : Type not registered with QtDBus in parameter list: QNetworkManagerInterface::NMMetered

These came from the fact that QDBus reimplements connectNotify() to
detect connections to a dbus interface's signals. It was triggered
also when connecting to "normal" signals from the dbus interface
subclass QNetworkManagerInterface, leading to those (new) warnings.

The fix in this commit replaces signals with direct method calls,
given that the two classes are internal and that QNetworkManagerInterface
is only used by QNetworkManagerNetworkInformationBackend (and now
vice-versa too).

Change-Id: Ifef3f65ab8e4e21a2f7fdba7fa5f0fc566153649
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit cb9b46ef70f06c51aea01e83dd07d21a56627a50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 00:05:26 +00:00
David Faure
f5cdefb3ab Move QNetworkManagerNetworkInformationBackend to its own header file
(in preparation for the next commit)

Change-Id: I1a6771dc953540dfa63cb80306a48122e97eb600
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
(cherry picked from commit 9468c0e3ca4b145ffadc83170c804db5fbf0895a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-14 00:05:17 +00:00
Volker Hilsheimer
11db1179a8 QColorDialog: Add trailing comma to new enum value
As commented in header review, this will make future header reviews
less noisy.

Change-Id: Ia75e51facec100172de7dbb0854830d9981f0552
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit ab6e3c59a35e94a6740ae593b6101144fb65e089)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-13 17:53:52 +00:00
Giuseppe D'Angelo
2c10bc7e12 QImageIOHandler: doc tidies
Remove a "." after the enumerator names that would end up in the docs.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: I6db1e83331552a58f77479166a67b88bb25f2d6e
Pick-to: 6.6 6.5 6.2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit e366a47d65c782055a9e361ad7e18bda6cd33780)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-13 17:53:52 +00:00
Axel Spoerl
b30f214681 Remove dead code from tst_QMessageBox::staticSourceCompat()
Remove if (0) clause.

Task-number: QTBUG-118489
Pick-to: 6.6 6.5
Change-Id: Ie1c72e9c7cacb90d9e4d85763cd2f6967a7572cd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 09eb99f0116b459a9ce5f720ee1a6d9715f157ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-13 17:53:52 +00:00
Liang Qi
b70496888c tests: skip tst_QShortcut::applicationShortcut() on Wayland
Task-number: QTBUG-120334
Change-Id: I0c71c6f474f1a0f31bc823579a54556a3e64bda2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d14a1ceffb87b6b62b6a79625be190d40ca9630d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-13 17:53:51 +00:00
Kai Köhne
bfc841f149 Fix warning on SQL Browser startup
Browser::addConnection is not a slot/invokable, and requires arguments.

What was probably meant to happen is that the connection dialog
opens.

Pick-to: 6.6 6.5
Change-Id: I4e6bffb3e0277ca3deb7111cf4bb47ff188f6f16
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 3552afe38a6ba3feebe4fd9ecd561a8c0c2b9717)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-13 17:53:51 +00:00
Liang Qi
0b04acd1f0 tests: XFAIL tst_QShortcut::windowShortcut() on Wayland
Task-number: QTBUG-120334
Change-Id: I6cafda6fa8f8c9b20a6695b982413057ddf56dd2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit cf0d34bf18cc1dcac0bdfbed5b2be10c79902543)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-13 17:53:51 +00:00
Axel Spoerl
08d282b451 API Review / QDockWidget: Fix TODO comment
Use ### Qt 7 syntaxt instead of TODO.

This amends 3aaeef59fba8e8c6cf168a26cffc054375c7c21b.

Change-Id: I0354debbe43796aa6bd2cf04d567fd932fde3c66
Found-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Task-number: QTBUG-119952
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 24d84a86cffe07f27965cb3e4b32aa78f4c76977)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-13 17:53:50 +00:00
Florian de Gaulejac
8e424eba74 syncqt: always use absolute path in the generated headers
The relative path + source path can be tool long for windows

Fixes: QTBUG-120758
Pick-to: 6.6 6.5
Change-Id: I42ed4f3bbf39d31bf37a5bc76eb18f473661346b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit b4246a5c28472de3c4b6a85a3daf4a1d578894ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-13 17:53:50 +00:00
David Faure
54e2ec9b8a Doc: fix typo in QGraphicsView::rubberBandRect() method documentation
outise -> outside

Change-Id: I143430b3c6661cf5259a09ffa64b74a220e2b979
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 47c5f6b4c2a66db7d169fed451f08af6fbe21c39)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-13 17:53:50 +00:00
Christian Ehrlicher
9622c7797a Styles/fusion: Adjust QSlider painting with modified paint rect
When the painting rect is adjusted within an overloaded
QSlider::initStyleOption() there are some glitches when using the fusion
style:
 - the tickmarks are not painted inside the specified rect / it is
   ignored
 - the glue groove bar is clipped incorrectly

Pick-to: 6.6
Fixes: QTBUG-111314
Change-Id: If140c5348031d869b527c6c4850b4a8d34b395c1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 8594fe1b8dc848d8a2d61197acce67963f5fe20e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-13 17:53:50 +00:00
Volker Krause
33b4c2d4af Fix opening temporary content: URIs from application content providers
e5d591a0d09 focused on document or tree URIs you'd get from the file
dialog, but we can also get ones via Intents from application-specific
content providers (e.g. opening an attachment from an email client).
Those need to be handled like a single document here, parsing them
like a tree URI results in a bunch of Java exceptions down the line.

Change-Id: I19cb1075fd6a3ccad927543f8bc5a63566f4877e
Pick-to: 6.6 6.5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9d4a34bbbe7ec39ef594b07aae06fc1029cc6e3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-13 14:04:35 +00:00
Tor Arne Vestbø
3bc3cf3ba9 Sync QWindow visible state during QWidget destruction
A call to QWidget::destroy() will end up in QWindow::destroy(), which
calls QWindow::setVisible(false).

A call to QWindow::setVisible(false) on a widget's window will under
normal circumstances end up in QWidgetPrivate::setVisible(), which in
turn recurses back into QWindowPrivate::setVisible(), via
QWidgetPrivate::hide_helper(), ensuring that the QWindow internal
state is updated, visibleChanged emitted, and show/hide events sent.

Durin QWidget::destroy() we end up in QWindow::destroy(), which calls
QWindow::setVisible(false), but in this case the widget no longer has
Qt::WA_WState_Created, so the hide_helper() call is skipped, and the
corresponding QWindow is not kept in the loop.

To work around this we could have checked for windowHandle() instead
of Qt::WA_WState_Created before calling hide_helper(), but that had
many other side effects, so we opt for a more targeted fix.

Pick-to: 6.6 6.5
Change-Id: I68f80e5f7df9ee811afcd274a7ee4de31a110da5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 5b09d9e6d694045a6cef15f8984bab63cf86402c)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-01-13 11:49:33 +01:00
Thiago Macieira
0523b04216 QUrlQuery/Doc: fix resulting query with ( and ) delimiters
There's no final ) because there's nothing there to be delimited.

Pick-to: 6.6 6.5
Change-Id: I6e2677aad2ab45759db2fffd17a4ce4aa902e140
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 88e41fd03481d490e7fcf9429849c8fa5a5743e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-13 01:30:23 +00:00
Assam Boudjelthia
86f840fb02 Revert "Bump androix dependency to 1.12.0"
This reverts commit 3bae65e7d61f85d2942c89e46e913c1056ba2daa.

Reason for revert: This version requires API >= 34 but we have AGP
7.4.1 which was tested against API 33 max, and updating it to version
8.x is blocked by QTBUG-106907. So, this will be re-stated AGP update
is done.

Task-number: QTBUG-106907
Change-Id: I1551ace76392a0532e1ecf431d03afbbd9d4a300
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 91b0f269ba8fc0ae16f96b18327b5aa30718b313)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 21:41:52 +00:00
Thiago Macieira
946f39b477 QSemaphore::release: Revert "Optimize cond var notification"
This reverts commit 60113056bc4c328f62808d1c0fa2a1abec481f78. Calling
    d->cond.notify_all();
without the mutex means that another thread could acquire the semaphore
(acquire the mutex, subtract from d->avail, return to caller) and
destroy it. That would mean this thread is now effectively dereferencing
a dangling d pointer.

Fixes: QTBUG-120762
Pick-to: 6.6 6.5
Change-Id: I196523f9addf41c2bf1ffffd17a96317f88b43dd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
(cherry picked from commit 763ab0e6236de80a0b589fc574c75a414d86d374)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 20:01:32 +00:00
Ivan Solovev
5b8515bae7 QCborStreamReader::lastError() - fix REMOVED_SINCE version
The definition in removed_api.cpp is added within the proper #ifdef
block, only the version in the header was wrong.

Amends 8e8815b688684f5b267db1c2d8ac99c8f7f7637a

Found in 6.7 API Review

Change-Id: I0a94bfaae8b3db700c794aa83d9637ec85edffb1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a4518cc706ed9ef8ed7fd79ed3423b64c6d1fb93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 16:54:07 +00:00
Christian Ehrlicher
eb31663d03 QFusionStyle: fix painting handle with tickmarks enabled
The handle was drawn outside of the widget's rect when tickmarks were
enabled (TicksAbove/TicksLeft).

Pick-to: 6.6 6.5
Fixes: QTBUG-83604
Change-Id: Iff3a1a330317576a759e3fd6795d0b4849e2044b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 574692e5ac95e1f2061812a43f14d325c077b7c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 16:47:37 +00:00
Christian Ehrlicher
43c220149f QIcon::availableSizes(): don't return duplicates
QIcon::availableSizes() returned duplicate sizes when there are pixmaps
with a different dpi but same size. This is not useful and therefore
filter them out. Also rearrange the conditions a little bit to bail out
on wrong mode/state early.

Task-number: QTBUG-119915
Change-Id: I9d18c78fc2a149a3a9eaaed67c6110979029705b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c53b91cc12164d779a69c2526d85e3ab9c2841e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 16:47:36 +00:00
Christian Ehrlicher
8e6b46fa65 QComboBox: ignore hidden items when calculating popup size
The popup size depends on the max visible items property. But the loop
did not ignore the hidden items which results in fewer items in the
popup than allowed.

Fixes: QTBUG-120574
Pick-to: 6.6 6.5
Change-Id: Ic3c503a5272d6839aee158740e096405ca8887d6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 742be5254c9919e8c743b8b489c054d778ee4850)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 16:47:35 +00:00
Artem Dyomin
12fb9c4dbb Add an opportunity to grab via QOpenGLCompositor to FBO
The feature is needed for screen capturing Qt multimedia in order
to have better performance of getting frames
(avoid recreating fbo). In QtMM, we're going to create FBO
and use it as a hw frame (or just render it to image on the first stage)

Pick-to: 6.6 6.5
Change-Id: Id08a86b76447faa0f341c6967c2dad8f34c84959
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit b96160191fc79514173b202bf6325553a798926d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:04 +00:00
Alexey Edelev
4dfaabce57 Add the support of the qt_import_plugins functionality to androiddeployqt
qt_import_plugins allows to control application deployment on
non-Android platforms. This adds support for the pre-defined plugin list
that is computed using the qt_import_plugins input.

Pick-to: 6.6 6.5
Task-number: QTBUG-118829
Change-Id: Iaa9c3f600533a4b5a3079ab228fabf212d9ce5a5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 438837ce274fdc1457b66179b25df40f33b23a15)
2024-01-12 11:06:04 +00:00
Milian Wolff
45f5991e60 Fix potential leak of QPropertyAnimation in QLineEditIconButton
When startOpacityAnimation is triggered and the animation doesn't
finish, it might get leaked during shutdown as shown by valgrind:

```
==133963== 600 (16 direct, 584 indirect) bytes in 1 blocks are definitely lost in loss record 2,326 of 2,356
==133963==    at 0x4841FA3: operator new(unsigned long) (vg_replace_malloc.c:483)
==133963==    by 0x12698E2D: QLineEditIconButton::startOpacityAnimation(double) (qlineedit_p.cpp:437)
==133963==    by 0x1269900D: displayWidgets(std::vector<QLineEditPrivate::SideWidgetEntry, std::allocator<QLineEditPrivate::SideWidgetEntry> > const&, bool) (qlineedit_p.cpp:459)
==133963==    by 0x126A1084: QLineEdit::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_qlineedit.cpp:276)
==133963==    by 0x152D781E: void doActivate<false>(QObject*, int, void**) (qobject.cpp:3935)
==133963==    by 0x1269AB01: QLineEdit::textChanged(QString const&) (moc_qlineedit.cpp:447)
==133963==    by 0x126A0EF8: QLineEdit::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_qlineedit.cpp:255)
==133963==    by 0x152D781E: void doActivate<false>(QObject*, int, void**) (qobject.cpp:3935)
==133963==    by 0x126A1A94: QWidgetLineControl::textChanged(QString const&) (moc_qwidgetlinecontrol_p.cpp:273)
==133963==    by 0x126A4C35: QWidgetLineControl::finishChange(int, bool, bool) (qwidgetlinecontrol.cpp:736)
==133963==    by 0x126A4F05: QWidgetLineControl::internalSetText(QString const&, int, bool) (qwidgetlinecontrol.cpp:772)
==133963==    by 0x12698AF4: setText (qwidgetlinecontrol_p.h:251)
==133963==    by 0x12698AF4: QLineEditPrivate::setText(QString const&) (qlineedit_p.cpp:277)
```

Note that the line numbers above are potentially slightly off as that
backtrace was recorded on Qt 5.15.9.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ie79744d98d2783e4644e18ec51892c0bc43c1557
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 76845e1d31a61735a0f0261fbc15ed7ea5ff71dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:04 +00:00
Marc Mutz
5981ceb865 tst_QCompareHelpers: fix narrowing warning
Warns MingW (or, in general, any GCC 13):

   warning: converting to 'QtPrivate::NativeFloat16Type' {aka '_Float16'} from 'double' with greater conversion rank

See also a61d7529511c890aa595110b9320ea0bf53dd623.

Fix by using ints instead.

As a drive-by, make the variable constexpr.

Amends 4b755bc11a8eadd156c65b7474c11e3ce822c6f1.

Change-Id: Ie3f3c51aa7e9323c7ba96c810d2e95247d222fd2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6d005b7c570f2ad25cf2b88329a2f99ab20b8787)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:03 +00:00
Ahmad Samir
af4b240b28 qassert.h: fix typo
This amends 14d1108d3562f6e409505ba49b7bce82d70bd64f.

Change-Id: I542659a9e518f0328018142a83d3171e9474e5b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7b3da9aa0421369f84e7a1ea32df350821440d4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:03 +00:00
Marc Mutz
5b856ba18f [docs] Remove references to C++11 feature availability
QVersionNumber, e.g., was added for Qt 5.6, the last Qt version that
didn't require C++11. So it made sense that the original documentation
stated that certain functions were only available in C++11 mode.

But already Qt 5.7 required C++11, so these historical anecdotes are
no longer pertient to today's Qt users, so remove them from the docs.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I5c732d3b9b33e1fb6947eff4fac546476c8379f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4f3142bfce0c64d023299f142d14e60ec577b698)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:03 +00:00
Marc Mutz
bae8ce371a Fix some -Wunused-* warnings on MinGW
Found while inspecting a recent MingWG log file from the CI.

Amends a2551c45d496c23045eb8451e080e75b2f8b42c1.
Amends f992402f15fd117bb5ccf9a484bf31fd4f4967e2.

Pick-to: 6.6
Change-Id: Icf56ddc19ac7b40718ec3f429d14cbcb1a2e164f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9aaf1a031befc39244290c63f3905896934f6082)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:03 +00:00
Marc Mutz
ea57719d56 tst_moc: fix some -Wunused-* warnings on MinGW
Found while inspecting a recent MingWG log file from the CI.

Amends da284ef10e0ef80776b9fc9b7bb0e6dc8d71ba63.

Pick-to: 6.6 6.5 6.2
Change-Id: Ife10118710079e60c581314fa857be42452fe810
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 56ca2595526360f98d7824d815552635f87f178f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:03 +00:00
Marc Mutz
22f0d3164e tst_moc: DRY QProcess success verification
While the code that checked that exitCode() == 0 was still consistent
between all the callers, when it comes to checking stderr, there were
several competing implementations, incl. checking the exitCode and
dumping stderr to qDebug(), and using QCOMPARE to QByteArray(),
presumably in order to get more detailed output on error. Alas,
QCOMPARE's toString() truncates output pretty early, making it
impossible to see what's going on on failure.

So write a small macro that checks the exitCode _after_ it checked
that stderr was empty (printing it in full if it was not), so we
consistently get the error message instead of a truncated version, or
just "exitCode() != 0" without further details.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ic8547fda3b02c645901962887c6ed7aad01f6ea4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 93af86bad566bf4c2c0a5fa7f64e84daaa20a311)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:02 +00:00
Marc Mutz
6ceab7ec35 QHttpHeaders: add value(name, fall-back)
The vast majority of header fields appear only once, but there was no
efficient way to get that value: values() returns as a
QList<QByteArray> (allocating) while combinedValue() returns a
QByteArray constructed from values().join() (also allocating).

It follows that the QHttpHeaders API is incomplete (lacks an efficient
basis of operations in EoP terms).

Add a value() function that returns either the value or a
user-provided fall-back as a QByteArrayView. Unlike values() and
combinedValue(), this function can be noexcept, greatly improving
codegen for callers.

Found in API review.

Task-number: QTBUG-107042
Change-Id: I2da20815fd46fdd7f150c224f41eee53abed313e
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 7897ec88f426773cea38ce8c21091a05718a09e7)
2024-01-12 12:06:02 +01:00
Marc Mutz
a08ba69d48 tst_QHttpHeaders: DRY the value() test
Clean up the C'n'P in the test a bit before adding tests of new
functions.

Task-number: QTBUG-107042
Change-Id: I2da20815fd46fdd7f150c224f41eee53abed313d
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 789cbeacdf1b894cde5e6cd6affc41d154716435)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:01 +00:00
Marc Mutz
54dcacf5c0 tst_QHttpHeaders: don't convert QAnyStringView
QList::contains() supports heterogeneous lookups, so just pass the QAnyStringView.

Task-number: QTBUG-107042
Change-Id: I442c2a6271953859dc47f9c3bd5cbc0074f55a9f
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 2c65f2cd11e1529b028ed65e08eb672364f777fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:01 +00:00
Marc Mutz
7c4e260164 QDBusMessage: make private ctor explicit
Found in API review.

Change-Id: Ia0a3fa388c13d76c2b12b73d5e760b13021fa072
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3c6320c41869e60a44da85d3d11e18e9914c9ca3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:01 +00:00
Marc Mutz
68deb79e2d tst_QHashFunctions: extend the consistency() test with mixed-signedness int types
Looking good, because all signed integral qHash overloads are implemented
by casting to the unsigned type before hashing.

Pick-to: 6.6 6.5
Change-Id: I8372eb6d4a57b40c2371db58d1b5aeabe9a3951a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7d1f29df795e3e1635204b656b368582ed6942ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:01 +00:00
Marc Mutz
1482081ced Dissociate QTypeRevision from QVersionNumber
They have nothing to do with each other, so give QTypeRevision its own
header and implementation file instead of piggy-backing on
QVersionNumber's.

Picking back to current LTS to incur the merge conflict only once, not
per (expected) follow-up change.

Amends ed080c64ae21d22115d16780a5903d7cc4fd1546.

Pick-to: 6.6 6.5
Change-Id: I2fa5d0e68f95864126bc95e3d8154134eee85553
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 37e2aa7698a16fb5bc0d2f74388620d921d977c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:01 +00:00
Allan Sandfeld Jensen
2f59eee2bc Fix premultiply of RGB64 formats
Alpha was also multiplied, leading to wrong alpha values.

Change-Id: Ic452b21f5f02898074552afd68440193b60799c1
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-120614
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit c0a448d5c38557adac915342034263ae8a4908e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:00 +00:00
Tomasz Kozłowski
60f394d357 Skip test which resizes window with EGLFS
This test is resizing window, which is not supported in EGLFS,
so it needs to be skipped.

Task-number: QTBUG-115777
Change-Id: Ie136f6565b4d466bc62c4e2ebe2337488b5003b4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit bb07c4a37be383f27a2473400fbe3cda730eebd3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:00 +00:00
Tomasz Kozłowski
eab6de2eec Add styleHint function override for QEglFSIntegration
Without this change, while using EglFS, showIsFullscreen returns false,
which is not true, because EglFS always runs in fullscreen.
This change requires setting QT_QPA_PLATFORM_PLUGIN_PATH
environmental variable.

Task-number: QTBUG-115777
Change-Id: Ie7cf709e002ac70d95fe5e2698d2ee7b52e08094
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b09a70ce614faa8b0beaa86af2acb9b10a25aac8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:00 +00:00
Wladimir Leuschner
da28d17eaf Fix ItemView editing look and custom background color on QWindows11Style
Disable text painting, when current item in ItemView is in editing mode.
Respect custom set background colors for items in ItemView.

Fixes: QTBUG-119501
Change-Id: I0cc80459e67765b2e648aa438aabc7dc18bef4a9
Reviewed-by: Chris René Lerner <chris.lerner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 5d590a38d96206bcf5ad6ffe2b156223dc909fd7)
2024-01-12 11:06:00 +00:00
Ivan Solovev
41a605e0f2 Fix QThreadPool::maxThreadCount() usage
The docs claim that QThreadPool always creates at least one thread.
However, the user can (usually by mistake) request zero or a negative
number of threads.
The maxThreadCount() function is simply returning the value, that was
requested by the user.
Since it's a public API, it is used in several places in QtConcurrent,
where it is assumed that the value is always positive. This can lead
to a crash if the user sets zero as a maxThreadCount.

Update all such places with std::max(maxThreadCount(), 1).
Prefer this approach over changing the return value of
maxThreadCount(), because its behavior is documented and tested.

Amends 885eff053797d56f2e295558d0a71b030fbb1a69.

Fixes: QTBUG-120335
Pick-to: 6.6 6.5 6.2
Change-Id: Id3b2087cec7fbc7a2d42febca6586f2dacffe444
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 936e72d18075b79c8d29353618dfbd052ae59dae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:00 +00:00
Ivan Solovev
7f6b62f3fc QFuture: immediately delete watcher after the context is destroyed
We used deleteLater(), which was triggering ASAN use-after-free error.
Apparently, what could happen is that after the context was destroyed,
we called deleteLater(), but if at this point the previous future got
finished, we still tried to emit watcher->run() to execute the
continuation. And then the watcher got deleted.

This patch replaces deleteLater() with a plain delete call. This looks
safe, because the watcher is only accessed while holding the lock.

Amends 59e21a536f7f81625216dc7a621e7be59919da33.

Fixes: QTBUG-120302
Pick-to: 6.6
Change-Id: Ia32f20bfe8daea2e2346f3d446c978ae305d2f68
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 11333a097290e4247b27adbfd024d5aa964bed35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:06:00 +00:00
Ivan Solovev
e7a9c8a559 Simplify qCompareThreeWay()
Use QtOrderingPrivate::reversed() in qCompareThreeWay() to avoid
conversions to Qt::partial_ordering and Qt::strong_ordering.

Task-number: QTBUG-119433
Change-Id: Ia42bda518dcf23f5332cac9bb8d50baebef67e55
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 0995358efabc91504f2ede20c724307358f9a276)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:59 +00:00
Volker Hilsheimer
82105e82e5 Doc: complete the snippet for a dialog with extension
Add the setting of the layout's size constraint to 'fixed' back to the
snippet, so that the dialog automatically resizes when the extension
gets hidden. The user won't be able to resize the dialog, but allowing
the user to resize the dialog and to show and hide the extension anyway
leads to unpredictable results for the user.

Amends 11da92ba94570e5eec01597fe09f0a9a48acc677.

Pick-to: 6.6
Change-Id: Ie74ca36eaa1a8e9567e0d5826f91f8633e5cbc05
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 51a1dfe72ddd922cd6caf28d532b3311db767989)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:59 +00:00
Christian Ehrlicher
d84b6079f8 QColorDialog: Use pmf-style connects
Port all string-based signal/slots connections to pmf-style connects.

Change-Id: If1075a5a8a4d018e060e7d18ee59c8fc4c0a5207
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 7dd4a7b2133b9a6aa4f67a3ff5760303af68ac54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:59 +00:00
Christian Ehrlicher
2e9347dfce QLabel: Use pmf-style connects
Port all string-based signal/slots connections to pmf-style connects.

Change-Id: I888fe3d0022fddbe7ba391dc6841c3ea6b9d1d4b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7efd3c2718a3d0dd656038ee7cd4eb992a6f2f80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:59 +00:00
Christian Ehrlicher
a91c2b8c71 QSidebar: Use pmf-style connects
Port all string-based signal/slots connections to pmf-style connects.

Change-Id: I4ebabf1b117f86f39d3875965efa8ee5042bce84
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b71aa162c00ff180cc946b8fd6c9c670d04ec262)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:59 +00:00
Christian Ehrlicher
144fcb8e79 QInputDialog: Use pmf-style connects
Port all string-based signal/slots connections to pmf-style connects.
Exception: Private::ensureEnabledConnection(QAbstractSpinBox*)

Change-Id: Id88fe88a1f9071085a159e1fa6429a6ec02e61bb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4fdcb1212d1a67d2e4b5aed28095e22e609d530a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:58 +00:00
Christian Ehrlicher
f433e57e53 QFontDialog: Use pmf-style connects
Port all string-based signal/slots connections to pmf-style connects.

Change-Id: Ic7ecfd1efb8eb76239598e48f25251357040f814
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit fb58a3aabe8ff9956560dea64c91cd8727da839d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:58 +00:00
Christian Ehrlicher
9c83da5556 QMessageBox: Use pmf-style connects
Port all string-based signal/slots connections to pmf-style connects.

Change-Id: I7d77c2a10ed0c27422893403dfc9c5a6d43ea798
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e5c40ec5c117376f401c01069f05780046d07094)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:58 +00:00
Christian Ehrlicher
4fec40e67e QLineEdit: Use pmf-style connects
Port all string-based signal/slots connections to pmf-style connects.

Change-Id: I975232a3fedf82cd3327638a0ee119d1f2a90d84
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit bbdc8afa116155a9e8353f1d39af19a2228e3412)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:57 +00:00
Christian Ehrlicher
47cdc81e94 QFileDialog: Use pmf-style connects
Port all string-based signal/slots connections to pmf-style connects.

Change-Id: I6121e727c2730f9e5947f9f3b7550903bb17aee0
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e03e2e9886ad36f7c3cc0eafd75be81a84f955ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:57 +00:00
Juha Vuolle
a1cc252130 Rename the replace() function's value to newValue to reflect its role
Found in API-review

Change-Id: Ib047c79d977ad6870c1e426cd1add994a3634df4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 723ab99b1ac55c8d32a93ea80224d7ffb22f7893)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:57 +00:00
Juha Vuolle
a18964adf0 Rename qnetworkrequestfactory's request() to createRequest()
Resulted from API-review

Change-Id: I09349dbddbfc191d871563b834396b387c6153c9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit f0db08088025005c765037ae53216fb7ee45c29c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:56 +00:00
Jarek Kobus
31a94ee00d QObject: Make it clear we don't install duplicated event filters
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I3048b50700880dd2445a5a65823fef02b196ce7d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 43de84644292978f2b8bce209830cf14d5384904)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:50 +00:00
Marc Mutz
78da624d7f QRestReply: include / fwd-declare what you need
Don't depend on transitive includes and forward declarations.

Found in API-review.

Change-Id: I61b9517453f164391abb9254d92e7ea38051e730
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit fbe29fb3684b02bec5f6019755d0a1bb0c94c275)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:50 +00:00
Juha Vuolle
980b57e85c Change QRestReply json return type to QJsonDocument
The json return type and function naming has gone back
and forth. Let's go with QJsonDocument after all, and add new
overloads in future if necessary.

Task-number: QTBUG-119002
Change-Id: I3f9de0e6cba7d5c52d016d252d65b81f345af050
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 1702a37a3955f449210fe3874cfcd35bb08417ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:50 +00:00
Sune Vuorela
5f55f6c8ab Don't show mnemonics in dockwidget titles
One might want to add an accellerator to dockwidget titles to be used in
contexts that isn't directly the title, but still uses the title.

Dockwidget title accelerators doesn't work in dock widgets, so don't
show them.

They are still available in e.g. a right click menu on a dockwidget to
hide/show, and here the accellerator might come handy, and also if a
dockwidget is tabbed.

Pick-to: 6.6
Change-Id: I196e1aa92a5c53fed735b598653c267509f788b8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
(cherry picked from commit cc67b25579c1bb5ea9f5c1ca4c9b7997e66f19b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:50 +00:00
Alexey Edelev
5d9c9fe8f7 Use target-specific android-build directory
This fix allows using multiple executable targets in a single
CMakeLists.txt when building for android. Previously artifacts for both
targes were collected in a common android-build directory, that led to
artifacts overlaping and broke the deployment process.

Users need to set the QT_USE_TARGET_ANDROID_BUILD_DIR to TRUE to enable
the new android-build directories naming.

This change need QtC adjustments that will take a new directory naming
into account.

Task-number: QTBUG-117443
Pick-to: 6.6 6.5
Change-Id: I47568798e2a2e8550ddab1990a33611967183761
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 5f0575256a4af14c1f2f9a846e40cd9490c12b56)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:50 +00:00
Alexey Edelev
273f1ffbf6 Disable AUTOGEN for resource object targets
It looks like resource object targets don't need AUTOMOC as well
as other AUTOGEN tools. The only source file skips autogen explicitly,
but AUTOMOC requirement is added to the resource object targets anyway.

This disables all AUTOGEN related properties explicitly for all
resource object targets.

The problem occurs when building top-level Qt with the static library
that uses resources in tree.

Pick-to: 6.6 6.5 6.2
Change-Id: I5c968a3e34c881e7fbc5589626ab02b3b1e53968
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit dd4c14104cfab6330b31937acf2b2f120ef940a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 11:05:50 +00:00
Christian Ehrlicher
4bc230ad05 SQL: rename enablePositionalBinding() to setPositionalBindingEnabled()
... and the getter to isPositionalBindingEnabled() for QSqlQuery and
QSqlResult.
This amends e532933a2a9ff0219f0179880e05c95e0ec5e19d

[ChangeLog][QtSql][QSqlQuery] Add setPositionalBindingEnabled() to be
able to disable positional binding.

Task-number: QTBUG-119952
Fixes: QTBUG-120548
Change-Id: I0a0afb652d0fc9421f5692b0927a66b2a9b7b854
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit b1e5d9275d4cf6152e4e9456b1bc2d585a5512e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 05:57:12 +00:00
Christian Ehrlicher
656576d3b4 CommonStyle/QSlider: use drawLines() instead single drawLine() calls
Optimize the painting of the tickmarks by collecting all lines to draw
in a vector and then passing all to the painter instead calling
drawLine() for every single tickmark.

Change-Id: Ic75e733a02fbf6143d21d4630f6a6d6de913f16c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 83ab7d21150115fbbe954af7d87f1597bf65d206)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 05:57:12 +00:00
Christian Ehrlicher
5278624b62 CommonStyle/QSlider: don't modify outline color
The outline color was modified under some conditions but used afterwards
independently from this condition which lead to a wrong tickmark color.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I45baf9127aea96bfe84a7410dd592a084f14f13c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e9438da42a2ce3c470df01f82245dbfa7901f8db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 05:57:11 +00:00
Christian Ehrlicher
7c22796a97 QWindowsSystemTrayIcon: use high-dpi icons for notifications
Do not downscale the icon used for QSystemTrayIcon even though the msdn
documentation states that SM_CXICON/SM_CYICON should be used as the
size to avoid blurry icons in the notification.

Pick-to: 6.6
Fixes: QTBUG-103825
Change-Id: I2d466e895254aa3c41682290cc7864632c57d5d7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 94809cdec004611bdb8531304e6c74761014876b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 05:57:11 +00:00
Christian Ehrlicher
ac04f0397b QCommonStyle: use themeHint(IconPixmapSizes) in iconFromWindowsTheme()
Sync iconFromWindowsTheme() to use themeHint(IconPixmapSizes) similar to
iconFromMacTheme().

Pick-to: 6.6
Task-number: QTBUG-52622
Change-Id: Id06454b010b1946ee0565190672ee8624cffe2de
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4d2802702e519c7513440ea485b19ff611696fa1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 05:57:11 +00:00
Thiago Macieira
a13d7d6596 QDataStream: add missing #include <iterator>
For std::distance() and std::next().

Amends 003c29511de5979fba526acd62f2a4c7c356b982.

Pick-to: 6.6 6.5 6.2
Task-number: QTBUG-114583
Change-Id: I6e2677aad2ab45759db2fffd17a7318d396cbc4d
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 44b7b1d11b7c83b1f19df915577224f97371c655)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 02:18:36 +00:00
Thiago Macieira
923918c66b QString::arg: don't pass nullptr to memcpy()
A null QString / QStringView has a null begin pointer stored as its
array beginning (something we hide a little in the QString::data()
function, but not in QStringView::data()). We've been passing a null
pointer to memcpy() every time someone passed a null QStringView for
QString's single-argument arg() call, though not the multi-string arg()
version (which is the only one QStringView offers).

Commit f5021835dfb4b0bf974794b598cbdf9f0f95898d made this worse by
making QStringViews created from null QStrings retain the nullness (as
was intended).

Fixes: QTBUG-120624
Pick-to: 6.6 6.5 6.2
Change-Id: I6e2677aad2ab45759db2fffd17a870639b19340b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d351a97e85e5ed8acd7ad1357ef76dc2e0ad639f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 02:18:20 +00:00
Assam Boudjelthia
5260dcc614 Android: skip vulkan tests for tst_qrhiwidget
Task-number: QTQAINFRA-5971
Change-Id: I61b7e3ef491e4e12c5ee5d95d89a7a510ba328c4
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit bba26d72207304e02098d1436232357dd452de2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-01-12 01:18:24 +00:00
GHENADY
8b567e90be Fusion style: QGroupBox title vertical alignment
Take vertical alignment into account in QFusionStyle::subControlRect().

Pick-to: 6.6
Fixes: QTBUG-67708
Change-Id: I9da23a4689565c8dba9fed9ef75d3c640ce77e3f
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 2e625c55b346a727b39b8c5cddc37839b49ba5a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-29 10:19:42 +00:00
Jaishree Vyas
605f9413aa Doc: Rearrange best practices and how to documentation
Change the best practices to how-tos, which are categorized
now on a new page.

Fixes: QTBUG-118044
Pick-to: 6.6 6.5
Change-Id: I78dba2a1fde03b346f110ecd54e11485a0869540
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 7372b3ab6748b68f1c5fba1f61df8083ce719bc5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-28 16:16:27 +00:00
Kai Köhne
246d243e8d Doc: QAndroidScreen:displayId(): Fix capitalization
Change-Id: Ib005db7fd9317250f5a4cf22ff3422eb83ed787c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit c34c887318c73daaab4610ad2c0d3d3072e1a934)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-28 16:16:26 +00:00
Chris Von Bargen
253957b940 Add parent arg to QFileDialog::getOpenFileContent and saveFileContent
This change updates getOpenFileContent to provide a parent when the
non-WASM fallback to a QFileDialog is created, which avoids issues
where this call is made inside another application. Specifically,
if a QDialog is created lacking a parent to the main window, it will
prevent interaction with that dialog. This patch addresses that problem
with window modality.

This change also updates saveFileContent to provide a parent for
the fallback mechanism, so that both static APIs that interact
with WASM/non-WASM dialogs have comparable behavior.

The new parent argument is updated in the documentation. Documentation
is clarified in terms of usage outside Qt for WebAssembly.

[ChangeLog][QtWidgets][QFileDialog] Adds an overload to the
static methods getOpenFileContent and saveFileContent with a
new parent argument which always no-ops in the WASM environment.

Fixes: QTBUG-118396
Pick-to: 6.6 6.5
Change-Id: Ic59aee386631172d4a29b42fe11e5af318474a1d
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 7c5cf8cae054954975a3e262f7fe3cd9897d67f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-28 16:16:24 +00:00
Christian Ehrlicher
433feb87c0 tst_qmdisubwindow: re-enable setFont() test
This test was disabled during Qt5 porting because it was unstable.
According to the discussion in the bug report, a deprecated function was
used to wait for the window to get exposed. This was later replaced by a
more robust QTest::qWaitForWindowExposed() but the test was not
re-enabled again.

Fixes: QTBUG-22544
Change-Id: I3190e38c1f42dc719803a60e66a86c3773cbedcd
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit ce8c81555de31641041730df08be257cf0ddc221)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-28 16:16:22 +00:00
Piotr Wiercinski
a625d521f7 wasm: Fix handling of promise pool in WebPromiseManager
Promises are registered upon entry to the pool and
unregistered upon exit. If all promises are in a 'pending' state,
new promises can't be processed. Upon completion of a registered
promise, it is unregistered, allowing space for a new promise.

The code path responsible for unregistering promises when they
resolve runs each time a promise's callback is called.
Unfortunately, there's no guarantee that the callback will be
invoked upon the promise's resolution. For instance, promises
registered with only a 'catch' callback may never be triggered
when the promise resolves correctly.

This commit ensures that a final callback is always registered,
even if the user did not provide one.
This guarantees that promises are always unregistered upon resolution

Fixes: QTBUG-118161
Pick-to: 6.6 6.5
Change-Id: Ifea93d692464a6ef40c4bcad60f840ca0cb650c9
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 1e6841245dca3bda5dee050fc841c7129142dd9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-28 11:57:18 +00:00
Christian Ehrlicher
41eb889352 QSqlRecord: style fixes
Misc style fixes in preparation for the new overloads taking
QStringView.

Pick-to: 6.6 6.5
Change-Id: I3b838543aefd08bf115488e571b1bb6eec8d968d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ddad911f9be71d3a1396e28261ffe386e880aa69)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-28 10:20:44 +00:00
Shawn Rutledge
d7bc61ac51 wasm: Handle stylus events by generating QTabletEvents
Pick-to: 6.6
Fixes: QTBUG-120327
Change-Id: I37a92b9850385712b638c30f9a43028d8134f416
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit bc578ec6efcf667e0be2ea5c3d68bd22135cadd0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-28 06:12:09 +00:00
Morten Sørvig
c28e68c729 wasm: implement async drag-and-drop
Make toMimeDataWithFile() handle writing files to the
in-memory file system correctly: this is an async operation
and we need to collect the files as the writes complete
and then invoke the callback once all files have been
saved. There's then no need for a global static QMimeData.

Use toMimeDataWithFile() for both the paste and drop
handling, however QPlatformClipboard::setMimeData() takes
ownership of the passed in QMimeData and the callback API
must be designed accordingly.

An open question is when we should delete the files.
Deleting them right away (after calling the app event
handler) is predictable, however it looks like QPlatformClipboard::setMimeData() retains the current
QMimeData until a new one is set, so maybe we should
follow that.

Change-Id: Ia9b825eaef1134ff9a554e51ee7e41d1c2ee779a
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 0ffe8050bd5b55d64da37f5177a7e20dd9d14232)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-28 05:34:13 +00:00
Łukasz Matysiak
ad387bf591 Skip adding a test case for a native backend when QT_NO_INOTIFY is set
Some platforms like VxWorks do not support inotify
or any similar solution for file watching.
Because of that, the implementation falls back to polling.
That means that tests that require a native backend will fail.
Fix the problem by skipping adding a test case for a native backend.

Task-number: QTBUG-115777
Change-Id: I0d683e6376a0453bd2fd591302c4f3ef7ceea87c
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
(cherry picked from commit eabef00425083f19b0da0380378e13780d44a199)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-28 00:44:02 +00:00
Lorn Potter
32212b467c wasm: write file to storage on drop
Change-Id: Ibd1b5d623da07ad611cce577929a23ba991b6738
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-12-27 21:40:29 +00:00
Allan Sandfeld Jensen
e92dd3c091 Deduplicate mapping code in QTransform
Also means these mapping can now also handle overflowing perspective
better.

Change-Id: Id506634c445521f1b041ec2e9051aa499c24671b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 1f32345a9a30ec11e9213d87b6b18b56beccbe2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-27 21:40:00 +00:00
Lorn Potter
e8fa50346c wasm: add QWasmDrag back to handle drag/drop
Change-Id: I7c577e6b13db9f5c51e5691baaf6417b956a5ff4
Done-with: Mikolaj.Boc@qt.io
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit e62fd1b7062af421cd289ff542514bd4332e1933)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-27 19:08:19 +00:00
Alexey Edelev
c257e2bf99 Fix the qtliterals documentation
Use QString as inheader record as the place of definition of both
Qt::Literals and Qt::Literals::StringLiterals. Previously mentioned
headers never exist.

Fixes: QTBUG-120379
Pick-to: 6.6 6.5
Change-Id: I104f73b338a144ef5f296500a9a4368cd3791750
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 8081c618827403b2658236d6fefbca0e88517303)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-27 13:33:42 +00:00
Lorn Potter
6b9270fd72 wasm: move DataTransfer to dom::
Change-Id: I069292154bafd1c08a0d0f2e8a62052f596a80f3
Done-with: Mikolaj.Boc@qt.io
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-12-27 06:55:59 +00:00
Lorn Potter
d048249c33 wasm: move image to web conversion to dom::
This allows other areas to utilize this

Change-Id: I4bc7e8374289a19afe8b639b2b3b0dc0f8f65a3a
Done-with: Mikolaj.Boc@qt.io
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-12-27 02:29:40 +00:00
Lorn Potter
a7bf26642b wasm: extend qstdweb to support objectUrls in File
Change-Id: If346f8afcf4578dedccce6f768e85c7750a9de3e
Done-with: Mikolaj.Boc@qt.io
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-12-26 22:46:53 +00:00
Kai Köhne
e853c83491 Use BSD-3-Clause license for CMake files
Pick-to: 6.6 6.5
Change-Id: I7012a7b6424c395dfbf37af48561169ecf138af8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 44ae4b13854de56ab2ec43ebb362ae714f0aff25)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-25 20:27:10 +00:00
Rami Potinkara
19facb3748 Android: update NDKr26b and clang 17.0.2 to docs
Fixes: QTBUG-117993
Change-Id: Ice205e0f472f09fcf60ad41f4daac2cdaf3e362a
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 39290c508e2c7fa816c6f79b3eb284adc0cad3c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-23 10:48:18 +00:00
Assam Boudjelthia
d66874f13c Android: set default style extraction to minimal
The default value in the default manifest has been for few
releases, set as minimal, and since Widgets Android style
is not fully supported anymore, we can set this to default
to minimal under the hood as well to avoid needing to always
explicitly needing to set it to minimal.

Change-Id: Id0b2134c572694be1e190347ff75f51ade65f0c4
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
(cherry picked from commit ee4f91fa50fa470b4891318750bd7aad5e508124)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-23 10:48:07 +00:00
Christian Ehrlicher
76aab86de2 QWindowsTheme: honor dpr when requesting standard icons
The devicePixelRatio was not taken into account when a standard icon was
requested from the windows qpa which resulted in blurry icons for a
dpr != 1.
Therefore pass the dpr-corrected size to QWindowsTheme::standardPixmap()
and pass this size to SHDefExtractIcon() to get a correctly scaled icon.

Pick-to: 6.6
Fixes: QTBUG-52622
Change-Id: Ia771dd2f93fa133cf2c4429ef59a9c5cb05ad047
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 20cdc663b420a332d16f5f1ca82f352924cd7d1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-22 17:41:01 +00:00
Ahmad Samir
fd66400062 QObject: assert connection type isn't UniqueConnection for lambdas
An assert is harder to miss than a warning, which makes it more likely
to get fixed. Thanks to Mårten Nordheim for the idea.

Add the assert in inline code so that users compiling their code in
debug mode (or with -DQT_FORCE_ASSERTS) can hit the assert even when
built agaist a release build of Qt (not everyone compile their code with
a debug build of Qt). Thanks to Giuseppe D'Angelo for the idea.

Pick-to: 6.6 6.5
Task-number: QTBUG-115125
Change-Id: I2935d32ea5a2c288d7a836abbae66ac53cb5ab2f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit afddb327bd866ac693e475901d4d10acc6c83757)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-22 17:16:57 +00:00
Tomasz Kozlowski
621f8dc707 Skip test which resizes window in graphic scene while using EGLFS
This test is resizing top window, which is not supported in EGLFS,
so this test needs to be turned off.

Task-number: QTBUG-115777
Change-Id: Idb81802399fe5bd9af3f342692d2212cd06ead9c
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
(cherry picked from commit 061a2012ad70159ddb28a28344f67637bc965f18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-22 15:25:29 +00:00
Alexey Edelev
8bed1089c5 Fix encapsulation of qt_build_internals_add_toplevel_targets
The function uses external non-cache variable that is set in different
cmake macro. It's better to pass the value as argument.

Pick-to: 6.6 6.5
Change-Id: I282bd506cf2dcd998a0ddd7deaad244fab34a8db
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0d7cda9cdaeefe8363f44204b0cb7384ec990dc8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-22 11:53:32 +00:00
Lorn Potter
6c4fe5766e wasm: fix single thread build
Fixes linking of apps

Pick-to: 6.6
Change-Id: I9bbec9b63af8ae2801643fe124aeda8b25abeca5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit ae3506d80e11068957af38897e451cddb18bbe70)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 23:46:13 +00:00
Assam Boudjelthia
251267d439 Android: remove redundant comments from notifier example manifest
Task-number: QTBUG-115020
Change-Id: I29cd7a45f85bc85f6f12b135287b9eb868a7bc44
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit 8cc84a1386b77701ebc9c9d4efbc1b033d0e326b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 22:06:20 +00:00
Axel Spoerl
d19d32a912 QPlainTextEdit: update viewport, when placeholder text disappears
QPlainTextEditPrivate::updatePlaceholderVisibility() issued a full
viewport update, when the document became empty and the placeholder text
needed to be shown. No update was issued, when the placeholder text was
replaced by a first text character entered.
That relied on the assumption, that the placeholder text would disappear
with the first text line being rendered (even if it has just one char).

When the placeholder text covered multiple line, only the first of them
disappeared.

This patch adds a boolean to remember, that the placeholder text is
shown. If that is the case and the first char is entered, a full update
is issued, to remove all lines of the placeholder text. The boolean flag
is cleared thereafter, to avoid unnecessary viewport updates.

isPlaceHolderTextVisible() is renamed into placeHolderTextToBeShown(),
because the method returns an instruction, rather than a state.

tst_QPlainTextEdit::placeholderVisibility() is adapted to test the
boolean flag, hence the real visibility of the placeholder text.
That extends its scope to the bug at hand.

Fixes: QTBUG-119808
Pick-to: 6.6 6.5 6.2
Change-Id: I07a7059ae619dc85d0c21247d829120e6afa7115
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 729e23f15f366f013da8e149fa95e618c9a95e13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 20:43:38 +00:00
Christian Ehrlicher
fcd3cb7230 Widgets: Use pmf-style connects
Replace some more string-based connects with pmf-style to trigger a
compiler error instead a runtime error if a signal or slot does no
longer exists.

Change-Id: Ibc047cc935885a30ea58367fa97e9f962b87ca2c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 9e78256579e8dc704066a98cb4816a1aab0e7e3b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 20:43:37 +00:00
Thiago Macieira
f8a8b99f98 QObject: re-add the nameless qt_qFindChildren_helper to restore BC
Amends e608bc019232f6956c4520be1a6103a1845c6991 by adding the
implementation of this method whose implementation got accidentally
removed (because it became unused). It's added in removed_api.cpp
because, as the commit said, the cost for creating an empty
QAnyStringView is practically nil.

It's not zero on Windows, because the replacement function has five
parameters, so the last (the options) is passed on the stack. But that
is not enough of a justification to keep separate functions.

Fixes: QTBUG-120309
Change-Id: I6e2677aad2ab45759db2fffd17a29b4ec7728426
Reviewed-by: Rym Bouabid <rym.bouabid@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit efaa849023d77dfee82e4d9ff904c3711b4fb611)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 20:43:37 +00:00
Axel Spoerl
c6219ebfb5 QWindowContainer: Don't embed a QWidget
Embedding a QWidget in a window container (via its windowHandle())
may cause crashes, e.g. during drag & drop and when the application
goes out of scope.

If a QWidget->windowHandle() is attempted to be embedded in a window
container, return the pointer to the widget instead of creating a
container.

Add an autotest.

Update documentation.

[ChangeLog][QtWidgets][QWindowContainer] If createWindowContainer()
is called with a QWidgetWindow argument, return pointer to the
widget instead of new container.

Fixes: QTBUG-119113
Change-Id: Id052a03be13adce05bbd025d86270d265dfb662e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit b9ee6d3b2e465eb70ba43ea62d2ada5327a138c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 20:43:37 +00:00
Volker Hilsheimer
eb9252526e Remove the style plugin example
The snippets in the QStylePlugin class documentation show the
relevant bits well enough.

Pick-to: 6.6
Fixes: QTBUG-119974
Change-Id: Iba4a37664d64d86a2946f41d131a201ccdcd723b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5a0135fafb16203a812163f7ed55c1b981477cb5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 17:46:40 +00:00
Alessandro Portale
7d4aaa9af8 Doc: Give offline-dark.css ".qmlextra" a visible text color
.qmlextra's text color #254117 is too dark. Let it inherit a better
suited text color.

Amends: 436467134e6087ec5a0e360e1837aac4da2ce9ca

Pick-to: 6.6 6.5
Fixes: QTCREATORBUG-30117
Change-Id: Ia9e0567b0b00f2e7c1359ac85f10c72cece3c087
Reviewed-by: hjk <hjk@qt.io>
(cherry picked from commit 7b27a5b137e9b874928cebf2740520a0d98df282)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 17:46:40 +00:00
Jarkko Koivikko
dfc5e3f215 printpreview: Avoid rendering artifacts while scrolling zoomed view
Fixes: QTBUG-120107
Pick-to: 6.6 6.5
Change-Id: I4de062c9ded47cc911abc0aebf1b1b7f57ed7e09
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit f83e14b13a32b2cddff45dfdbce8e819c02aa9ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 17:46:39 +00:00
Santhosh Kumar
3999908ae5 Skip 'off-by-one' adjustment in block length during undo operation
The adjustment of block length with 'off-by-one' affects content
length during undo operation. The issue occurs when we perform undo
operation for a set of group blocks that have same fragment
position. Since their positions are same, group block change
(QTextDocumentPrivate::documentChange) with respect to insertion
doesn't affect document block length and further adjustment to
'off-by-one' without considering this leads to incorrect document
content change information (such as invalid information with regard
to characters removed).

This patch skips adjustment of group block length during undo
operation.

Amends 8fbedf2196a292fe2affcf83ddc846b9c852772a

Fixes: QTBUG-113865
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I315dcf01ba5b2f4ed6d95e9d6910d82848374aef
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 8a725084396da5872fa020212b3cb09ee40a91df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 17:46:39 +00:00
Marc Mutz
af8a9874c3 Http2: fix potential overflow in assemble_hpack_block()
The function is given a vector of Http2::Frame's and flattens it into
a vector<uchar>. While each Frame can contain a maximum of 16GiB of
data (24-bit size field), one "only" needs 257 of them to overflow the
quint32 variable's range.

So make sure any overflow does not go undetected.

Keep the limited uint32_t range for now, as we don't know whether all
consumers of the result can deal with more than 4GiB of data.

Since all these frames must be in memory, this cannot overflow in
practice on 32-bit machines.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Iafaa7d1c870cba9100e75065db11d95934f86213
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1e6bb61af3ae29755f93b92f157df026f934ae61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 17:46:39 +00:00
Thiago Macieira
60d60dba77 QDataStream & QResource: document their lack of security-hardening
Pick-to: 6.6 6.5
Fixes: QTBUG-120012
Task-number: QTBUG-119178
Change-Id: I6e2677aad2ab45759db2fffd17a06af730e320d6
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e696bec76e4f852cb28f27c50c95d3504fba559e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 17:46:39 +00:00
Doris Verria
e4c533c336 Update ImageGestures example
- Update screenshot
- Provide some information text on the screen when no images are found
- Add all supported image formats to the file filters
- Minor fixes according to our coding conventions: eg. don't shadow
  variables

Fixes: QTBUG-119979
Change-Id: If41adf34f38bfa101f2c5433082828c1a10668b1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 30e6d822327d8105d209af10d077512f21ecc12c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 14:12:58 +00:00
Yansheng Zhu
2b18f6c7b8 Fix Maximized frameless window painting wrong with WS_THICKFRAME
In Qt versions greater than 6.4.2, when using Qt:FramelessWindowHint and
WS_THICKFRAME simultaneously, and handling the WM_NCCALCSIZE message to
draw a frameless window, the right and bottom sides may extend beyond
the drawable boundaries.

This is because in the previous commits, the calculation for margins was
skipped for windows with Qt:FramelessWindowHint set. This is correct for
non-maximized windows. However, when a window is maximized on Windows,
its actual size is slightly larger than the drawable area to avoid users
from dragging the border to resize the window. When window was maximized
, the code for calculating geometry should remove the margins instead of
skipping its calculation.

The fixed code determines whether to skip the calculation of margins and
frame by checking whether the window is maximized during the calculation
[ChangeLog][QPA][Windows] Adding a check for the maximized state of the
window during the calculation of margins. Margins calculation will not
be skipped for maximized windows.

Task-number: QTBUG-120196
Pick-to: 6.6 6.5
Change-Id: I63c8dbc8f65ff28cc581be261acfd3f675b027c4
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 5f7b4c045f4347b9e47849d15d5932df45626c51)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 14:12:58 +00:00
Lucie Gérard
56f4d1f0e9 Add qtbase modules to ./configure -list-features
Task-number: QTBUG-64984
Pick-to: 6.6
Change-Id: I78964581118b258fb1cf5ddea8097fd3b9a5df02
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0ba15348cf9c0b3702541c18070d8311aa7cc6a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 14:12:58 +00:00
Assam Boudjelthia
c4b1b97192 Android: update androiddeployqt doc page
* Prioritize CMake snippets.
* Remove unrelated mention to various qmake variables.
* Mention the page for command line configuration and building
and remove the same duplicated command from this page.
* Mention the page for customizing the build from the Android docs.

Task-number: QTBUG-115020
Change-Id: I966c37661e17f6ffb8d25bfa3cd91e92be364e1d
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit 5192de707d34b5ef3bcffdc8370a2f894ef647f2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 14:12:57 +00:00
Kai Köhne
a91423d4ce Doc: Use Qml DefaultProperty as example for Q_CLASSINFO
Setting a DefaultProperty is arguably something
more useful to people than the 'made up' version example.

Also add more links to the relevant QML pages.

Pick-to: 6.6
Change-Id: Id967df7ddf81511299f95b9fd24f56af671fb855
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 98ba0d4e95353febd5a4b14fe2eb9cbd4259bf0a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 14:12:57 +00:00
Volker Hilsheimer
3b3960c9b4 QWidget: deliver DragLeave events symmetrically
If a widget received a DragEnter event that it didn't accept, then the
UnderMouse widget attribute gets set. But the drag manager never got a
drag target, so the DragLeave event was never delivered, leaving the
UnderMouse attribute set incorrectly.

We always need to send DragLeave events to the receiver, even if the
DragEnter or DragMove was not accepted. Otherwise we are not in balance,
and the UnderMouse attribute will remain set.

This is a change of behavior and a very old bug, so only fixing this in
unreleased branches. Test case added to verify that explicitly generated
drag events result in the correct enter/leave events.

[ChangeLog][QtWidgets][QWidget] DragLeave events are now always sent to
the widget the mouse is leaving, even if it didn't accept the DragEnter
event.

Fixes: QTBUG-50403
Change-Id: I5eae49da000fb4fea81f1767f0e73a06a6b78975
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4f95e66f940c3a6c72f51c2428620c09e30bbd0b)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-12-21 10:18:55 +01:00
Hatem ElKharashy
bf77adf1b0 QGraphicsFrameCapture : Add getters for frames names
Save captured frames names and add getters for them

Change-Id: I429e1512d6610ade9414f59fee3d081548cbb2ab
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
(cherry picked from commit 564efa3741ccd21b03d95a778e7a37d5bd902e53)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 09:16:58 +00:00
Axel Spoerl
83df3a8138 Remove echo plugin
Remove echo plugin code and documentation.

Fixes: QTBUG-119981
Change-Id: I4083ac6cdb768facaed041241af2c5ee6e28df50
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 01bf423d67d5e6f8de5ec51a6b85178492681ca9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 05:35:19 +00:00
Volker Hilsheimer
d8b113f46f Minor updates to the "Touch Knobs" example
Turn on anti-aliasing, and update screenshot.

The example is still not great and under-documented, but at least it
doesn't look horrible anymore.

Pick-to: 6.6
Task-number: QTBUG-120291
Change-Id: Ie709cb51d64c535d7cd0aa1451b3c5bb901324cb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 2b9d021ba5487f7f5f67b958a17160c4cf468561)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 01:52:22 +00:00
Volker Hilsheimer
ba583b5e31 Turn SpinBox Delegate example into snippets
The essence of the example was already fully quoted in the
model/view documentation. Move the code into a snippet
source, and update the screenshot.

Fixes: QTBUG-119976
Pick-to: 6.6
Change-Id: Id2f10bb26a650419969bbfa9b76cb74babd3319e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit 99eaae4323ff1fda2d8cc0184d824b6d9c3f23ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 01:52:11 +00:00
Axel Spoerl
fcb040404f QComboBox: Fix hover over list view
9da8d67b3bca1d40ae221a9c6be218fe57759724 has commented out setting the
current index of the combo box container during a mouse hover event.
That has caused a regression.

Amend the patch and enable visual hover effect.

Fixes: QTBUG-120167
Change-Id: Ic12e70f9f70ac2f7b9604580562c35551659c5e2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit a5a082406e8a8a14e9d21921e918e36a270939fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-21 01:04:23 +00:00
Assam Boudjelthia
74f82101e8 Android: fix Android Manifest docs table
The table had the wrong row span making it malfomatted.

Task-number: QTBUG-115020
Change-Id: Icc35df3cd7dcdad2407d4c93d7a2a8d3d1701275
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit ec7b4d547d74ded2e82674ad007f60109d73df29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 19:47:28 +00:00
Assam Boudjelthia
8f9543e0aa CMake: don't set TIMEOUT_SIGNAL_NAME for Android target on Windows host
TIMEOUT_SIGNAL_NAME and TIMEOUT_SIGNAL_GRACE_PERIOD are not supported
on Windows.

Amends 4a3936c33cb2ab9fee2e93cbe99d31daf1cd0cc8.

Pick-to: 6.6 6.5
Task-number: QTBUG-106479
Change-Id: Ifa00a9183750454960b1ff24e1a0048224feff4b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 1a7db3ab11ef9500e9c6bf111d7525cacca2f867)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 19:47:25 +00:00
Assam Boudjelthia
d5ff601da7 Android: fix typo in androiddeployqt command
Task-number: QTBUG-115020
Pick-to: 6.6
Change-Id: Ia82c6a421a148bb462d67be5757f73068aa6d382
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit 1f609e47803097ddadaf5f26dc76135ae0cd211d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 19:47:22 +00:00
Assam Boudjelthia
4992c74091 Android: fix order of calling setApplicationState() in QtServiceBase
In QtServiceBase setApplicationState() is being called before
the Qt libs are loaded and that call invokes a native method,
so that leads to a crash/exception for UnsatisfiedLinkError.

Change-Id: I879d120f0cc2985ab49f7402a65f171950451914
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Janne Juntunen <janne.juntunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit f292a669042df26d372985b16d4ab50ea6d4dca5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 19:47:19 +00:00
Assam Boudjelthia
5855be0fb3 Android: return String regardless from QtLoader.getMetaData()
To avoid exceptions if the metadata is a non-string like boolean
or integer.

Task-number: QTBUG-115016
Change-Id: I104e6b2954873e74bc100cb965ee8ea9b6d14568
Reviewed-by: Janne Juntunen <janne.juntunen@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 400e7d1a758394df350cbdcbc6cff3683976b789)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 19:47:16 +00:00
Assam Boudjelthia
b9f5b892d4 Android: don't call QtLoader.finish() on null activity/service
Task-number: QTBUG-115016
Change-Id: Ia7cf066261bd0bb17d67423b5edf7b72ec33d577
Reviewed-by: Janne Juntunen <janne.juntunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 84f0b483b5befb2fef070b5c05c17e1fcd7dac1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 19:47:13 +00:00
Assam Boudjelthia
c27163cd7d Examples: Add Qt6::Gui editabletreemodel and simpletreemodel tests
Android needs the Gui dependency.
Amends 283cdcd3d5fad368c9df1bcae69cbfbf9ade623f.

Pick-to: 6.6
Fixes: QTBUG-120257
Change-Id: Id02b03b9fa08546bc5a126b3e71e67bdd65f8b66
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 4d7ac732557f397cc24c47bc5469db60a0c2a2cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 19:47:09 +00:00
Assam Boudjelthia
130c0905e6 Android: add macros for common tools and sdk versions
To make it more maintainable and keep the docs up-to-date,
define most of the version numbers for various tools used
in Qt Android dev environment.

Task-number: QTBUG-115020
Change-Id: I92aa52398b7700e90a0ffd39a1c40bb7a17c3658
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit eef0d82a4c991e0ac8b2f250b439c48396678c23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 19:47:05 +00:00
Assam Boudjelthia
97a3434fde Android: use m_context in QtServiceLoader.initContextInfo()
since m_service will not be yet set, m_context should be used here.

Task-number: QTBUG-115016
Change-Id: Ie259e703da1d8aac23117f032b7d146f7060aac2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Janne Juntunen <janne.juntunen@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit fcc8b89ae01eb405c4cfa8fafd7b1b7068a2d033)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 19:47:02 +00:00
Assam Boudjelthia
482af5a431 Android: save the service under QtNative with QtNative.setService()
Otheriwse Qt C++ code will not be able to find it.

Task-number: QTBUG-115016
Change-Id: Id3a2efb1f33cb60a523359e1ad646a394e24397e
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Janne Juntunen <janne.juntunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7996a3fc7f408a2f92b103f6d03d172b1f0d9295)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 19:46:56 +00:00
Jan Arve Sæther
c8df6e18df Do not assert when preferred{Width|Height} is infinity
There's two alternative strategies for fixing this:

1. When fetching the preferred sizes from an item, the number is bounded
   to a smaller (but still very large) value - not subject to overflow.
   In practice this will result in the correct layout, but the
   consequence is a small inconsistency: The preferred size of the
   layout will be less than infinite despite that one of its items have
   a preferred size of infinite.

2. Do not bound the fetched preferred sizes from items, but instead
   let the rest of the code handle infinity.
   This will result in the correct layout, and also a correct preferred
   size of the layout.

This patch uses the second strategy, by applying a bound when needed.
Autotest will be submitted to qtdeclarative, since QGraphicsLayouts are
not affected by this.

Pick-to: 6.6 6.5 6.2
Task-number: QTBUG-116577
Change-Id: I49f79d288370bd93831ac9eda623ce4bbf587796
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 2a95ecf7e81fbdcfad50f8a1dd5c62b120e2ec27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 18:40:42 +00:00
Inkamari Harjula
56f6eb2c09 Doc: Review and improve QFileDialog documentation
Grammar improvements made. A screenshot added.

Task-number: QTBUG-119551
Change-Id: Ia14c654e92eede5a32bba18cd4d05a74d289f64b
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
(cherry picked from commit 26ac6bd4a4e004acd4602d346c3fe45e79a51bf6)
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-12-20 11:51:16 +00:00
Kai Köhne
84365c0b60 Doc: Fix linking to QFileDialog::NativeFileDialog
Pick-to: 6.6 6.5
Task-number: QTBUG-119551
Change-Id: I1c698673873e5534b6d7867f8bc752115c254241
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Inkamari Harjula <inkamari.harjula@qt.io>
(cherry picked from commit 1edc866878926d3fba31fc9ee0d9c9abc52cc8a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 11:51:16 +00:00
Nodir Temirkhodjaev
95acccea1f qfilesystemmodel.cpp: Fix building with -no-feature-filesystemwatcher
Pick-to: 6.6
Fixes: QTBUG-120062
Change-Id: I2d4d0ff06b8088af81330ed0956b86f292c21cac
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 38dbd751640399a7887cf91fed73688df209a38d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 07:51:29 +00:00
Christian Ehrlicher
3252ef72d4 QFileDialog/win: pass only filename to IFileDialog::SetFileName()
One more place were we should only pass the filename instead the full
path to IFileDialog::SetFileName()
Amends 19c701d370512e81d1b934f899b03ae0c2e6953f

Pick-to: 6.6
Task-number: QTBUG-47159
Change-Id: I3ac36eb2b6b6fe84fe6985590da882b1d5733efa
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 2643210bd6e07aa1d8ae78c109592bdc2545b074)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 07:51:29 +00:00
Lorn Potter
82a32ac7ab wasm: fix Pen input
This also adds the ability to distinguish between a Pen and a Touch.

Fixes: QTBUG-116989
Change-Id: Iffc5d20c9b46c1746a03c45dd12017d5dd5172a5
Pick-to: 6.6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 0367aace14b61e72433fa7cb7aab18b3def0030c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 00:46:27 +00:00
Morten Sørvig
de27289aaf wasm: Don't suppress exceptions during main()
If there's e.g. an infinite loop during main() that
would previously result in a blank page, but not error
message. The expected case is that we would get a RangeError
exception, but that exception never reaches the catch
handlers in qtloader.js.

Work around this by setting noInitialRun, followed by
calling main manually. We then need to handle the case
where the app.exec() workaround throws, which should
not trigger an error.

Change-Id: Ia8431279308770981316cd168e4316341bfb2531
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit db93cd4f61ec9ad75b2389e5ac1724becfce3a1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 00:44:47 +00:00
Morten Sørvig
d510bfa2df wasm: set MAXIMUM_MEMORY to 4GB
This increases the maximum available memory from 2GB
(Emscritpten default) to 4GB, which is the 32-bit wasm
max.

Add QT_WASM_MAXIMUM_MEMORY qmake/cmake option for overriding.

Change-Id: I6257fc919a749412c4ba1e0f939996c6057ce314
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit c6d3b91549ceaafa81cbcedf243f798f1114a467)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 00:44:41 +00:00
Morten Sørvig
8e82b16587 wasm: call onExit once and only once on exit
We listen to the onExit and on onAbort Emscripten events,
and also handle exit by exception. Make sure we call
onExit only once on exit, regardless of the order and
number of Emscripten events.

Change-Id: I4833a1056fad0a2706bd6c0f0fce98fb052fe8c8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit ac4619a36a54a2168ea5d7a2c7d059781564098c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 00:44:40 +00:00
Lorn Potter
ab6af9cba9 wasm: add QWindow parameter to DragEvent
Perparing for enhanced Darg Drop support

Done-with: Mikolaj.Boc@qt.io
Change-Id: I24ce72570ce0754c8a5c152a92192eebeae5b340
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 585f348f3c8137cec4ab503eecc28296da2798f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-20 00:44:38 +00:00
Topi Reinio
26c10a8863 Doc: Fix documentation issues for Qt Core
* Fix template arguments in \fn signatures for Qt::compareThreeWay()
  functions.

* Fix template arguments in \fn signatures for QDebug::operator<<()
  functions.

* Fix \sa links to specific overloads of QSpan functions.

* Fix \sa links to specific overloads of QFileInfo::fileTime().

* Remove references to 'Custom Type Example' (example has been removed).

* Fix linking to 'JSON Save Game' example.

* Fix references to 'Queued Custom Type' example.

* Fix linking to QCryptographicHash::Algorithm.

* Fix linking to Qt Qml module.

* Fix undocumented parameters in qHypot().

Change-Id: If9eb9978a14e147f003672a682972b319454c311
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 96740ea3fed8a7837dc282135661723858fff198)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-19 22:49:49 +00:00
Cajus Pollmeier
fa41643a7e Fix CMake extraction of sub architecture test
The length check is hard coded to the length of the string under test.
As the STRINGS match only filters out non printable characters, we've
no guarantee that the characters before the == position are printable
or not. So _pos may be > 1 and then string length check will be broken.

Replaced this by a pattern match to see whether there's something after
the ":".

Fixes: QTBUG-120125
Pick-to: 6.6 6.5
Change-Id: I24971b3bc83ea05841dae21667fbbae3416cfcf9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit e7457ff171255148d92254316433d39ef1bd3d28)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-19 11:01:14 +00:00
Volker Hilsheimer
f7e42dc8b6 JNI API review: minor cleanups of QJniArray
While the QJniArray type still is expected to be a QJniObject, we should
still make the QJniArrayBase type non-constructible by making the
constructors protected. Also make the destructor of that type protected
and add explicit default implementations of the SMF.

Name the SFINAE helper and predciate consistently as IfCanConvert.

Change-Id: I7a7c6a320fe9acb0758b53d94832d355c99cb6bb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 4a19e97f70994bc8bb67e26533d18266b8a615bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-19 08:02:55 +00:00
Volker Hilsheimer
2d3ee8ac34 Update Sliders example
Simplify the "responsive layout" implementation. Just use a QBoxLayout
with changing direction instead of repopulating a QGridLayout, and
change the orientation of one set of sliders instead of creating two
sets in a stacked layout.

Simplify the resizeEvent() implementation accordingly.

Update the documentation snippet text to match the code, and document
the resizeEvent() override.

Pick-to: 6.6
Fixes: QTBUG-119977
Change-Id: I73a1bb215c956fa283291ebf0ea45ff9a975c727
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f3fb89ba298e1741320d8bfac9cbd0d503373bff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-19 08:02:47 +00:00
Volker Hilsheimer
f1c59a351a JNI API review: use has-a-QJniObject relationship for QtJniTypes types
Don't subclass QJniObject. It's not necessary, and gets us into UB
territory due to QJniObject not having a virtual destructor. Also,
rename the helper class to JObject, as Object is a valid Java class
that one might want to be able to declare explicitly.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Amends 4a46ba1209907796f4a14f6feb35ed4d70155d7d

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

Amends 29b65c98e720056e87334ce88a683969e57efd3d.

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

Amends 29b65c98e720056e87334ce88a683969e57efd3d.

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

No functional change, just fewer templates to instantiate.

Amends 29b65c98e720056e87334ce88a683969e57efd3d.

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

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

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

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

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

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

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

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

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

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

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

Amends 52c2b82082b535123c0eecafe1ec1e4e4190df2a.

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

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

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

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

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

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

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

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

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

Amends 7540b4bd5634c9104a99f9b219531b1e3dd7942d

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

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

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

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

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

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

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

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

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

Add this functionality also for release.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Change-Id: I85b3fc2dd45c4693be13fffd1795bfb1b296caa6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 948fa2a427dbcdc2784abdcf87efc914417a0028)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 06:23:48 +00:00
Thiago Macieira
8247adeaed QBitArray: add rvalue binary bitwise operators
Now that the assignment-bitwise operators can reuse storage, we can make
these operators also be capable of reusing storage.

Change-Id: I85b3fc2dd45c4693be13fffd1795b893de65a5b8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 2b7908ac3ad437c209485dcf00d1e53c98d78cb3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 06:23:41 +00:00
Thiago Macieira
5c373fd229 QBitArray: improve memory allocation in the binary bitwise operators
Instead of creating a temporary copy of one of the two sides (which will
share QByteArray), create one with the correct target size such that it
is already detached.

Drive-by move them to hidden friends.

Change-Id: I85b3fc2dd45c4693be13fffd1795b74eeaf3be71
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 54c373faa4f9582fd09a802727821fd544a7b2c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-15 06:23:27 +00:00
Christian Ehrlicher
27f73a90a1 QStyleSheetStyle: misc cleanup
Avoid some calls to detach() and use std::array instead raw c arrays.

Change-Id: I95cbfb130b6fe2509e5d87184c6612718b90dd63
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 51e682d5af955a2c1380f7f1c7014b091a577241)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:07 +00:00
Thiago Macieira
b0c031b51b Suppress clang-tidy mem leak warning on QMetaObject::invokeMethod
We don't leak, but clang-tidy is printing this warning. Possibly because
it sees a new with no matched delete in the same context, ignoring the
fact that the pointer was gifted to the called function.

Fixes: QTBUG-119972
Pick-to: 6.6 6.5
Change-Id: I6e2677aad2ab45759db2fffd17a06c57c3a463ba
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a337b8360f149313f5bf37dc5867413d846a3a97)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:04 +00:00
Volker Hilsheimer
3158aa546d QMessageBox: don't use a native dialog if a style sheet is active
With 6.5 we try to use the native message dialog if we can, but we
didn't account for the style sheet. This restores pre-6.5 behavior for
QMessageBox.

Other dialogs will continue to be native, even if a style sheet is in
use. While this is inconsistent, the other dialogs are substantially
more functional, so switching to the Qt version because of a style sheet
being active would be a significant change of behavior.

Pick-to: 6.6 6.5
Fixes: QTBUG-120054
Change-Id: I07eae609bc360140e096c5eb7ad004ffa4422123
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1b71e2d894c2be7052518cdcb96020c9950e2dc7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:04 +00:00
Marc Mutz
ce87ff291a QtDBus: port away from QPair
Task-number: QTBUG-115841
Change-Id: I1eaba630f003df695412dbb2353ce4870f9b9782
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 400426acb2955447704821ab03df502dd5705be2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:04 +00:00
Marc Mutz
8dab969c97 tools: port away from QPair
Task-number: QTBUG-115841
Change-Id: If122a1c17b1b4092b115521cec814ce3b508cd80
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 2a0b9f0b9085b95bbadc2c46feba1ebd1a5d9c09)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:03 +00:00
Marc Mutz
c7f4939ab6 Q*Animation: s/QPair/std::pair/
Also port from qMakePair() to just braced initialization and CTAD.

As a drive-by, de-duplicate some code around a lower_bound(), and port
from `typedef` to `using`.

Task-number: QTBUG-115841
Change-Id: I3e907ad3bb10b5ca169422ad90d3a65b1b33f926
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 0d09b4f6b9cae84b78d59cecab6d6feb993b112a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:03 +00:00
Marc Mutz
3727e97f32 Add QT_NO_QPAIR
...and mark QtCore as free of QPair.

Task-number: QTBUG-115841
Change-Id: Ic6009d3cabbf72b3b3fe966e47d48a80a328b499
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 31f437e658c25523c284a404ac7be153e6e347c9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:03 +00:00
Marc Mutz
d2dc1a1828 QMetaType: s/QPair/std::pair/
Also port from qMakePair() to just braced initialization and CTAD.

As a drive-by, use auto instead of various const QMetaType::*Function*
so statements fit on one line again, and port from `typedef` to `using`.

Task-number: QTBUG-115841
Change-Id: I6bd9747fb9eb34da08053927507f2008d9bbfb86
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 1a1735a7cf02d83cef58be41f68cec4a2764e890)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:03 +00:00
Axel Spoerl
b41fc4bedd QSplashScreen: Enforce visibility by processing events
A splash screen is usually shown during initialization, before the main
window is shown. At that point, an application might not spin an event
loop. The documentation therefore recommends to run processEvents()
periodically, in order to ensure that the splash screen is actually
shown. Async window managers (e.g. XCB) might require more than one call
to processEvents() for the splash screen to be shown. It can't be
guaranteed, that a specific number of calls to processEvents() make the
splash screen visible. Calls to processEvents() are not considered
good practice in application code.

QSplashScreen::finish() uses a copy of QTest::qWaitForWindowExposed(),
to automatically close the splash screen, when the main window is
shown.

=> Re-write the static inline waitForWindowExposed to wait for the
widget's windowHandle()->isVisible(). That ensures visibility to the
window system.
The previous version waited for isExposed() to become true. That
ensured exposure to the application, but not visibility.

=> Intercept QEvent::Show and process events, until the splash screen
becomes visible.

=> Remove references to processEvents() as a requirement to show the
splash screen from the documentation. It remains a requirement for
processing mouse and keyboard events.

=> Re-activate tst_QSplashScreen and test visibility in the constructor
test function.

Drive by:
- implement switch in event override
- factor out paint event handling in a function
- update documentation about calling processEvents() to enable mouse
handling.

Fixes: QTBUG-119225
Pick-to: 6.6 6.5
Change-Id: I07910705246b4e3234e01cc4896f5bc4b2c56772
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7835f9e60157987b4aafc9b860f925d775151b7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:02 +00:00
Johannes Grunenberg
1df12820fe QLineEdit: Use existing selection when deleting a word
When using QKeySequence::DeleteEndOfWord or
QKeySequence::DeleteStartOfWord in a QLineEdit with an existing
selection, the selection was ignored which resulted in unexpected
behavior (see bugreport). This is fixed by only setting the selection
if none exists yet.
To prevent an entry in the history when the input is empty, the
selection is checked before calling del().

Fixes: QTBUG-120006
Pick-to: 6.6 6.5
Change-Id: I2e803c5eff1f0e289e93a77c58ecd78299241da7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1d953b2fbc3deccad6eb2a5ebe39b24908dbcf3e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:02 +00:00
Ed Cooke
a00c80e1ce Update the books example
Remove the .ui file and write the equivalent implementation.

Replace the outdated star icons with new star icons. 5 empty stars
are now provided and filled in depending on the rating. The new stars
are SVG, however, we do not use an SvgRenderer as we cannot use the
QtSvg API from QtBase directly. It is safe to assume the SVG image
loading plugin is present, the worst case scenario would be empty icons,
but it would still build. We instead use QIcon.

For the rating, draw the star icons in a combobox, replacing the old spinbox.

Update the layout by moving the table view to the bottom, and
arranging the input fields at the top.

The scrollbar policies have been set to Qt::ScrollBarAsNeeded for the table view.

Fixes: QTBUG-118476
Pick-to: 6.6 6.5
Change-Id: I27c13534ab06e17531d155469a1cc6e7e05197af
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 76b2852b7cff183ba31d6b09b00cbabdffb9ba71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:02 +00:00
Christian Ehrlicher
794aee350f Doc: Update image in QSystemTray example
The old image was from windows xp so a new one from windows 10 should
not hurt.

Pick-to: 6.6 6.5
Change-Id: Ia78f556e8603517d9e7339f0af2330bc2d4182d3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f5d192818dea30f1fbe53adc5211ff44563c16aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:02 +00:00
Volker Hilsheimer
6c726979f7 Turn the "concentriccircles" example into snippets, update screenshot
The example has a lot of code and documentation, but in essence shows
how to use float-based QPainter APIs and how to set a render hint. That
is two lines of code, which we can show as snippets.

Update the screenshot of the example with a higher-resolution version.

Pick-to: 6.6
Fixes: QTBUG-119983
Change-Id: Iafcb813dff6ab8c269176f7994c95947ebf5e559
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 33254fb41f29b510d3d74dbaab60f0a67ef56d46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:02 +00:00
Amir Masoud Abdol
d173fda6e9 Use the correct CMake argument name for -libpng and -libjpeg
The qt_feature calls are for "jpeg" and "png".

Pick-to: 6.6 6.5
Fixes: QTBUG-120036
Change-Id: I43e69d9fd1e08383b5ddfbfe194eaa2f2ae52f50
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 8646010223c7a103fc53ff0705dece8904ee268c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:01 +00:00
Axel Spoerl
40cd1049a6 QDockWidget: Clarify documentation of floating property
QDockWidget::isFloating() returns true for single, floating dock
widgets. It returns false, if the dock widget is part of a floating
tab (i.e. it is a QDockWidgetGroupWindow child).

=> Clarify documentation.

Pick-to: 6.6 6.5
Change-Id: I3c5a4a86b89dcb001e7561de7dcc604bae0d9cee
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 92b5992a29e6a5463200157ab9934fae9a3ec8cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:01 +00:00
Morten Sørvig
e76a04d26c wasm: fix qtloader.js preRun usage
Emscripten documents that preRun should be an array
of functions, but also accepts setting it to a single
function.

qtloader.js was accidentally using this feature, which
works as long as qtloader is the single user, but breaks
if other code expects an array. A typical error in this
case is:

   "Module.preRun.push is not a function"

Fix this by creating and maintaining preRun as an array.

Pick-to: 6.6
Change-Id: Ie1382695f3f25839cb971ab4adc81984fc8c53ca
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit bf39bd8e06e9d66bfb9f01e83c743420e812b630)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 19:53:01 +00:00
Marc Mutz
41c9754b4c Itemmodels: s/QPair/std::pair/
Also port from qMakePair() to just braced initialization and CTAD.

As a drive-by, use emplacement instead of appending pairs explicitly,
rewrite typedef into `using`, and remove the qpair.h include from the
.cpp file (cannot affect other TUs and <utility> is considered
included in qcompilerdetection.h).

Task-number: QTBUG-115841
Change-Id: Ia985520dfce6b77b1c0fe7669fc92d2df97e1b06
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 91d341e560e9a54d201279d53701ff071256ad6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 06:48:03 +00:00
Christian Ehrlicher
b63f92bb0f QWindowsCursor: create correct DDB in createBitmapCursor()
CreateCursor() expects a ddb and according the docs a ddb must be
word-aligned but we created a byte-aligned ddb which results in a
wrongly rendered cursor later on.

Pick-to: 6.6
Task-number: QTBUG-82434
Change-Id: Ie847865a0d868043571faf4b7f4fdf6a92fce448
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit af0edfbc7c33261d11b559cb4842045457adc4a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 06:48:00 +00:00
Santhosh Kumar
264dab9936 Fix hang issue during drag and drop in windows
During drag and drop operation, we used to get window under mouse and
process events for that window after the patch set
9ff5b886fade489b7cc268626f518145650f6b2c. But this sometimes cause hang
issue in GetMessage() when the respective window doesn't capture mouse
event and we are required to process mouse events.

This patch fixes this issue by considering whether the window under
mouse has capture.

Fixes: QTBUG-115260
Pick-to: 6.6 6.5 6.2
Change-Id: I748936e4ce23e60abce51d34c1326cfb105b06cb
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 6ef62f7dc4d6cb690fc297954b3cfcd1de415910)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:44 +00:00
Amir Masoud Abdol
9dbc0673c7 Allow space in emsdk path
Changing from Native path, to CMake path resolves the broken
execute_process call.

Pick-to: 6.6 6.5
Fixes: QTBUG-120050
Change-Id: I6725d0efc215e4866677bf6a64e315752c3f2a1d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6b09b515367b2c293e3d8284f37a6120d2f83019)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:43 +00:00
Amir Masoud Abdol
37e7f8246c Fix an issue where it was not possible to build iOS tests in tree
Before this, when trying to build iOS tests, CMake could not find the
`LaunchScreen.storyboard` in the source directory, and therefore the
configuration was failing.

In addition, QtPublicFinalizerHelpers module was missing in QtBuild,
resulting in another configuration failure when configuring iOS tests.

Change-Id: I592121892a2716973a92ec044414fa729fd3b15f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 0c3892bb261f0eebebdff4cf42169f49729956a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:43 +00:00
Tinja Paavoseppä
39401a645f Android: Use TextureView when multiple windows present
The SurfaceView class is not the best option for when we
have multiple windows, as the created Surface can only
either be below the window or on top of it, it is not a
part of the view hierarchy.

Replace the SurfaceView with TextureView when there are
more than one window. This way the surface will be a part
of the view hierarchy, and will respect z-ordering.

When there is only one window, keep using the SurfaceView
approach to limit the effect on existing apps, as well
as enable some of the benefits SurfaceView has for e.g.
game and multimedia apps, such as HDR ability.

Move touch handling from QtSurface to QtWindow, so
touches are handled also when using TextureView instead
of QtSurface aka SurfaceView.

Task-number: QTBUG-118142
Change-Id: I37dcaf0fb656cfc1ff2eca0a3bfe7259f607411c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit cca81a663661ef1fce5f4a9f4c5a5f5fd1381325)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:43 +00:00
Tinja Paavoseppä
3475354a96 Android: Differentiate between standalone Qt app and embedded view
Add a helper method to tell whether the app is a standalone Qt for
Android app, where also the Context is created by Qt, or whether Qt
content is embedded as a View into a Context created by the user, i.e.
a "native" Android app.

Change-Id: I618ba1c8cb40c9b132fc12a7ee6d54c071efa983
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit c1a79b442ce0a50e176f72f3c738ea1263e8dd98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:43 +00:00
Tinja Paavoseppä
5c4a79a53d Android: Fix touch events for child windows
In the touch dispatcher methods, all events were routed for the
top level window at the position, which lead to all the events
being delivered for the parent window.

Since the JNI methods already have a parameter for window ID, take
that into use and determine the window to deliver the events to
by ID.

Change-Id: I07ad7851c32a3e633ee748036d6818b6d0fa5588
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b2e44a2d1d1fa109bb2971177a4fda1210637410)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:42 +00:00
Tinja Paavoseppä
030a60d681 Android: Add support for foreign window acting as embedding container
In the case when our foreign window is created to act as a parent for
embedding Qt content into a native Android app, we need a more "hands
off"
approach. If the foreign window represents an Android view which the
user
has created outside of Qt, we should not try to reparent it since it
already has a parent in the view hierarchy. Neither should we try to
remove it from the hierarchy, or set its visibility.

Change-Id: Iea496578a40f45ebdd73947a1bb0e46a7131108c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 5ba91c9decb4d13d7f7176bc7ce29b40007a19c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:42 +00:00
Tinja Paavoseppä
2112dfe313 Android: Make winId() return the underlying QtWindow jobject
Previously, winId() returned a simple integer ID, incremented by one
for each window, instead of a handle to the underlying window.

Note, if constructing a QWindow with fromWinId(), the passed jobject
will not be the same one returned by winId(), as the passed jobject,
assumed to be a View, will be wrapped inside a QtWindow to ensure
child windows can be added to it if needed.

Change-Id: I9d5d977eeb08d4cc3594f7339660fe94c3a55864
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 4376467169979ce6886d6f58944a2f50dcf77e51)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:42 +00:00
Oliver Wolff
188fac6453 Remove mentioning of UWP from windeployqt's configure summary
Qt's UWP port has been dropped for Qt 6.0.

Pick-to: 6.6 6.5 6.2
Change-Id: I72f2cfbd1234110a0bd0c15669fa326328d4d08c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 3f680c14799c4cceefd96ed3d07dcc75725eb646)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:41 +00:00
Tor Arne Vestbø
122b4c21a0 macOS: Deliver focus change events for foreign windows
If a foreign window becomes or loses focus window status, we should
let QGuiApplication know about it.

Task-number: QTBUG-119287
Change-Id: I550d72fa13e1c38c9b89880857db9f9cbd7f6568
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 75a5605151d203fb4c2269001dddfd3db121ea2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:41 +00:00
Marc Mutz
3092406d79 moc: port from pair<> to a struct SuperClass
... with properly-named members.

This is in preparation of adding a new member in order to fix
QTBUG-101141 (namespaced base classes).

Pick-to: 6.6 6.5
Task-number: QTBUG-101141
Change-Id: I2309e425ac94ad275b54a898fd33a2891e5d1453
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit cbb4aea2132fc59cd1086ba42cc221d12b5ce9e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:41 +00:00
Marc Mutz
debeb8878d HPack: fix incorrect integer overflow check
This code never worked:

For the comparison with max() - 32 to trigger, on 32-bit platforms (or
Qt 5) signed interger overflow would have had to happen in the
addition of the two sizes. The compiler can therefore remove the
overflow check as dead code.

On Qt 6 and 64-bit platforms, the signed integer addition would be
very unlikely to overflow, but the following truncation to uint32
would yield the correct result only in a narrow 32-value window just
below UINT_MAX, if even that.

Fix by using the proper tool, qAddOverflow.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I7599f2e75ff7f488077b0c60b81022591005661c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ee5da1f2eaf8932aeca02ffea6e4c618585e29e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:41 +00:00
Marc Mutz
a1ac034404 QVariantPair: cut the QPair middle-man
Use std::pair directly.

Task-number: QTBUG-115841
Change-Id: I4ca63c7b7f46f2b66f6f4f4ef4eba54537d5dc7a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 0a5a9c134ebc240a48d999d3cc3fd65d0c60c8a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:41 +00:00
Marc Mutz
f49980f0b7 QArrayData/Pointer: s/QPair/std::pair/
Also port from qMakePair to just braced initialization and CTAD.

Task-number: QTBUG-115841
Change-Id: Ifd7220ae88b101351e91d1488ce18715eb4880e5
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 95c7f88132646489bc17b8ea32facd76a19e19fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:40 +00:00
Marc Mutz
4e8e6a1526 QCbor/QJson: s/QPair/std::pair/
Also port qMakePair() to just braced initialization and CTAD.

Task-number: QTBUG-115841
Change-Id: I9eafb20ebc63bd33eb52661f4f14ad2db9fc0f00
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 4be8755151e3433357de6479d5c70582f83485e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:40 +00:00
Mårten Nordheim
6b228565cf Fix the qopenssl_symbols.h copy in the autotest
It was forgotten when we originally fixed the hardcoded 1_1 version.

Pick-to: 6.6 6.5
Change-Id: Iff3148d79466dac2830fe9a63d954aead96fb0ac
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 46923f2648ba99b3d070ea077f04047172ba4923)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:40 +00:00
Tor Arne Vestbø
d26be2a206 macOS: Use CALayer backingstore when widgets request non-raster surface
When a non-raster widget is inserted into the widget hierarchy, widgets
switches into using RHI for flushing its backingstore, matching the
window's surface type with the non-raster widget that was inserted.

This happens for example when inserting an QOpenGLWidget, which switches
the surface type to QWindow::OpenGLSurface, or a QQuickWidget, which
switches the surface type to that used for Qt Quick.

In these cases, there might still be child widgets with their own
window handle, and as long as these child windows have the same
surface type as the window owning the backing store these child
windows are flushed through the same rhiFlush() code path as the
top level window.

For child windows with a different surface type, QWidgetRepaintManager
chooses the pain QPlatformBackingStore::flush(). Unfortunately, the
implementation of QRhiBackingStore::flush() bails out when flushing
child windows, so when we were using QRhiBackingStore on macOS for
non-raster surfaces we would end up not flushing these child windows.

The way to fix this is to use QCALayerBackingStore for the case
where we know the client of the backing store (QWidgetWindow) is
going to call rhiFlush() explicitly for non-raster surfaces. That
will lead us into QCALayerBackingStore::flush() for the child windows
with a non-matching surface type, typically QWindow::RasterSurface,
and we'll flush those child windows by setting the layer's contents
property.

Fixes: QTBUG-119309
Pick-to: 6.6 6.5
Change-Id: Ia7052b9e651d575d8e34942a25e17ab5a1f5ce05
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit f16f31ba3093f35134ceff6a784ad99c1867bfee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:40 +00:00
Arno Rehn
f89d80c902 QFuture: Don't use QFutureCallOutInterface for continuations
This patch replaces the QBasicFutureWatcher that was used for
continuations with context objects with a smaller QObject-based wrapper
that works directly from the actual continuation.
The idea stays the same: In order to run continuations in the thread of
a context object, we offload the continuation invocation to the
signal-slot mechanism.
Previously, we've hooked into QFuture with QFutureCallOutInterface to
emit a signal and trigger continuation invocation. However, it is much
easier and robust to emit that signal from the continuation itself.

This sidesteps the locking issues that QFutureCallOutInterface handling
presents. QFutureCallOutInterface basically requires any consumer to
only access the QFuture after all events have been posted and the
internal mutex unlocked, i.e. on the next cycle of the event loop.

Continuations do not impose this restriction; runContinuation()
explicitly unlocks the internal mutex before calling the continuation.

This fixes a deadlock when using QFuture::then(context, ...) where
the paren future is resolved from the same thread that the context
object lives in.

Fixes: QTBUG-119406
Fixes: QTBUG-119103
Fixes: QTBUG-117918
Fixes: QTBUG-119579
Fixes: QTBUG-119810
Pick-to: 6.6
Change-Id: I112b16024cde6b6ee0e4d8127392864b813df5bc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 59e21a536f7f81625216dc7a621e7be59919da33)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:40 +00:00
Marc Mutz
51cbcdab6e QSortFilterProxyModel: scope a variable tighter
The clear() will not preserve capacity, since the QList has been
copied into proxy_intervals already, so is shared. But then creating a
new QList is just as efficient, or more so.

Change-Id: I7ffd91bae8ded5ac28d58bcc545c479f6edc7c90
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit b6fdef44e46b97cf4dc5fee750f50054c65bf5ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:39 +00:00
Marc Mutz
4f7efd4174 HPack: fix a Yoda Condition
Putting the variable on the LHS of a relational operation makes the
expression easier to read. In this case, we find that the whole
expression is nonsensical as an overflow protection, because if
name.size() + value.size() overflows, the result will exactly _not_
be > max() - 32, because UB will have happened.

To be fixed in a follow-up commit.

As a drive-by, add parentheses around the RHS.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I35ce598884c37c51b74756b3bd2734b9aad63c09
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 658607a34ead214fbacbc2cca44915655c318ea9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:39 +00:00
Assam Boudjelthia
775e2e8d04 CMake: add spaces between sentences of BUNDLE_ANDROID_OPENSSL_LIBS
Change-Id: I7c3603577805426eb1cd46ff9317b7a6f3ca7f93
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 53f3013b9ea75e2832618bb73a261130b60a4d98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:29 +00:00
Assam Boudjelthia
75fc7a7251 AndroidTestRunner: log when timing out waiting for the test to finish
Leave a log message to know when the test runner timed out or the test
finished.

Pick-to: 6.6 6.5
Change-Id: If56ecaa5b0e3af22b3e26480a584e2d52ac97553
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f8724b9b7eb22b9abace1a67f652c0b6fc6c683d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:29 +00:00
Assam Boudjelthia
5ebce47ac4 CMake:Android:Coin: prioritize timeout from COIN_COMMAND_OUTPUT_TIMEOUT
... from CMake so that Coin doesn't end up killing the whole VM if aRows
test gets stuck and instead allow androidtestrunner to cleanup and fetch
the logs so we know what happened, and even potentially ending up re-run
the test and succeeding if it was flaky.

Also, since CMake sets the timeout during configuration time, coin needs
to set COIN_COMMAND_OUTPUT_TIMEOUT under the build target where tests
are configured, so this moves the setting of that env var from the test
target to the build target.

Pick-to: 6.6 6.5
Change-Id: I9883ea1e98c93f79a088067518d09ca8acd5fdfd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3ee2ecd6bfdf3320e66628afa5d017783df2ee91)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:29 +00:00
Assam Boudjelthia
aecf64eb7b AndroidTestRunner: uninstall the test when interrupted
If the test runner was interrupted, stop waiting for the test
to start or to finish, go fetch the available test results
and logcat and uninstall the test app.

Also, set CMake TIMEOUT_SIGNAL_NAME to SIGINT and
TIMEOUT_SIGNAL_GRACE_PERIOD to 10 seconds to allow enough
time to fetch the logs and uninstall the test app.

Task-number: QTBUG-106479
Pick-to: 6.6 6.5
Change-Id: I4820cfe58f05d15179b4af819caa92e475881634
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 4a3936c33cb2ab9fee2e93cbe99d31daf1cd0cc8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:29 +00:00
Topi Reinio
1377499e72 Doc: QRestAccessManager: Qualify template arguments in \fn commands
Since version 6.7, QDoc requires accurate definition of template
arguments in signatures passed to the \fn command.

Qualify the 'if_compatible_callback' template with the class it's
declared in.

Change-Id: Ifd4618071c950e812c4df9a2e4e212317a6c9118
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
(cherry picked from commit 3861b92ed9669e61b29e88ddc17154f620c92ee2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:29 +00:00
Tor Arne Vestbø
5419df55f3 Use Qt::WindowNoState for child windows/widgets shown via show()
The Qt::WindowState enum is documented to specify the current state of
top-level windows, and does not make sense for child windows. It's up to
the client code to ensure any sizing of child windows/widgets, e.g. via
layouts.

Many of our QPA backends bail out on QPlatformWindow::setWindowState()
for a child window. Ideally we would do this at a higher level, in
QWindow, but that's a bigger task, and the semantics of what happens
when a window is moved from being top level to child or back are not
fully clear.

As a first step, we ensure that the default window state when showing
the window via show() is Qt::WindowNoState.

Unfortunately, the QPlatformIntegration::defaultWindowState() API only
takes into account the window flags, which sadly do not have a way to
reflect whether the window is a child window or not (Qt::SubWindow is
not a child window, see QTBUG-115729).

We don't want to pass a QWindow to this API, as it would mean QWidget
would need to create a window when requesting the default window state.

Instead we hard-code the opt-out for child windows/widgets.

[ChangeLog][Gui/Widgets] Child windows and widgets are now always shown
in their normal state by show().

Change-Id: Ie8caf2df2d854194b9985c9427a9eac1312aba65
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3472aa6e28469ffd23cfa24e3933541f295e9e1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:29 +00:00
Luca Di Sera
81ca04d1b1 Doc: Fix fn commands for QSpan
Added a return type where it was missing as Clang would otherwise fail
to parse the command.

Qualified certain non-type template parameter that were based on a using
declaration inside the QSpan class.
An `\fn` command is parsed as a fake out-of-line definition. In that
context, the unqualified name will not be able to be solved by Clang,
resulting in an inability to match the element.

Change-Id: I929ab5e8df4f7a6ef5d913266b584cd0393074e3
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 8d008b2cf48c961fbd7462813ca3ac4875c55995)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:28 +00:00
Christian Ehrlicher
ce44d63bc3 qt_imageToWinHBITMAP(): properly delete object on error
Properly delete the handle created by CreateDIBSection() with
DeleteObject() in case of error.

Pick-to: 6.6 6.5
Fixes: QTBUG-18057
Change-Id: Ibf40f6afb255bc5a7d7bf39939f5eb3dfcd19f84
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b37b8eb7ea0a809c6e96189e8f9e834d6763e170)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:28 +00:00
Safiyyah Moosa
30e0dc908c Doc: Add AcceptMode info to DontConfirmOverwrite
When QFileDialog::DontConfirmOverwrite is in the false state (default state),
it requires QFileDialog::AcceptMode to be set to QFileDialog::AcceptSave.
This information was not stated in the documents and this fix adds this
information to the docs.

Fixes: QTBUG-49720
Pick-to: 6.6 6.5
Change-Id: I1017252980810e712f2710751c8852dd12eaeef7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 76a1c7690fd9f8e747a2bbdd5d910bebd6ef162c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:28 +00:00
Eskil Abrahamsen Blomfeldt
e56db0394a Fix regression when selecting emojis using VS-16
This amends 58907dfa812de8ce6c63295589f644bdf4257d15,
which tried to make sure we select a color variant of a
character when combining it with the VS-16 symbol, the
emoji selector (and vice versa with VS-15).

This is something which is not well-handled in Qt, and
the original work-around assumed that any font supporting the
conversion of Unicode characters to color glyphs would include
the VS-16 character in its map. This was true for the symptomatic
font on macOS, so it solved the problem there.

However, if you manually select a color font and then request a color
glyph, the font system should just pass it on and accept this. No
need for any magic adaptation. Same if you select a non-color font
and use VS-15.

To avoid regression, we detect this case and disable the behavior
introduced in 58907dfa812de8ce6c63295589f644bdf4257d15 when the existing
font selection is already meeting the criteria.

This is admittedly very hacky, and the plan is to do a larger refactor
where sequences of emojis are separated out ahead of time so that the
font selection can pick from a curated emoji font list for these.

But to fix the immediate regression, this will basically just return
to previous behavior for some cases which are currently prone to break,
so despite the added layer of conditions, it does improve the situation
temporarily.

Pick-to: 6.6 6.5
Task-number: QTBUG-111801
Fixes: QTBUG-118642
Change-Id: I1a3ca711426a042b22003b887883646132335a9f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 35266dc3080dc13641616ed20e257d7b4c57778c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:28 +00:00
Audun Sutterud
e978d4046a examples: Update content of "draggabletext"
Qt Quarterly was shut down long ago.

Fixes: QTBUG-119982
Pick-to: 6.6
Change-Id: I910b03ab11bf9aa728cc23d736a6f13902b6fcfe
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 8d0d520cd313a653226f734ef819021f83e66721)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:28 +00:00
Christian Heimlich
6de0a61015 Windows QPA: Always process system sound events
1b96c75661f678632485513d1323166bc6d74e5c reduced event noise by
dropping accessibility events if Windows UI automation has not been
activated; however, this did not take into account that some widgets
(e.g. QMessageBox) rely on accessibility event processing to emit
certain system sounds.

Change notifyAccessibilityUpdate() so that system sound related events
are processed regardless of accessibility activation.

Pick-to: 6.6 6.5
Change-Id: I22f1516e8fbb3727b065ecc2c30b272b2d6fd1c0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit ce5aaf1e434b6e2e482347b40524edeccecb1665)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:28 +00:00
Volker Hilsheimer
cc5e154914 QMainWindow: don't crash when restored state is modified before applied
Amends 32edae5e268b968aff82f0713612eff2feffb4e1, after which we keep a
copy of the restored state if the state couldn't be applied yet. Since
making a copy of the entire state results in multiple copies of layout
item pointers, we might end up with dangling pointers if the layout
structure is modified while we keep the copy. This can happen if methods
such as tabifyDockWidgets or splitDockWidget get called; e.g. tabifying
dock widgets will destroy the layout items that were added for them.

Unfortunately, the layout items do not have a pointer back to the layout
they live in, and the items in the stored state might not yet live in a
layout anyway. So we cannot remove the items from their layout in a
QDockWidgetItem destructor implementation.

Instead, we have to forget the stored state. Add a helper function that
writes the stored state back to the actual state, and deletes the stored
state afterwards. Call this function when the layout might get modified
programmatically.

Add a test case that reproduces the crash without the fix, and passes
with the patch.

Fixes: QTBUG-120025
Pick-to: 6.6 6.5
Change-Id: I8f7e886f3c4ac38e25f9b8bc194eea0833e5974f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 9ea9e2476d72ae67178d55df99419f202b36131f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:28 +00:00
David Redondo
a73453fdb3 Do not create icon engine multiple times
Creating an icon engine is a potentially expensive operation involving
many file lookups. In the case where neither QIconLoaderEngine nor the
engine from the platform theme is valid, QIconLoader tries to unsuccesfully
find the icon in all theme directories, the theme engine is constructed
potentially doing some expensive operation and finally a new
QIconLoaderEngine is constructed which does all the file lookups again.
Instead keep the existing QIconLoaderEngine around if it was already
constructed.

Change-Id: Iace9a3f904730064f44939b2269316484ac6da2e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 620373e1ad47affbf7e63b73b8f634fbb273da99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-14 03:01:27 +00:00
Joerg Bornemann
cce1222cc0 Remove build machine path that was baked into the qmake binary
Remove the __FILE__ preprocessor macro that contains the full path to
the current source file. This is needed for reproducible builds.

The macro was only used for two debug messages. It's enough to mention
the file name - if at all.

Fixes: QTBUG-96281
Pick-to: 6.6 6.5
Change-Id: I7940ec090b570ec0105196a881e4c73c279bd248
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7cc55822fb94dcbba4e686664ebfca233513b20e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-13 20:58:24 +00:00
Carl Schwan
76d47dce1b Adapt QMutableHashIterator to change in QMultiHash
QMultiHash doesn't inherit from QHash since Qt 6.0 so we can't use
QMutableHashIterator anymore with QMultiHash.

Pick-to: 6.6 6.5
Change-Id: I9e755899e0a1e331f452a618b6d8a127715c54d4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1c592199afa77247df84d66fc92a8455dd6ce988)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-13 20:58:24 +00:00
Marc Mutz
cc6f8dc980 qarraydata.h: don't rely on transitive include of qflags.h
The QFlags header came in via qpair.h and broke when we tried to
remove qglobal.h from qpair.h.

Pick-to: 6.6 6.5 6.2
Change-Id: I335b84cc1d73303f8f2497427a21fba255ee11f9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit b2288de7cdb32e622da09163d4c373439760b221)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-13 20:58:24 +00:00
Marc Mutz
eab3faad6c [docs] QDeadlineTimer: remove docs of a function that exists no more
The _q_data() function was removed before 6.6, but the docs
remained. Presumably qdoc doesn't care about non-existing \internal
\fn's.

Found while hunting for QPair uses to eliminate.

Amends eac30fcb827e9bb1372e46290c060c833bd8ea67.

Pick-to: 6.6
Change-Id: I73fdfe69d4158977a6a80eb2a5e790ada09fe85a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 04d0c4e81cef0bb649ae839b6a9b290745408d95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-13 20:58:24 +00:00
Marc Mutz
2d5a239285 QtCore platform code: s/QPair/std::pair/
Also port qMakePair() to just braced initialization and CTAD.

Task-number: QTBUG-115841
Change-Id: I46ee214ab47513375a6e28e3b439c7b060581235
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 87361727ffafbee460970cdb8e72056653fd2443)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-13 20:58:24 +00:00
Marc Mutz
02eb5e6d30 qpair.h: remove duplicate QPair alias definition
The original is in qcontainerfwd.h these days, so just include that.

Change-Id: I1d0adaf528f158c48caf47d65b20d09eff06f57d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 714cbf82558399e0e32d0e2e226783c9ece53a9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-13 20:58:24 +00:00
Marc Mutz
cab0d26c45 QMap/QHash: s/QPair/std::pair/
Also port from qMakePair to just braced initialization using CTAD.

Task-number: QTBUG-115841
Change-Id: Ib0ad55d7110521e34004dc9050022f9c0046722e
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 0d1575828015f99a495af84fb7de3746c7f61717)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-13 20:58:24 +00:00
Marc Mutz
8cba66e91d Replace QPair with std::pair in the docs
QPair _is_ std::pair. It's confusing that debuggers consistently show
the real name, std::pair, while the API and docs continue to maintain
the illusion that there is such a thing as QPair.

Use std::pair everywhere.

Pick-to: 6.6 6.5
Task-number: QTBUG-115841
Change-Id: I009e2fc415a79a74b583a13cf11e4ff9483a7f6b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit ec67d0c942a7756afbb6e21c76e835efd3557427)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-13 20:58:23 +00:00
Marc Mutz
0710e9cd03 QDateTime: s/QPair/std::pair/
Task-number: QTBUG-115841
Change-Id: I8c225e51ca3539b816e549aaf589383ba90ac306
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 44df0a44b20138ff6b6232743afb5d8954374c3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-13 20:58:23 +00:00
Ievgenii Meshcheriakov
f77af70148 QAbstractProxyModel: Emit headerDataChanged() signal with valid data
This amends commit a0bcad39033bddd9b9d14a524b829513105913d3.

Delayed signals emitted by the previous commit may have
invalid parameters if the source model was updated several
times before entering the event loop. This commit fixes that
by evaluating the section range immediately before emitting
the signal. This commit also ensures that the signal is
emitted only once after entering the event loop.

Fixes: QTBUG-119155
Pick-to: 6.6 6.5
Change-Id: I9e84703cca26fde8464a6b9a414bb7462cbb9abd
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 734354c0bae543795222a47cca2a013352d49745)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-13 20:58:23 +00:00
Tor Arne Vestbø
5659233065 macOS: Don't reset focus window to top level window when becoming key
The NSWindow becomes the "key window" when it's the window that currently
receives keyboard events. This happens when switching activation between
windows of the same app, or when the app is made active, restoring the
key window status.

Since the keyWindow property only applies to top level windows we were
skipping child windows when processing the event callback, but we then
proceeded to pass the top level window() to handleFocusWindowChanged,
instead of the QWindow of the key window's first responder (the view
that receives key input sent to the top level key window).

To fix this, we let each platform window send its own focus change
event, if it's the first responder, instead of relying on the top
level window to send it on behalf of possible child windows. This
decoupling ensures that we also send focus changes when we're not
part of a view hierarchy Qt controls.

Task-number: QTBUG-119287
Fixes: QTBUG-119054
Pick-to: 6.6 6.5
Change-Id: Iac06fe800291e243432335169c52db7685e173df
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit cf9b143cb3076a5d3ad8beec8ecf5175be925ae9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-13 10:06:43 +00:00
Thiago Macieira
98af9bd9d3 qYieldCpu: ensure we don't use asm statement with MSVC on ARM
Amends a7f227f56cfe562280e89d3c73040f7e8384129e.

It doesn't support that anywhere except i386, and even there it has a
different syntax than what we're using here. This code assumed ARM was
only ued with GCC-like compilers.

 qglobal.c.obj : error LNK2019: unresolved external symbol asm referenced in function tst_qYieldCpu
 tests\auto\corelib\global\qglobal\tst_qglobal.exe : fatal error LNK1120: 1 unresolved externals

Note: if we're getting here, it means the _YIELD_PROCESSOR() generic
macro was not used, which means there is no ARM YIELD being emitted for
MSVC on ARM for C code (for C++, the macro appears to be working). This
is likely to be a performance issue, which will need to be fixed by
someone who has an interest in improving performance on those
conditions.

Fixes: QTBUG-119881
Change-Id: Ica7a43f6147b49c187ccfffd179f04e1ab643302
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 91478930711c99c876f0df9475c056445eea96b6)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-12 17:13:11 +00:00
Thiago Macieira
35ffe8749e QStringBuilder: use data_ptr().data() instead of constData()
As the comment says, this allows us to skip the check for non-detached
strings and for null ones. We know that the one we've just created isn't
either, so long as len != 0. All QConcatenable::appendTo() calls do
nothing if len == 0, including not calling memcpy() at all.

Moreover, because it no longer references the QByteArray::_empty
variable, the GCC -Warray-bounds warning should be gone too.

Task-number: QTBUG-116763
Pick-to: 6.6 6.5
Change-Id: Ica7a43f6147b49c187ccfffd179eba2897ce2aff
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 06c724881c4227acf308e54ebd3db8235bb6b740)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-12 17:11:59 +00:00
Michael Weghorn
9cd1b8a28d a11y: Only send focus event when item has focus
When the current item in an item view has changed,
only send an accessible focus event when the item view
actually has focus.

Sending a focus event when the item doesn't actually
have focus is incorrect and breaks focus tracking in
assistive technology, like the Orca screen reader.

With this change in place, the focus event for the
newly selected item/child still gets sent when
changing the item using the keyboard or
by clicking on it using the mouse (since the item
view has focus in those cases), but not
when it gets changed programmatically
while the keyboard focus is somewhere else.

Fixes: QTBUG-118800
Pick-to: 6.6 6.5
Change-Id: I5540cdfce6d0ed076d4bb871e5862fddcdf05941
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a149b3fd533525d0b260893019b41b300a554f8d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-12 00:44:40 +00:00
Marc Mutz
8f77dffb39 tst_QtEndian: rewrite the ENDIAN_TEST macros to support FP
No functional change, yet. Just dissociating the data name from type
name, so we can add tests for FP types in a follow-up step.

Pick-to: 6.6 6.5
Change-Id: I98fdebb49cca614ab27db146c4bacafd190e7d9b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f25804b3955d0b621ac8ff26470f950dbd1e3337)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-11 23:28:31 +00:00
Marc Mutz
3446ece056 QDuplicateTracker: test with std::string, too
std::string is a nice value_type for when you want to track short
strings (because of its SSO). Check that it works, incl. in case
the implementation falls back to QSet in the absence of std::pmr
support in the stdlib.

Pick-to: 6.6 6.5
Change-Id: I2406258355295c2b1300c4ae8001cead59bb27d6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fe8c8e0fceec09b6ac6f358d522aeae9a5550bd0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-11 23:26:57 +00:00
Thiago Macieira
9039b0cd25 QArrayData: move AlignedQArrayData to the public header
This allows us to use it in QTypedArrayData<T>::AlignmentDummy, which is
used in __builtin_assume_aligned() as a hint to the compiler. This
increases the value we were passing as the compiler hint from 4 to 8 on
32-bit platforms and from 8 to 16 on 64-bit platforms. We actually do
align to a bit higher than even that, but that's not an ABI guarantee
we're making.

However, it looks like GCC on 32-bit platforms is buggy, so we work
around it. Commit r240248 ("Make max_align_t respect _Float128.",
63012d9a57edc950c5f30242d1e19318b5708060 in Git) increased
std::max_align_t to 16 bytes on all platforms, saying "Such an increase
is of course an ABI change" and "I think glibc malloc alignment should
also increase to 16-byte 32-bit x86", but such a change to glibc was
never implemented. Moreover, there are systems that don't use glibc,
such as when using GCC on other OSes.

This is not a change in Qt behavior anywhere. i386 does not (usually) do
alignment checks, so most code wouldn't notice this at all.

Change-Id: I79e700614d034281bf55fffd178fa0aee2344307
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4d57b30194f31865132312c67abf796cb58a0f8f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-11 18:42:16 +00:00
Thiago Macieira
5d534ee9a9 QArrayData: add allocate1 and allocate2 for 1- and 2-byte types
This makes the two most-often used QTypedArrayData::allocate() -- the
ones for char (for QByteArray) and char16_t (for QString) -- go to
specialized versions, which have much simpler code. After all,
multiplications by 1 are quite trivial.

I didn't check whether an LTO compiler was const-propagating the sizes
in inlined calls from qstring.cpp and qbytearray.cpp. But not everyone
uses LTO, so this benefits everyone, in a very hot path, for minimal
cost.

Change-Id: Ifa1111900d6945ea8e05fffd177dd1ce659b3fd5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4d7864f0517679ebe70a2a96afdae5dc4f5a2d62)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-11 18:42:05 +00:00
Marc Mutz
377066e407 Fix return value of qbswap(qint128)
Should be qint128, not quint128.

[ChangeLog][QtCore][QtEndian] Fixed return type of qbswap(qint128)
(was: quint128).

No tests for this exist, so no wonder it fell through. Added them.

Amends befda1accab417ce5f55cb11816e6ded51af55e3.

Pick-to: 6.6
Change-Id: Ibf87724b1d500081caca46af1c598975964e04c0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 7a829eaf51853e0852db28b8b8223e1a62a3db0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-11 17:46:41 +00:00
Fredrik Ålund
fbee3c4864 Build the QtSql plugin for Mimer SQL on macOS in universal binary mode
With the new provisioning scripts the QtSql plugin for Mimer SQL can now
be built in universal binary mode on macOS

Fixes: QTBUG-111219
Pick-to: 6.6
Change-Id: Iefc45b510bd17822aa7782a2c42860941eb19fc8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d557718d68184f6b56b17a3b5b54d1d5511a5294)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-11 17:05:23 +00:00
Tor Arne Vestbø
4075ffa498 macOS: Use single truth to track file dialog current directory
Unfortunately we can not rely on the file dialog panel for this,
via the directoryURL property, as that property has not yet been
updated during a panel:directoryDidChange: callback, resulting in
the directory reported to the user being the previous directory.

Since we already have to store the current directory for the case
where we haven't yet created the file dialog panel we re-use this
variable as the single place to store the current directory.

It's not clear whether we still need to normalize the strings
we get from the NSSavePanel, but the code has been left in,
even if the old callback code didn't normalize the path that
we then emitted as directoryEntered().

Fixes: QTBUG-119371
Pick-to: 6.6 6.5 6.2
Change-Id: I379a47053302e73d5e06a2b941f40365c17390d5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a81395f2c604c84cd0e6f18165c766419f26b7ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-11 15:36:01 +00:00
Tor Arne Vestbø
c8d2158bd2 macOS: Handle NSNull when file dialog directories change
For some directories, such as the 'Recents' entry in the native file
dialog, the panel:directoryDidChange: callback will report a NSNull
for the NSString path, which results in an exception when trying to
compute the length of this null entry.

Pick-to: 6.6 6.5 6.2
Change-Id: Ic9cddb54ea713b8fbdcaf0f4fb506ac96e90c9fe
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3bf7e0693ec1df01d2d27e28ab38f553beaa9c82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-11 15:35:52 +00:00
David Faure
bbd868ff68 Doc: QIdentityProxyModel::itemData() should be reimplemented too
This is a "regression" (voluntary, known) from commit
c27d2a57a441f9a1ce760e71635bd4c96882249d which changed
QAbstractProxyModel::itemData() to call the source model's itemData(),
so our data() reimplementation is no longer used.

Of course this only matters if itemData() is actually called, which
isn't the case in Qt itself. People will likely skip this if they don't
care - but if itemData() is used in the project, then this shows how
to reimplement it correctly.

Pick-to: 6.6
Change-Id: I3acea16c05d30d7526bac32fd6cce42b5ad4b617
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit abc739600447af06befaca8ae616dd607b99b184)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-11 15:35:51 +00:00
Oliver Wolff
b876d260b6 windeployqt: Proper error message when qtpaths.bat/.exe could not be run
If qtpaths cannt be found windeployqt should complain about that fact.
Previously it complained about "Unsupported platform".

Pick-to: 6.6 6.5
Change-Id: I4db954633c31ceac69c4d3c0e55cbe942c3272fd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit bf2f4678b0c1a17ad8d18809335cfb69d2c6527a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-12-11 14:07:28 +00:00
3664 changed files with 115877 additions and 51704 deletions

View File

@ -7,11 +7,10 @@ if (NOT DEFINED QT_SUPERBUILD OR DEFINED QT_REPO_MODULE_VERSION)
set(QT_EXTRA_INTERNAL_TARGET_DEFINES "QT_LEAN_HEADERS=1")
endif()
set(QT_REPO_MODULE_VERSION "6.7.0")
set(QT_REPO_MODULE_VERSION "6.7.2")
set(QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT "alpha1")
set(QT_COPYRIGHT_YEAR "2023")
set(QT_COPYRIGHT "Copyright (C) ${QT_COPYRIGHT_YEAR} The Qt Company Ltd and other contributors.")
set(QT_COPYRIGHT "Copyright (C) The Qt Company Ltd. and other contributors.")
# Minimum requirement for building Qt
set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_BUILDING_QT_SHARED "3.16")

View File

@ -12,62 +12,12 @@ cmake_minimum_required(VERSION 3.16)
# Get the repo version and CMake policy details
include(.cmake.conf)
# Bail out if any part of the build directory's path is symlinked.
function(qt_internal_check_if_path_has_symlinks path)
get_filename_component(dir "${path}" ABSOLUTE)
set(is_symlink FALSE)
if(CMAKE_HOST_WIN32)
# CMake marks Windows mount points as symbolic links, so use simplified REALPATH check
# on Windows platforms instead of IS_SYMLINK.
get_filename_component(dir_realpath "${dir}" REALPATH)
if(NOT dir STREQUAL dir_realpath)
set(is_symlink TRUE)
endif()
else()
while(TRUE)
if(IS_SYMLINK "${dir}")
set(is_symlink TRUE)
break()
endif()
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBaseHelpers.cmake)
set(prev_dir "${dir}")
get_filename_component(dir "${dir}" DIRECTORY)
if("${dir}" STREQUAL "${prev_dir}")
return()
endif()
endwhile()
endif()
if(is_symlink)
set(possible_solutions_for_resolving_symlink [[
- Map directories using a transparent mechanism such as mount --bind
- Pass the real path of the build directory to CMake, e.g. using
cd $(realpath <path>) before invoking cmake <source_dir>.
]])
if(QT_ALLOW_SYMLINK_IN_PATHS)
# In some cases, e.g., Homebrew, it is beneficial to skip this check.
# Before this, Homebrew had to patch this out to be able to get their build.
message(WARNING
"The path \"${path}\" contains symlinks. "
"This is not recommended, and it may lead to unexpected issues. If you do "
"not have a good reason for enabling 'QT_ALLOW_SYMLINK_IN_PATHS', disable "
"it, and follow one of the following solutions: \n"
"${possible_solutions_for_resolving_symlink} ")
else()
message(FATAL_ERROR
"The path \"${path}\" contains symlinks. "
"This is not supported. Possible solutions: \n"
"${possible_solutions_for_resolving_symlink} ")
endif()
endif()
endfunction()
qt_internal_check_if_path_has_symlinks("${CMAKE_BINARY_DIR}")
# Run auto detection routines, but not when doing standalone tests. In that case, the detection
# results are taken from either QtBuildInternals or the qt.toolchain.cmake file. Also, inhibit
# auto-detection in a top-level build, because the top-level project file already includes it.
if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_SUPERBUILD)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtAutoDetect.cmake)
endif()
# This needs to be called before the first project() call.
qt_internal_qtbase_run_autodetect()
# This call will load any provided cmake toolchain file.
project(QtBase
@ -77,141 +27,6 @@ project(QtBase
LANGUAGES CXX C ASM
)
if(NOT QT_BUILD_STANDALONE_TESTS)
# Should this Qt be static or dynamically linked?
option(BUILD_SHARED_LIBS "Build Qt statically or dynamically" ON)
set(QT_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
set(QT_BUILD_EXTRA_IDE_FILE_PATTERNS bin/* libexec/*)
# This variable is also set in Qt6CoreConfigExtras.cmake, but it's not loaded when building
# qtbase. Set it here so qt_add_plugin can compute the proper plugin flavor.
set(QT6_IS_SHARED_LIBS_BUILD ${BUILD_SHARED_LIBS})
# BUILD_SHARED_LIBS influences the minimum required CMake version. The value is set either by:
# a cache variable provided on the configure command line
# or set by QtAutoDetect.cmake depending on the platform
# or specified via a toolchain file that is loaded by the project() call
# or set by the option() call above
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtCMakeVersionHelpers.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtPublicCMakeVersionHelpers.cmake")
qt_internal_check_and_warn_about_unsuitable_cmake_version()
## Add some paths to check for cmake modules:
list(PREPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/extra-cmake-modules/find-modules"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/kwin"
)
if(MACOS)
# Add module directory to pick up custom Info.plist template
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos")
elseif(IOS)
# Add module directory to pick up custom Info.plist template
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/ios")
endif()
## Find the build internals package.
set(QT_BUILD_INTERNALS_SKIP_CMAKE_MODULE_PATH_ADDITION TRUE)
list(PREPEND CMAKE_PREFIX_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
)
find_package(QtBuildInternals CMAKE_FIND_ROOT_PATH_BOTH)
unset(QT_BUILD_INTERNALS_SKIP_CMAKE_MODULE_PATH_ADDITION)
else()
# When building standalone tests, an istalled BuildInternals package already exists.
find_package(Qt6 REQUIRED COMPONENTS BuildInternals CMAKE_FIND_ROOT_PATH_BOTH)
endif()
qt_internal_project_setup()
qt_build_repo_begin()
if(NOT QT_BUILD_STANDALONE_TESTS)
## Should this Qt be built with Werror?
option(WARNINGS_ARE_ERRORS "Build Qt with warnings as errors" ${FEATURE_developer_build})
## Should this Qt create versioned hard link for some tools?
option(QT_CREATE_VERSIONED_HARD_LINK "Enable the use of versioned hard link" ON)
## QtBase specific configure tests:
include(QtBaseConfigureTests)
## Build System tests:
include(QtBaseCMakeTesting)
## Targets for global features, etc.:
include(QtBaseGlobalTargets)
## Set language standards after QtBaseGlobalTargets, because that's when the relevant
## feature variables are available.
qt_set_language_standards()
#include CoreMacros() for qt6_generate_meta_types()
set(QT_DEFAULT_MAJOR_VERSION 6)
include(src/corelib/Qt6CoreMacros.cmake)
# Needed when building qtbase for android.
if(ANDROID)
include(src/corelib/Qt6AndroidMacros.cmake)
_qt_internal_create_global_android_targets()
endif()
if(WASM)
# Needed when building for WebAssembly.
include(cmake/QtWasmHelpers.cmake)
include(src/corelib/Qt6WasmMacros.cmake)
qt_internal_setup_wasm_target_properties(Platform)
endif()
# Set up optimization flags like in qmake.
# This function must be called after the global QT_FEATURE_xxx variables have been set up,
# aka after QtBaseGlobalTargets is processed.
# It also has to be called /before/ adding add_subdirectory(src), so that per-directory
# modifications can still be applied if necessary (like in done in Core and Gui).
qt_internal_set_up_config_optimizations_like_in_qmake()
## Setup documentation
add_subdirectory(doc)
## Visit all the directories:
add_subdirectory(src)
endif()
if(NOT QT_BUILD_STANDALONE_TESTS)
if(QT_WILL_BUILD_TOOLS AND QT_FEATURE_settings)
add_subdirectory(qmake)
endif()
# As long as we use the mkspecs (for qplatformdefs.h), we need to always
# install it, especially when cross-compiling.
set(mkspecs_install_dir "${INSTALL_MKSPECSDIR}")
qt_path_join(mkspecs_install_dir ${QT_INSTALL_DIR} ${mkspecs_install_dir})
file(GLOB mkspecs_subdirs
LIST_DIRECTORIES TRUE
"${PROJECT_SOURCE_DIR}/mkspecs/*")
foreach(entry IN LISTS mkspecs_subdirs)
if (IS_DIRECTORY ${entry})
qt_copy_or_install(DIRECTORY "${entry}"
DESTINATION ${mkspecs_install_dir}
USE_SOURCE_PERMISSIONS)
else()
qt_copy_or_install(FILES "${entry}"
DESTINATION ${mkspecs_install_dir})
endif()
endforeach()
endif()
qt_build_repo_post_process()
if(QT_BUILD_TESTS)
add_subdirectory(tests)
if(NOT QT_BUILD_TESTS_BY_DEFAULT)
set_property(DIRECTORY tests PROPERTY EXCLUDE_FROM_ALL TRUE)
endif()
endif()
qt_build_repo_end()
if(NOT QT_BUILD_STANDALONE_TESTS AND QT_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
qt_internal_qtbase_build_repo()

39
LICENSES/Unicode-3.0.txt Normal file
View File

@ -0,0 +1,39 @@
UNICODE LICENSE V3
COPYRIGHT AND PERMISSION NOTICE
Copyright © 2004-2023 Unicode, Inc.
NOTICE TO USER: Carefully read the following legal agreement. BY
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
Permission is hereby granted, free of charge, to any person obtaining a
copy of data files and any associated documentation (the "Data Files") or
software and any associated documentation (the "Software") to deal in the
Data Files or Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, and/or sell
copies of the Data Files or Software, and to permit persons to whom the
Data Files or Software are furnished to do so, provided that either (a)
this copyright and permission notice appear with all copies of the Data
Files or Software, or (b) this copyright and permission notice appear in
associated Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in these Data Files or Software without prior written
authorization of the copyright holder.

View File

@ -0,0 +1,22 @@
UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
Unicode Data Files include all data files under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and http://www.unicode.org/utility/trac/browser/.
Unicode Data Files do not include PDF online code charts under the directory http://www.unicode.org/Public/.
Software includes any source code published in the Unicode Standard or under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and http://www.unicode.org/utility/trac/browser/.
NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright © 1991-2016 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies of the Data Files or Software, or
(b) this copyright and permission notice appear in associated Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder.

5
LICENSES/blessing.txt Normal file
View File

@ -0,0 +1,5 @@
The author disclaims copyright to this source code. In place of a legal notice, here is a blessing:
May you do good and not evil.
May you find forgiveness for yourself and forgive others.
May you share freely, never taking more than you give.

View File

@ -1,4 +1,5 @@
@echo off
setlocal
:: The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory.
set script_dir_path=%~dp0

View File

@ -1,4 +1,5 @@
@echo off
setlocal
:: The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory.
set script_dir_path=%~dp0

View File

@ -19,9 +19,9 @@ if not exist "%module_root%\CMakeLists.txt" (
set cmake_scripts_dir=%script_dir_path%\@__relative_path_to_cmake_scripts_dir@
echo %*>config.opt.in
call "%script_dir_path%"\qt-cmake.bat -DSKIP_ARGS=1 -DIN_FILE=config.opt.in -DOUT_FILE=config.opt ^
call "%script_dir_path%\qt-cmake.bat" -DSKIP_ARGS=1 -DIN_FILE=config.opt.in -DOUT_FILE=config.opt ^
-P "%cmake_scripts_dir%\QtWriteArgsFile.cmake"
call "%script_dir_path%"\qt-cmake-private.bat -DOPTFILE=config.opt -DMODULE_ROOT="%module_root%" ^
call "%script_dir_path%\qt-cmake-private.bat" -DOPTFILE=config.opt -DMODULE_ROOT="%module_root%" ^
-DCMAKE_COMMAND="%script_dir_path%\qt-cmake-private.bat" ^
-P "%cmake_scripts_dir%\QtProcessConfigureArgs.cmake"
goto :eof

View File

@ -137,6 +137,9 @@ foreach(_comp ${XCB_known_components})
set(XCB_${_comp}_pkg_config "xcb-${_lc_comp}")
set(XCB_${_comp}_lib "xcb-${_lc_comp}")
set(XCB_${_comp}_header "xcb/${_lc_comp}.h")
if(USE_XCB_${_comp}_STATIC)
set(XCB_${_comp}_lib "lib${XCB_${_comp}_lib}.a")
endif()
endforeach()
# exceptions
set(XCB_XCB_component_deps)

View File

@ -158,7 +158,15 @@ if (ECM_ENABLE_SANITIZERS)
endif()
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${XSAN_COMPILE_FLAGS}" )
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
link_libraries(${XSAN_LINKER_FLAGS})
string(JOIN "" linker_flags
"$<"
"$<NOT:"
"$<BOOL:$<TARGET_PROPERTY:SKIP_SANITIZER>>"
">:"
"${XSAN_LINKER_FLAGS}"
">"
)
link_libraries("${linker_flags}")
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
string(REPLACE "-Wl,--no-undefined" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")

View File

@ -43,8 +43,7 @@ else()
else()
set(MimerSQL_library_hints "")
endif()
elseif(APPLE AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin"
AND CMAKE_OSX_ARCHITECTURES MATCHES "^(x86_64|arm64|)$")
elseif(APPLE AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(MimerSQL_library_hints "/usr/local/lib")
set(MimerSQL_include_dir_hints "/usr/local/include")
else()

View File

@ -99,6 +99,9 @@ endif()
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
if(POLICY CMP0159)
cmake_policy(SET CMP0159 NEW)
endif()
set(PostgreSQL_INCLUDE_PATH_DESCRIPTION "top-level directory containing the PostgreSQL include directories. E.g /usr/local/include/PostgreSQL/8.4 or C:/Program Files/PostgreSQL/8.4/include")
set(PostgreSQL_INCLUDE_DIR_MESSAGE "Set the PostgreSQL_INCLUDE_DIR cmake cache entry to the ${PostgreSQL_INCLUDE_PATH_DESCRIPTION}")

View File

@ -20,6 +20,13 @@ if (unofficial-brotli_FOUND)
set(WrapBrotli_FOUND ON)
else()
get_cmake_property(__packages_not_found PACKAGES_NOT_FOUND)
if(__packages_not_found)
list(REMOVE_ITEM __packages_not_found unofficial-brotli)
set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND "${__packages_not_found}")
endif()
unset(__packages_not_found)
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(libbrotlidec QUIET IMPORTED_TARGET "libbrotlidec")

View File

@ -31,7 +31,7 @@ check_cxx_source_compiles("
int main(int, char **argv)
{
res_state statep;
res_state statep = 0;
int n = res_nmkquery(statep, 0, argv[1], 0, 0, NULL, 0, NULL, NULL, 0);
n = res_nsend(statep, NULL, 0, NULL, 0);
n = dn_expand(NULL, NULL, NULL, NULL, 0);

View File

@ -28,6 +28,13 @@ if(harfbuzz_FOUND AND TARGET "${__harfbuzz_target_name}")
if(harfbuzz_VERSION)
set(WrapSystemHarfbuzz_VERSION "${harfbuzz_VERSION}")
endif()
else()
get_cmake_property(__packages_not_found PACKAGES_NOT_FOUND)
if(__packages_not_found)
list(REMOVE_ITEM __packages_not_found harfbuzz)
set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND "${__packages_not_found}")
endif()
unset(__packages_not_found)
endif()
if(__harfbuzz_broken_config_file OR NOT __harfbuzz_found)

View File

@ -16,6 +16,13 @@ if(PCRE2_FOUND AND TARGET "${__pcre2_target_name}")
if(PCRE2_VERSION)
set(WrapSystemPCRE2_VERSION "${PCRE2_VERSION}")
endif()
else()
get_cmake_property(__packages_not_found PACKAGES_NOT_FOUND)
if(__packages_not_found)
list(REMOVE_ITEM __packages_not_found PCRE2)
set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND "${__packages_not_found}")
endif()
unset(__packages_not_found)
endif()
if(NOT __pcre2_found)

View File

@ -28,5 +28,13 @@ if(ZLIB_FOUND)
endif()
endif()
if(ZLIB_VERSION)
set(WrapSystemZLIB_VERSION "${ZLIB_VERSION}")
elseif(ZLIB_VERSION_STRING)
set(WrapSystemZLIB_VERSION "${ZLIB_VERSION_STRING}")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WrapSystemZLIB DEFAULT_MSG WrapSystemZLIB_FOUND)
find_package_handle_standard_args(WrapSystemZLIB
REQUIRED_VARS WrapSystemZLIB_FOUND
VERSION_VAR WrapSystemZLIB_VERSION)

View File

@ -25,20 +25,30 @@ find_package(zstd CONFIG QUIET)
include(FindPackageHandleStandardArgs)
if(TARGET zstd::libzstd_static OR TARGET zstd::libzstd_shared)
if(TARGET zstd::libzstd_static OR TARGET zstd::libzstd_shared OR TARGET zstd::libzstd)
find_package_handle_standard_args(WrapZSTD
REQUIRED_VARS zstd_VERSION VERSION_VAR zstd_VERSION)
if(TARGET zstd::libzstd_shared)
set(zstdtargetsuffix "_shared")
elseif(TARGET zstd::libzstd)
set(zstdtargetsuffix "")
else()
set(zstdtargetsuffix "_static")
endif()
if(NOT TARGET WrapZSTD::WrapZSTD)
add_library(WrapZSTD::WrapZSTD INTERFACE IMPORTED)
set_target_properties(WrapZSTD::WrapZSTD PROPERTIES
INTERFACE_LINK_LIBRARIES "zstd::libzstd${zstdtargetsuffix}")
endif()
else()
get_cmake_property(__packages_not_found PACKAGES_NOT_FOUND)
if(__packages_not_found)
list(REMOVE_ITEM __packages_not_found zstd)
set_property(GLOBAL PROPERTY PACKAGES_NOT_FOUND "${__packages_not_found}")
endif()
unset(__packages_not_found)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_ZSTD QUIET "libzstd")

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
@PACKAGE_INIT@
cmake_minimum_required(VERSION @min_new_policy_version@...@max_new_policy_version@)

View File

@ -253,7 +253,8 @@ function(qt_internal_android_dependencies target)
# Module plugins
if(module_plugin_types)
foreach(plugin IN LISTS module_plugin_types)
string(APPEND file_contents "<bundled file=\"${INSTALL_PLUGINSDIR}/${plugin}\" />\n")
string(APPEND file_contents
"<bundled file=\"${INSTALL_PLUGINSDIR}/${plugin}\" type=\"plugin_dir\"/>\n")
endforeach()
endif()

View File

@ -64,15 +64,6 @@ function(qt_auto_detect_wasm)
endif()
endfunction()
function(qt_auto_detect_cmake_generator)
if(NOT CMAKE_GENERATOR MATCHES "Ninja" AND NOT QT_SILENCE_CMAKE_GENERATOR_WARNING)
message(WARNING
"The officially supported CMake generator for building Qt is Ninja. "
"You are using: '${CMAKE_GENERATOR}' instead. "
"Thus, you might encounter issues. Use at your own risk.")
endif()
endfunction()
function(qt_auto_detect_android)
# We assume an Android build if any of the ANDROID_* cache variables are set.
if(DEFINED ANDROID_SDK_ROOT
@ -474,7 +465,6 @@ macro(qt_internal_setup_autodetect)
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/platforms")
endif()
qt_auto_detect_cmake_generator()
qt_auto_detect_cyclic_toolchain()
qt_auto_detect_cmake_config()
qt_auto_detect_darwin()

View File

@ -62,8 +62,13 @@ function(qt_run_config_test_architecture)
endif()
message(STATUS "Extracting architecture info from ${_arch_file}.")
cmake_policy(PUSH)
if(POLICY CMP0159)
cmake_policy(SET CMP0159 NEW)
endif()
file(STRINGS "${_arch_file}" _arch_lines LENGTH_MINIMUM 16 LENGTH_MAXIMUM 1024 ENCODING UTF-8
REGEX "==Qt=magic=Qt==")
cmake_policy(POP)
foreach (_line ${_arch_lines})
string(LENGTH "${_line}" lineLength)
@ -73,7 +78,7 @@ function(qt_run_config_test_architecture)
string(SUBSTRING "${_line}" ${_pos} -1 _architecture)
endif()
string(FIND "${_line}" "==Qt=magic=Qt== Sub-architecture:" _pos)
if (_pos GREATER -1 AND ${lineLength} GREATER 33)
if (_pos GREATER -1 AND NOT _line MATCHES "Sub-architecture:$")
math(EXPR _pos "${_pos}+34")
string(SUBSTRING "${_line}" ${_pos} -1 _sub_architecture)
string(REPLACE " " ";" _sub_architecture "${_sub_architecture}")

222
cmake/QtBaseHelpers.cmake Normal file
View File

@ -0,0 +1,222 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#
# Note that this file is not installed.
# Bail out if any part of the build directory's path is symlinked.
function(qt_internal_check_if_path_has_symlinks path)
get_filename_component(dir "${path}" ABSOLUTE)
set(is_symlink FALSE)
if(CMAKE_HOST_WIN32)
# CMake marks Windows mount points as symbolic links, so use simplified REALPATH check
# on Windows platforms instead of IS_SYMLINK.
get_filename_component(dir_realpath "${dir}" REALPATH)
if(NOT dir STREQUAL dir_realpath)
set(is_symlink TRUE)
endif()
else()
while(TRUE)
if(IS_SYMLINK "${dir}")
set(is_symlink TRUE)
break()
endif()
set(prev_dir "${dir}")
get_filename_component(dir "${dir}" DIRECTORY)
if("${dir}" STREQUAL "${prev_dir}")
return()
endif()
endwhile()
endif()
if(is_symlink)
set(possible_solutions_for_resolving_symlink [[
- Map directories using a transparent mechanism such as mount --bind
- Pass the real path of the build directory to CMake, e.g. using
cd $(realpath <path>) before invoking cmake <source_dir>.
]])
if(QT_ALLOW_SYMLINK_IN_PATHS)
# In some cases, e.g., Homebrew, it is beneficial to skip this check.
# Before this, Homebrew had to patch this out to be able to get their build.
message(WARNING
"The path \"${path}\" contains symlinks. "
"This is not recommended, and it may lead to unexpected issues. If you do "
"not have a good reason for enabling 'QT_ALLOW_SYMLINK_IN_PATHS', disable "
"it, and follow one of the following solutions: \n"
"${possible_solutions_for_resolving_symlink} ")
else()
message(FATAL_ERROR
"The path \"${path}\" contains symlinks. "
"This is not supported. Possible solutions: \n"
"${possible_solutions_for_resolving_symlink} ")
endif()
endif()
endfunction()
# There are three necessary copies of this macro in
# qtbase/cmake/QtBaseHelpers.cmake
# qtbase/cmake/QtBaseTopLevelHelpers.cmake
# qtbase/cmake/QtBuildRepoHelpers.cmake
macro(qt_internal_qtbase_setup_standalone_parts)
# A generic marker for any kind of standalone builds, either tests or examples.
if(NOT DEFINED QT_INTERNAL_BUILD_STANDALONE_PARTS
AND (QT_BUILD_STANDALONE_TESTS OR QT_BUILD_STANDALONE_EXAMPLES))
set(QT_INTERNAL_BUILD_STANDALONE_PARTS TRUE CACHE INTERNAL
"Whether standalone tests or examples are being built")
endif()
endmacro()
macro(qt_internal_qtbase_run_autodetect)
qt_internal_qtbase_setup_standalone_parts()
# Run auto detection routines, but not when doing standalone tests or standalone examples.
# In that case, the detection
# results are taken from either QtBuildInternals or the qt.toolchain.cmake file. Also, inhibit
# auto-detection in a top-level build, because the top-level project file already includes it.
if(NOT QT_INTERNAL_BUILD_STANDALONE_PARTS AND NOT QT_SUPERBUILD)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtAutoDetect.cmake)
endif()
endmacro()
macro(qt_internal_qtbase_pre_project_setup)
if(NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
# Should this Qt be static or dynamically linked?
option(BUILD_SHARED_LIBS "Build Qt statically or dynamically" ON)
set(QT_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
# This variable is also set in Qt6CoreConfigExtras.cmake, but it's not loaded when building
# qtbase. Set it here so qt_add_plugin can compute the proper plugin flavor.
set(QT6_IS_SHARED_LIBS_BUILD ${BUILD_SHARED_LIBS})
# BUILD_SHARED_LIBS influences the minimum required CMake version. The value is set either
# by:
# a cache variable provided on the configure command line
# or set by QtAutoDetect.cmake depending on the platform
# or specified via a toolchain file that is loaded by the project() call
# or set by the option() call above
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtCMakeVersionHelpers.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtPublicCMakeVersionHelpers.cmake")
qt_internal_check_and_warn_about_unsuitable_cmake_version()
## Add some paths to check for cmake modules:
list(PREPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/extra-cmake-modules/find-modules"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/kwin"
)
if(MACOS)
# Add module directory to pick up custom Info.plist template
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos")
elseif(IOS)
# Add module directory to pick up custom Info.plist template
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/ios")
endif()
## Find the build internals package.
set(QT_BUILD_INTERNALS_SKIP_CMAKE_MODULE_PATH_ADDITION TRUE)
list(PREPEND CMAKE_PREFIX_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
)
find_package(QtBuildInternals CMAKE_FIND_ROOT_PATH_BOTH)
unset(QT_BUILD_INTERNALS_SKIP_CMAKE_MODULE_PATH_ADDITION)
else()
# When building standalone parts, an istalled BuildInternals package already exists.
find_package(Qt6 REQUIRED COMPONENTS BuildInternals CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endmacro()
macro(qt_internal_qtbase_install_mkspecs)
# As long as we use the mkspecs (for qplatformdefs.h), we need to always
# install it, especially when cross-compiling.
set(mkspecs_install_dir "${INSTALL_MKSPECSDIR}")
qt_path_join(mkspecs_install_dir ${QT_INSTALL_DIR} ${mkspecs_install_dir})
file(GLOB mkspecs_subdirs
LIST_DIRECTORIES TRUE
"${PROJECT_SOURCE_DIR}/mkspecs/*")
foreach(entry IN LISTS mkspecs_subdirs)
if (IS_DIRECTORY ${entry})
qt_copy_or_install(DIRECTORY "${entry}"
DESTINATION ${mkspecs_install_dir}
USE_SOURCE_PERMISSIONS)
else()
qt_copy_or_install(FILES "${entry}"
DESTINATION ${mkspecs_install_dir})
endif()
endforeach()
endmacro()
macro(qt_internal_qtbase_build_repo)
qt_internal_qtbase_pre_project_setup()
qt_internal_project_setup()
qt_build_repo_begin()
if(NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
## Should this Qt be built with Werror?
option(WARNINGS_ARE_ERRORS "Build Qt with warnings as errors" ${FEATURE_developer_build})
## Should this Qt create versioned hard link for some tools?
option(QT_CREATE_VERSIONED_HARD_LINK "Enable the use of versioned hard link" ON)
## QtBase specific configure tests:
include(QtBaseConfigureTests)
## Build System tests:
include(QtBaseCMakeTesting)
## Targets for global features, etc.:
include(QtBaseGlobalTargets)
## Set language standards after QtBaseGlobalTargets, because that's when the relevant
## feature variables are available.
qt_set_language_standards()
#include CoreMacros() for qt6_generate_meta_types()
set(QT_DEFAULT_MAJOR_VERSION 6)
include(src/corelib/Qt6CoreMacros.cmake)
# Needed when building qtbase for android.
if(ANDROID)
include(src/corelib/Qt6AndroidMacros.cmake)
_qt_internal_create_global_android_targets()
endif()
if(WASM)
# Needed when building for WebAssembly.
include(cmake/QtWasmHelpers.cmake)
include(src/corelib/Qt6WasmMacros.cmake)
qt_internal_setup_wasm_target_properties(Platform)
endif()
# Set up optimization flags like in qmake.
# This function must be called after the global QT_FEATURE_xxx variables have been set up,
# aka after QtBaseGlobalTargets is processed.
# It also has to be called /before/ adding add_subdirectory(src), so that per-directory
# modifications can still be applied if necessary (like in done in Core and Gui).
qt_internal_set_up_config_optimizations_like_in_qmake()
## Setup documentation
add_subdirectory(doc)
## Visit all the directories:
add_subdirectory(src)
endif()
if(NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
if(QT_WILL_BUILD_TOOLS AND QT_FEATURE_settings)
add_subdirectory(qmake)
endif()
qt_internal_qtbase_install_mkspecs()
endif()
qt_build_repo_post_process()
qt_build_repo_impl_tests()
qt_build_repo_end()
qt_build_repo_impl_examples()
endmacro()

View File

@ -1,14 +1,29 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# There are three necessary copies of this macro in
# qtbase/cmake/QtBaseHelpers.cmake
# qtbase/cmake/QtBaseTopLevelHelpers.cmake
# qtbase/cmake/QtBuildRepoHelpers.cmake
macro(qt_internal_top_level_setup_standalone_parts)
# A generic marker for any kind of standalone builds, either tests or examples.
if(NOT DEFINED QT_INTERNAL_BUILD_STANDALONE_PARTS
AND (QT_BUILD_STANDALONE_TESTS OR QT_BUILD_STANDALONE_EXAMPLES))
set(QT_INTERNAL_BUILD_STANDALONE_PARTS TRUE CACHE INTERNAL
"Whether standalone tests or examples are being built")
endif()
endmacro()
# Depends on __qt6_qtbase_src_path being set in the top-level dir.
macro(qt_internal_top_level_setup_autodetect)
qt_internal_top_level_setup_standalone_parts()
# Run platform auto-detection /before/ the first project() call and thus
# before the toolchain file is loaded.
# Don't run auto-detection when doing standalone tests. In that case, the detection
# results are taken from either QtBuildInternals or the qt.toolchain.cmake file.
if(NOT QT_BUILD_STANDALONE_TESTS)
if(NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
set(__qt6_auto_detect_path "${__qt6_qtbase_src_path}/cmake/QtAutoDetect.cmake")
if(NOT EXISTS "${__qt6_auto_detect_path}")
message(FATAL_ERROR "Required file does not exist: '${__qt6_auto_detect_path}'")
@ -28,7 +43,7 @@ endmacro()
# Depends on __qt6_qtbase_src_path being set in the top-level dir.
macro(qt_internal_top_level_setup_cmake_module_path)
if (NOT QT_BUILD_STANDALONE_TESTS)
if (NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
set(__qt6_cmake_module_path "${__qt6_qtbase_src_path}/cmake")
if(NOT EXISTS "${__qt6_cmake_module_path}")
message(FATAL_ERROR "Required directory does not exist: '${__qt6_cmake_module_path}'")
@ -48,7 +63,7 @@ endmacro()
macro(qt_internal_top_level_setup_no_create_targets)
# Also make sure the CMake config files do not recreate the already-existing targets
if (NOT QT_BUILD_STANDALONE_TESTS)
if (NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
set(QT_NO_CREATE_TARGETS TRUE)
endif()
endmacro()
@ -62,7 +77,7 @@ macro(qt_internal_top_level_end)
endmacro()
function(qt_internal_print_top_level_info)
if(NOT QT_BUILD_STANDALONE_TESTS)
if(NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
# Display a summary of everything
include(QtBuildInformation)
include(QtPlatformSupport)
@ -73,7 +88,7 @@ endfunction()
macro(qt_internal_top_level_after_add_subdirectory)
if(module STREQUAL "qtbase")
if (NOT QT_BUILD_STANDALONE_TESTS)
if (NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
list(APPEND CMAKE_PREFIX_PATH "${QtBase_BINARY_DIR}/${INSTALL_LIBDIR}/cmake")
list(APPEND CMAKE_FIND_ROOT_PATH "${QtBase_BINARY_DIR}")
endif()

View File

@ -1,6 +1,22 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
function(qt_internal_validate_cmake_generator)
get_property(warning_shown GLOBAL PROPERTY _qt_validate_cmake_generator_warning_shown)
if(NOT warning_shown
AND NOT CMAKE_GENERATOR MATCHES "Ninja"
AND NOT QT_SILENCE_CMAKE_GENERATOR_WARNING
AND NOT DEFINED ENV{QT_SILENCE_CMAKE_GENERATOR_WARNING})
set_property(GLOBAL PROPERTY _qt_validate_cmake_generator_warning_shown TRUE)
message(WARNING
"The officially supported CMake generator for building Qt is "
"Ninja / Ninja Multi-Config. "
"You are using: '${CMAKE_GENERATOR}' instead. "
"Thus, you might encounter issues. Use at your own risk.")
endif()
endfunction()
macro(qt_internal_set_qt_building_qt)
# Set the QT_BUILDING_QT variable so we can verify whether we are building
# Qt from source.
@ -362,17 +378,18 @@ macro(qt_internal_setup_android_platform_specifics)
endmacro()
macro(qt_internal_setup_build_and_global_variables)
qt_internal_validate_cmake_generator()
qt_internal_set_qt_building_qt()
qt_internal_compute_features_from_possible_inputs()
# Depends on qt_internal_compute_features_from_possible_inputs
qt_internal_set_default_build_type()
qt_internal_set_cmake_build_type()
qt_internal_set_message_log_level(CMAKE_MESSAGE_LOG_LEVEL)
qt_internal_unset_extra_build_internals_vars()
qt_internal_get_generator_is_multi_config()
# Depends on qt_internal_set_default_build_type
# Depends on qt_internal_set_cmake_build_type
qt_internal_setup_cmake_config_postfix()
qt_internal_setup_position_independent_code()

View File

@ -58,8 +58,7 @@ endfunction()
function(qt_print_build_instructions)
if((NOT PROJECT_NAME STREQUAL "QtBase" AND
NOT PROJECT_NAME STREQUAL "Qt") OR
QT_BUILD_STANDALONE_TESTS)
NOT PROJECT_NAME STREQUAL "Qt") OR QT_INTERNAL_BUILD_STANDALONE_PARTS)
return()
endif()

View File

@ -10,9 +10,9 @@ qt_build_internals_set_up_private_api()
# This will find all Qt packages that are required for standalone tests.
# It will find more packages that needed for a certain test, but will ensure any test can
# be built.
qt_get_standalone_tests_config_files_path(standalone_tests_config_path)
qt_get_standalone_parts_config_files_path(standalone_parts_config_path)
file(GLOB config_files "${standalone_tests_config_path}/*")
file(GLOB config_files "${standalone_parts_config_path}/*")
foreach(file ${config_files})
include("${file}")
endforeach()
@ -23,5 +23,5 @@ qt_set_language_standards()
# Just before adding the test, change the local (non-cache) install prefix to something other than
# the Qt install prefix, so that tests don't try to install and pollute the Qt install prefix.
# Needs to be called after qt_get_standalone_tests_confg_files_path().
qt_set_up_fake_standalone_tests_install_prefix()
# Needs to be called after qt_get_standalone_parts_config_files_path().
qt_internal_set_up_fake_standalone_parts_install_prefix()

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# Propagate common variables via BuildInternals package.
set(QT_BUILD_SHARED_LIBS @BUILD_SHARED_LIBS@)
option(BUILD_SHARED_LIBS "Build Qt statically or dynamically" @BUILD_SHARED_LIBS@)
@ -132,43 +135,5 @@ if(NOT DEFINED QT_MAX_NEW_POLICY_CMAKE_VERSION)
set(QT_MAX_NEW_POLICY_CMAKE_VERSION "@max_new_policy_version@")
endif()
get_property(__qt_internal_extras_is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
# We want the same build type to be used when configuring all Qt repos or standalone
# tests or single tests.
# To do that, we need to force-set the CMAKE_BUILD_TYPE cache var because CMake itself
# initializes it with the value of CMAKE_BUILD_TYPE_INIT at the start of project
# configuration, so we need to override it.
# Note the value of CMAKE_BUILD_TYPE_INIT is different based on the platform, most
# Linux and macOS platforms will have it empty, but Windows platforms will have a value.
#
# We can't reliably differentiate between a value set on the command line by the user
# and one set by CMake, so we use a few heuristics:
# 1) When using a qt.toolchain.cmake file, we rely on the toolchain file to tell us
# if a value was set by the user at initial configure time. On a 2nd run there will
# always be a value in the cache, but at that point we've already set it to whatever it needs
# to be.
# 2) If a toolchain file is not used, we rely on the value of the CMake internal
# CMAKE_BUILD_TYPE_INIT variable.
# This won't work reliably on Windows where CMAKE_BUILD_TYPE_INIT is non-empty.
#
# Both cases won't handle an empty "" config set by the user, but we claim that's an
# unsupported config when building Qt.
#
# Allow an opt out when QT_NO_FORCE_SET_CMAKE_BUILD_TYPE is set.
# Finally, don't set the variable if a multi-config generator is used. This can happen
# when qtbase is built with a single config, but a test is built with a multi-config generator.
function(qt_internal_force_set_cmake_build_type_conditionally value)
# STREQUAL check needs to be expanded variables because an undefined var is not equal to an
# empty defined var.
if("${CMAKE_BUILD_TYPE}" STREQUAL "${CMAKE_BUILD_TYPE_INIT}"
AND NOT __qt_toolchain_cmake_build_type_before_project_call
AND NOT QT_NO_FORCE_SET_CMAKE_BUILD_TYPE
AND NOT __qt_internal_extras_is_multi_config)
set(CMAKE_BUILD_TYPE "${value}" CACHE STRING "Choose the type of build." FORCE)
set(__qt_build_internals_cmake_build_type "${value}" PARENT_SCOPE)
endif()
endfunction()
# Extra set of exported variables
@QT_EXTRA_BUILD_INTERNALS_VARS@

View File

@ -1,31 +1,130 @@
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
macro(qt_internal_set_default_build_type)
# Try to detect if CMAKE_BUILD_TYPE is default initialized by CMake, or it was set by the user.
#
# CMake initializes CMAKE_BUILD_TYPE to the value of CMAKE_BUILD_TYPE_INIT during the first
# project() call if CMAKE_BUILD_TYPE is empty.
#
# Unfortunately on most Windows platforms, it defaults to 'Debug', so we can't differentiate
# between a 'Debug' value set on the command line by the user, a value set by the project, or if it
# was default initialized.
# We need to rely on heuristics to determine that.
#
# We try to check the value of CMAKE_BUILD_TYPE before the first project() call by inspecting
# various variables:
# 1) When using a qt.toolchain.cmake file, we rely on the toolchain file to tell us
# if a value was set by the user at initial configure time via the
# __qt_toolchain_cmake_build_type_before_project_call variable. On a 2nd run there will
# always be a value in the cache, but at that point we've already set it to whatever it needs
# to be.
# 2) Whe configuring qtbase, a top-level qt, or a standalone project we rely on one of the following
# variables being set:
# - __qt_auto_detect_cmake_build_type_before_project_call (e.g for qtbase)
# - __qt_internal_standalone_project_cmake_build_type_before_project_call (e.g for sqldrivers)
# 3) When using a multi-config generator, we assume that the CMAKE_BUILD_TYPE is not default
# initialized.
# 4) The user can also force the build type to be considered non-default-initialized by setting
# QT_NO_FORCE_SET_CMAKE_BUILD_TYPE to TRUE. It has weird naming that doesn't quite correspond
# to the meaning, but it's been called like that for a while now and I'm hesitant to change
# the name in case it's used by various projects.
#
# The code doesn't handle an empty "" config set by the user, but we claim that's an
# unsupported config when building Qt.
function(qt_internal_is_cmake_build_type_default_initialized_heuristic out_var)
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
get_cmake_property(aready_force_set _qt_build_internals_cmake_build_type_set)
if(
# Set by CMake's Platform/Windows-MSVC.cmake when CMAKE_BUILD_TYPE is empty
# The STREQUAL check needs to have expanded variables because an undefined var is not equal
# to an empty defined var.
"${CMAKE_BUILD_TYPE}" STREQUAL "${CMAKE_BUILD_TYPE_INIT}"
# Set by qt_internal_force_set_cmake_build_type()
AND aready_force_set MATCHES "NOTFOUND"
# Set by qt_auto_detect_cmake_build_type()
AND NOT __qt_auto_detect_cmake_build_type_before_project_call
# Set by sqldrivers project
AND NOT __qt_internal_standalone_project_cmake_build_type_before_project_call
# Set by qt.toolchain.cmake
AND NOT __qt_toolchain_cmake_build_type_before_project_call
# Set by user explicitily
AND NOT QT_NO_FORCE_SET_CMAKE_BUILD_TYPE
# Set in multi-config builds
AND NOT is_multi_config)
set(${out_var} TRUE PARENT_SCOPE)
else()
set(${out_var} FALSE PARENT_SCOPE)
endif()
endfunction()
function(qt_internal_force_set_cmake_build_type value)
cmake_parse_arguments(PARSE_ARGV 1 arg
"SHOW_MESSAGE"
""
""
)
_qt_internal_validate_all_args_are_parsed(arg)
set(CMAKE_BUILD_TYPE "${value}" CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE
PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo") # Set the possible values for cmake-gui.
if(arg_SHOW_MESSAGE)
message(STATUS "Force setting build type to '${value}'.")
endif()
set_property(GLOBAL PROPERTY _qt_build_internals_cmake_build_type_set "${value}")
endfunction()
# Only override the build type if it was default initialized by CMake.
function(qt_internal_force_set_cmake_build_type_if_cmake_default_initialized value)
qt_internal_is_cmake_build_type_default_initialized_heuristic(is_default_cmake_build_type)
if(is_default_cmake_build_type)
qt_internal_force_set_cmake_build_type("${value}" SHOW_MESSAGE)
endif()
endfunction()
function(qt_internal_set_cmake_build_type)
# When building standalone tests against a multi-config Qt, we want to configure the
# tests / examples with
# the first multi-config configuration, rather than use CMake's default configuration.
# In the case of Windows, we definitely don't want it to default to Debug, because that causes
# issues in the CI.
if(QT_INTERNAL_BUILD_STANDALONE_PARTS AND QT_MULTI_CONFIG_FIRST_CONFIG)
qt_internal_force_set_cmake_build_type_if_cmake_default_initialized(
"${QT_MULTI_CONFIG_FIRST_CONFIG}")
# We want the same build type to be used when configuring all Qt repos or standalone
# tests or single tests, so we reuse the initial build type set by qtbase.
# __qt_internal_initial_qt_cmake_build_type is saved in QtBuildInternalsExtra.cmake.in.
elseif(__qt_internal_initial_qt_cmake_build_type)
qt_internal_force_set_cmake_build_type_if_cmake_default_initialized(
"${__qt_internal_initial_qt_cmake_build_type}")
# Default to something sensible when configuring qtbase / top-level.
else()
qt_internal_set_qt_appropriate_default_cmake_build_type()
endif()
endfunction()
# Sets a default cmake build type for qtbase / top-level.
macro(qt_internal_set_qt_appropriate_default_cmake_build_type)
set(_default_build_type "Release")
if(FEATURE_developer_build)
set(_default_build_type "Debug")
endif()
# Try to detect if an explicit CMAKE_BUILD_TYPE was set by the user.
# CMake sets CMAKE_BUILD_TYPE_INIT to Debug on most Windows platforms and doesn't set
# anything for UNIXes. CMake assigns CMAKE_BUILD_TYPE_INIT to CMAKE_BUILD_TYPE during
# first project() if CMAKE_BUILD_TYPE has no previous value.
# We use extra information about the state of CMAKE_BUILD_TYPE before the first
# project() call that's set in QtAutodetect.
# STREQUAL check needs to have expanded variables because an undefined var is not equal
# to an empty defined var.
# See also qt_internal_force_set_cmake_build_type_conditionally which is used
# to set the build type when building other repos or tests.
if("${CMAKE_BUILD_TYPE}" STREQUAL "${CMAKE_BUILD_TYPE_INIT}"
AND NOT __qt_auto_detect_cmake_build_type_before_project_call
AND NOT __qt_build_internals_cmake_build_type
AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${_default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${_default_build_type}" CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE
PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo") # Set the possible values for cmake-gui.
qt_internal_is_cmake_build_type_default_initialized_heuristic(is_default_cmake_build_type)
if(is_default_cmake_build_type)
qt_internal_force_set_cmake_build_type("${_default_build_type}")
message(STATUS "Setting build type to '${_default_build_type}' as none was specified.")
elseif(CMAKE_CONFIGURATION_TYPES)
message(STATUS "Building for multiple configurations: ${CMAKE_CONFIGURATION_TYPES}.")
message(STATUS "Main configuration is: ${QT_MULTI_CONFIG_FIRST_CONFIG}.")
@ -40,7 +139,7 @@ macro(qt_internal_set_default_build_type)
)
endif()
else()
message(STATUS "CMAKE_BUILD_TYPE was set to: '${CMAKE_BUILD_TYPE}'")
message(STATUS "CMAKE_BUILD_TYPE was already explicitly set to: '${CMAKE_BUILD_TYPE}'")
endif()
endmacro()
@ -207,8 +306,32 @@ macro(qt_internal_setup_build_examples)
option(QT_INSTALL_EXAMPLES_SOURCES_BY_DEFAULT
"Install example sources as part of the default 'install' target" ON)
# We need a way to force disable building in-tree examples in the CI, so that we instead build
# standalone examples. Because the Coin yaml instructions don't allow us to remove
# -make examples from from the configure args, we instead read a variable that only Coin sets.
if(QT_INTERNAL_CI_NO_BUILD_IN_TREE_EXAMPLES)
set(QT_BUILD_EXAMPLES OFF CACHE BOOL "Build Qt examples" FORCE)
endif()
if(QT_BUILD_STANDALONE_EXAMPLES)
# BuildInternals might have set it to OFF on initial configuration. So force it to ON when
# building standalone examples.
set(QT_BUILD_EXAMPLES ON CACHE BOOL "Build Qt examples" FORCE)
# Also force the examples to be built as part of the default build target.
set(QT_BUILD_EXAMPLES_BY_DEFAULT ON CACHE BOOL
"Should examples be built as part of the default 'all' target." FORCE)
endif()
option(QT_DEPLOY_MINIMAL_EXAMPLES
"Deploy minimal subset of examples to save time and space" OFF)
# FIXME: Support prefix builds as well QTBUG-96232
if(QT_WILL_INSTALL)
# We don't want to enable EP examples with -debug-and-release because starting with CMake 3.24
# ExternalProject_Add ends up creating build rules twice, once for each configuration, in the
# same build dir, which ends up causing various issues due to concurrent builds as well as
# clobbered CMakeCache.txt and ninja files.
if(QT_WILL_INSTALL OR QT_FEATURE_debug_and_release)
set(_qt_build_examples_as_external OFF)
else()
set(_qt_build_examples_as_external ON)

View File

@ -7,7 +7,7 @@ macro(qt_internal_setup_default_install_prefix)
# is specified.
# This detection only happens when building qtbase, and later is propagated via the generated
# QtBuildInternalsExtra.cmake file.
if (PROJECT_NAME STREQUAL "QtBase" AND NOT QT_BUILD_STANDALONE_TESTS)
if(PROJECT_NAME STREQUAL "QtBase" AND NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# Handle both FEATURE_ and QT_FEATURE_ cases when they are specified on the command line
# explicitly. It's possible for one to be set, but not the other, because
@ -56,7 +56,8 @@ function(qt_internal_setup_build_and_install_paths)
# Compute the values of QT_BUILD_DIR, QT_INSTALL_DIR, QT_CONFIG_BUILD_DIR, QT_CONFIG_INSTALL_DIR
# taking into account whether the current build is a prefix build or a non-prefix build,
# and whether it is a superbuild or non-superbuild.
# A third case is when another module or standalone tests are built against a super-built Qt.
# A third case is when another module or standalone tests/examples are built against a
# super-built Qt.
# The layout for the third case is the same as for non-superbuilds.
#
# These values should be prepended to file paths in commands or properties,
@ -205,6 +206,18 @@ macro(qt_internal_set_qt_cmake_dir)
set(QT_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}")
endmacro()
macro(qt_internal_set_qt_apple_support_files_path)
# This is analogous to what we have in QtConfig.cmake.in. It's copied here so that iOS
# tests can be built in tree.
if(APPLE)
if(NOT CMAKE_SYSTEM_NAME OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(__qt_internal_cmake_apple_support_files_path "${QT_CMAKE_DIR}/macos")
elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(__qt_internal_cmake_apple_support_files_path "${QT_CMAKE_DIR}/ios")
endif()
endif()
endmacro()
macro(qt_internal_set_qt_staging_prefix)
if(NOT "${CMAKE_STAGING_PREFIX}" STREQUAL "")
set(QT_STAGING_PREFIX "${CMAKE_STAGING_PREFIX}")
@ -227,4 +240,6 @@ macro(qt_internal_setup_paths_and_prefixes)
qt_internal_set_cmake_install_libdir()
qt_internal_set_qt_cmake_dir()
qt_internal_set_qt_apple_support_files_path()
endmacro()

View File

@ -8,11 +8,26 @@ macro(qt_examples_build_begin)
cmake_parse_arguments(arg "${options}" "${singleOpts}" "${multiOpts}" ${ARGN})
# Examples are not unity-ready.
set(CMAKE_UNITY_BUILD OFF)
# Skip running deployment steps when the developer asked to deploy a minimal subset of examples.
# Each example can then decide whether it wants to be deployed as part of the minimal subset
# by unsetting the QT_INTERNAL_SKIP_DEPLOYMENT variable before its qt_internal_add_example call.
# This will be used by our CI.
if(NOT DEFINED QT_INTERNAL_SKIP_DEPLOYMENT AND QT_DEPLOY_MINIMAL_EXAMPLES)
set(QT_INTERNAL_SKIP_DEPLOYMENT TRUE)
endif()
# Use by qt_internal_add_example.
set(QT_EXAMPLE_BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
if(QT_BUILD_STANDALONE_EXAMPLES)
# Find all qt packages, so that the various if(QT_FEATURE_foo) add_subdirectory()
# conditions have correct values, regardless whether we will use ExternalProjects or not.
qt_internal_find_standalone_parts_config_files()
endif()
if(arg_EXTERNAL_BUILD AND QT_BUILD_EXAMPLES_AS_EXTERNAL)
# Examples will be built using ExternalProject.
# We depend on all plugins built as part of the current repo as well as current repo's
@ -164,6 +179,11 @@ function(qt_internal_get_example_install_prefix out_var)
# Allow customizing the installation path of the examples. Will be used in CI.
if(QT_INTERNAL_EXAMPLES_INSTALL_PREFIX)
set(qt_example_install_prefix "${QT_INTERNAL_EXAMPLES_INSTALL_PREFIX}")
elseif(QT_BUILD_STANDALONE_EXAMPLES)
# TODO: We might need to reset and pipe through an empty CMAKE_STAGING_PREFIX if we ever
# try to run standalone examples in the CI when cross-compiling, similar how it's done in
# qt_internal_set_up_fake_standalone_parts_install_prefix.
qt_internal_get_fake_standalone_install_prefix(qt_example_install_prefix)
else()
set(qt_example_install_prefix "${CMAKE_INSTALL_PREFIX}/${INSTALL_EXAMPLESDIR}")
endif()
@ -252,7 +272,9 @@ function(qt_internal_add_example_in_tree subdir)
install(CODE "
# Unset the CMAKE_INSTALL_PREFIX in the current cmake_install.cmake file so that it can be
# overridden in the included add_subdirectory-specific cmake_install.cmake files instead.
# Also unset the deployment prefix, so it can be recomputed for each example subdirectory.
unset(CMAKE_INSTALL_PREFIX)
unset(QT_DEPLOY_PREFIX)
")
# Override the install prefix in the subdir cmake_install.cmake, so that
@ -304,6 +326,28 @@ function(qt_internal_add_example_external_project subdir)
endif()
endif()
# We we need to augment the CMAKE_MODULE_PATH with the current repo cmake build dir, to find
# files like FindWrapBundledFooConfigExtra.cmake.
set(module_paths "${qt_prefixes}")
list(TRANSFORM module_paths APPEND "/${INSTALL_LIBDIR}/cmake/${QT_CMAKE_EXPORT_NAMESPACE}")
list(APPEND CMAKE_MODULE_PATH ${module_paths})
# Pass additional paths where qml plugin config files should be included by Qt6QmlPlugins.cmake.
# This is needed in prefix builds, where the cmake files are not installed yet.
set(glob_prefixes "${qt_prefixes}")
list(TRANSFORM glob_prefixes APPEND "/${INSTALL_LIBDIR}/cmake/${QT_CMAKE_EXPORT_NAMESPACE}Qml")
set(qml_plugin_cmake_config_file_glob_prefixes "")
foreach(glob_prefix IN LISTS glob_prefix)
if(EXISTS "${glob_prefix}")
list(APPEND qml_plugin_cmake_config_file_glob_prefixes "${glob_prefix}")
endif()
endforeach()
if(qml_plugin_cmake_config_file_glob_prefixes)
set(QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES ${qml_plugin_cmake_config_file_glob_prefixes})
endif()
# In multi-config mode by default we exclude building tools for configs other than the main one.
# Trying to build an example in a non-default config using the non-installed
# QtFooConfig.cmake files would error out saying moc is not found.
@ -370,7 +414,10 @@ function(qt_internal_add_example_external_project subdir)
CMAKE_PREFIX_PATH:STRING
QT_BUILD_CMAKE_PREFIX_PATH:STRING
QT_ADDITIONAL_PACKAGES_PREFIX_PATH:STRING
QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES:STRING
QT_INTERNAL_SKIP_DEPLOYMENT:BOOL
CMAKE_FIND_ROOT_PATH:STRING
CMAKE_MODULE_PATH:STRING
BUILD_SHARED_LIBS:BOOL
CMAKE_OSX_ARCHITECTURES:STRING
CMAKE_OSX_DEPLOYMENT_TARGET:STRING
@ -382,7 +429,15 @@ function(qt_internal_add_example_external_project subdir)
CMAKE_OBJCXX_COMPILER_LAUNCHER:STRING
)
foreach(var_with_type IN LISTS vars_to_pass_if_defined)
# QT_EXAMPLE_CMAKE_VARS_TO_PASS can be set by specific repos to pass any additional required
# CMake cache variables.
# One use case is passing locations of 3rd party package locations like Protobuf via _ROOT
# variables.
set(extra_vars_var_name "")
if(QT_EXAMPLE_CMAKE_VARS_TO_PASS)
set(extra_vars_var_name "QT_EXAMPLE_CMAKE_VARS_TO_PASS")
endif()
foreach(var_with_type IN LISTS vars_to_pass_if_defined ${extra_vars_var_name})
string(REPLACE ":" ";" key_as_list "${var_with_type}")
list(GET key_as_list 0 var)
if(NOT DEFINED ${var})

View File

@ -32,7 +32,7 @@ macro(qt_build_internals_set_up_private_api)
endmacro()
# add toplevel targets for each subdirectory, e.g. qtbase_src
function(qt_build_internals_add_toplevel_targets)
function(qt_build_internals_add_toplevel_targets qt_repo_targets_name)
set(qt_repo_target_all "")
get_directory_property(directories DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" SUBDIRECTORIES)
foreach(directory IN LISTS directories)
@ -97,7 +97,7 @@ macro(qt_enable_cmake_languages)
# The qtbase call is handled in qtbase/CMakeLists.txt.
# This call is used for projects other than qtbase, including for other project's standalone
# tests.
# tests/examples.
# Because the function uses QT_FEATURE_foo values, it's important that find_package(Qt6Core) is
# called before this function. but that's usually the case for Qt repos.
if(NOT PROJECT_NAME STREQUAL "QtBase")
@ -157,7 +157,22 @@ macro(qt_internal_prepare_single_repo_target_set_build)
endif()
endmacro()
# There are three necessary copies of this macro in
# qtbase/cmake/QtBaseHelpers.cmake
# qtbase/cmake/QtBaseTopLevelHelpers.cmake
# qtbase/cmake/QtBuildRepoHelpers.cmake
macro(qt_internal_setup_standalone_parts)
# A generic marker for any kind of standalone builds, either tests or examples.
if(NOT DEFINED QT_INTERNAL_BUILD_STANDALONE_PARTS
AND (QT_BUILD_STANDALONE_TESTS OR QT_BUILD_STANDALONE_EXAMPLES))
set(QT_INTERNAL_BUILD_STANDALONE_PARTS TRUE CACHE INTERNAL
"Whether standalone tests or examples are being built")
endif()
endmacro()
macro(qt_build_repo_begin)
qt_internal_setup_standalone_parts()
set(QT_INTERNAL_REPO_POST_PROCESS_CALLED FALSE)
list(APPEND CMAKE_MESSAGE_CONTEXT "${PROJECT_NAME}")
@ -299,14 +314,14 @@ endmacro()
macro(qt_build_repo_post_process)
if(NOT QT_INTERNAL_REPO_POST_PROCESS_CALLED)
set(QT_INTERNAL_REPO_POST_PROCESS_CALLED TRUE)
if(NOT QT_BUILD_STANDALONE_TESTS)
if(NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
include(QtPostProcess)
endif()
endif()
endmacro()
macro(qt_build_repo_end)
if(NOT QT_BUILD_STANDALONE_TESTS)
if(NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
qt_build_repo_post_process()
# Install the repo-specific cmake find modules.
@ -333,7 +348,9 @@ macro(qt_build_repo_end)
endif()
endif()
qt_build_internals_add_toplevel_targets()
qt_build_internals_add_toplevel_targets(${qt_repo_targets_name})
qt_internal_show_extra_ide_sources()
if(NOT QT_SUPERBUILD)
qt_print_build_instructions()
@ -360,6 +377,109 @@ macro(qt_build_repo_end)
list(POP_BACK CMAKE_MESSAGE_CONTEXT)
endmacro()
function(qt_internal_show_extra_ide_sources)
if(CMAKE_VERSION VERSION_LESS 3.20)
set(ide_sources_default OFF)
else()
set(ide_sources_default ON)
endif()
option(QT_SHOW_EXTRA_IDE_SOURCES "Generate CMake targets exposing non-source files to IDEs" ${ide_sources_default})
if(CMAKE_VERSION VERSION_LESS 3.20 AND QT_SHOW_EXTRA_IDE_SOURCES)
message(WARNING "QT_SHOW_EXTRA_IDE_SOURCES requires cmake-3.20")
return()
endif()
if(NOT QT_SHOW_EXTRA_IDE_SOURCES)
return()
endif()
# coin
set(coin_target_name ${qt_repo_targets_name}_coin_files)
file(GLOB_RECURSE coin_files LIST_DIRECTORIES false FOLLOW_SYMLINKS coin/*)
if(coin_files)
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/coin" FILES ${coin_files})
add_custom_target(${coin_target_name} SOURCES ${coin_files})
endif()
# config.test
set(config_tests_target_name ${qt_repo_targets_name}_config_tests)
file(GLOB_RECURSE config_tests_file LIST_DIRECTORIES false FOLLOW_SYMLINKS config.tests/*)
if(config_tests_file)
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/config.tests" FILES ${config_tests_file})
add_custom_target(${config_tests_target_name} SOURCES ${config_tests_file})
endif()
# cmake
set(cmake_target_name ${qt_repo_targets_name}_cmake_files)
file(GLOB_RECURSE cmake_files LIST_DIRECTORIES false FOLLOW_SYMLINKS
cmake/*
configure.cmake
qt_cmdline.cmake
.cmake.conf
*.cmake
*.cmake.in)
foreach(cmake_file IN LISTS cmake_files)
if(NOT ((cmake_file IN_LIST coin_files) OR (file IN_LIST config_tests_files)))
list(APPEND cmake_target_files ${cmake_file})
endif()
endforeach()
if(cmake_target_files)
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${cmake_target_files})
add_custom_target(${cmake_target_name} SOURCES ${cmake_target_files})
endif()
# licenses
set(licenses_target_name ${qt_repo_targets_name}_licenses)
file(GLOB licenses_files LIST_DIRECTORIES false LICENSES/*)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/licenseRule.json")
list(APPEND licenses_files "${CMAKE_CURRENT_SOURCE_DIR}/licenseRule.json")
endif()
if(licenses_files)
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${licenses_files})
add_custom_target(${licenses_target_name} SOURCES ${licenses_files})
endif()
# changelogs
set(changelogs_target_name ${qt_repo_targets_name}_changelogs)
file(GLOB change_logs_files LIST_DIRECTORIES false dist/*)
if(change_logs_files)
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/dist" FILES ${change_logs_files})
add_custom_target(${changelogs_target_name} SOURCES ${change_logs_files})
endif()
# extra files
set(target_name ${qt_repo_targets_name}_extra_files)
add_custom_target(${target_name})
set(recursive_glob_patterns
${QT_BUILD_EXTRA_IDE_FILE_RECURSIVE_PATTERNS}
)
set(simple_glob_patterns
.gitattributes
.gitignore
.tag
config_help.txt
${QT_BUILD_EXTRA_IDE_FILE_PATTERNS}
)
if(recursive_glob_patterns)
file(GLOB_RECURSE files LIST_DIRECTORIES false FOLLOW_SYMLINKS ${recursive_glob_patterns})
if(files)
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${files})
target_sources(${target_name} PRIVATE ${files})
endif()
endif()
file(GLOB files LIST_DIRECTORIES false ${simple_glob_patterns})
if(files)
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${files})
target_sources(${target_name} PRIVATE ${files})
endif()
endfunction()
# Function called either at the end of per-repo configuration, or at the end of configuration of
# a super build.
# At the moment it is called before examples are configured in a per-repo build. We might want
@ -368,7 +488,9 @@ function(qt_internal_qt_configure_end)
# If Qt is configued via the configure script, remove the marker variable, so that any future
# reconfigurations that are done by calling cmake directly don't trigger configure specific
# logic.
unset(QT_INTERNAL_CALLED_FROM_CONFIGURE CACHE)
if(QT_INTERNAL_CALLED_FROM_CONFIGURE)
unset(QT_INTERNAL_CALLED_FROM_CONFIGURE CACHE)
endif()
endfunction()
macro(qt_build_repo)
@ -390,7 +512,7 @@ macro(qt_build_repo_impl_find_package_tests)
# If testing is enabled, try to find the qtbase Test package.
# Do this before adding src, because there might be test related conditions
# in source.
if (QT_BUILD_TESTS AND NOT QT_BUILD_STANDALONE_TESTS)
if(QT_BUILD_TESTS AND NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
# When looking for the Test package, do it using the Qt6 package version, in case if
# PROJECT_VERSION is following a different versioning scheme.
if(Qt6_VERSION)
@ -407,7 +529,7 @@ macro(qt_build_repo_impl_find_package_tests)
endmacro()
macro(qt_build_repo_impl_src)
if(NOT QT_BUILD_STANDALONE_TESTS)
if(NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists.txt")
add_subdirectory(src)
endif()
@ -419,7 +541,7 @@ macro(qt_build_repo_impl_src)
endmacro()
macro(qt_build_repo_impl_tools)
if(NOT QT_BUILD_STANDALONE_TESTS)
if(NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tools/CMakeLists.txt")
add_subdirectory(tools)
endif()
@ -427,20 +549,37 @@ macro(qt_build_repo_impl_tools)
endmacro()
macro(qt_build_repo_impl_tests)
if (QT_BUILD_TESTS AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt")
add_subdirectory(tests)
if(NOT QT_BUILD_TESTS_BY_DEFAULT)
set_property(DIRECTORY tests PROPERTY EXCLUDE_FROM_ALL TRUE)
if((QT_BUILD_TESTS OR QT_BUILD_STANDALONE_TESTS)
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt")
if(QT_BUILD_STANDALONE_EXAMPLES)
message(FATAL_ERROR
"Can't build both standalone tests and standalone examples at once.")
endif()
option(QT_BUILD_TESTS_PROJECT_${PROJECT_NAME} "Configure tests for project ${PROJECT_NAME}" TRUE)
if (QT_BUILD_TESTS_PROJECT_${PROJECT_NAME})
add_subdirectory(tests)
if(NOT QT_BUILD_TESTS_BY_DEFAULT)
set_property(DIRECTORY tests PROPERTY EXCLUDE_FROM_ALL TRUE)
endif()
endif()
endif()
endmacro()
macro(qt_build_repo_impl_examples)
if(QT_BUILD_EXAMPLES
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/examples/CMakeLists.txt"
AND NOT QT_BUILD_STANDALONE_TESTS)
if((QT_BUILD_EXAMPLES OR QT_BUILD_STANDALONE_EXAMPLES)
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/examples/CMakeLists.txt")
if(QT_BUILD_STANDALONE_TESTS)
message(FATAL_ERROR
"Can't build both standalone tests and standalone examples at once.")
endif()
message(STATUS "Configuring examples.")
add_subdirectory(examples)
option(QT_BUILD_EXAMPLES_PROJECT_${PROJECT_NAME} "Configure examples for project ${PROJECT_NAME}" TRUE)
if (QT_BUILD_EXAMPLES_PROJECT_${PROJECT_NAME})
add_subdirectory(examples)
endif()
endif()
endmacro()
@ -449,22 +588,27 @@ macro(qt_set_up_standalone_tests_build)
# Standalone tests are not handled via the main repo project and qt_build_tests.
endmacro()
function(qt_get_standalone_tests_config_files_path out_var)
set(path "${QT_CONFIG_INSTALL_DIR}/${INSTALL_CMAKE_NAMESPACE}BuildInternals/StandaloneTests")
function(qt_get_standalone_parts_config_files_path out_var)
# TODO: Rename this to StandaloneParts in some future Qt version, if it confuses people too
# much. Currently not renamed, not to break distro installation scripts that might exclude
# the files.
set(dir_name "StandaloneTests")
# QT_CONFIG_INSTALL_DIR is relative in prefix builds.
if(QT_WILL_INSTALL)
if(DEFINED CMAKE_STAGING_PREFIX)
qt_path_join(path "${CMAKE_STAGING_PREFIX}" "${path}")
else()
qt_path_join(path "${CMAKE_INSTALL_PREFIX}" "${path}")
endif()
set(path_suffix "${INSTALL_LIBDIR}/cmake/${INSTALL_CMAKE_NAMESPACE}BuildInternals/${dir_name}")
# Each repo's standalone parts might be configured with a unique CMAKE_STAGING_PREFIX,
# different from any previous one, and it might not coincide with where the BuildInternals
# config file is.
if(QT_WILL_INSTALL AND CMAKE_STAGING_PREFIX)
qt_path_join(path "${CMAKE_STAGING_PREFIX}" "${path_suffix}")
else()
qt_path_join(path "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}" "${path_suffix}")
endif()
set("${out_var}" "${path}" PARENT_SCOPE)
endfunction()
function(qt_internal_get_standalone_tests_config_file_name out_var)
function(qt_internal_get_standalone_parts_config_file_name out_var)
# When doing a "single repo target set" build (like in qtscxqml) ensure we use a unique tests
# config file for each repo target set. Using the PROJECT_NAME only is not enough because
# the same file will be overridden with different content on each repo set install.
@ -473,46 +617,17 @@ function(qt_internal_get_standalone_tests_config_file_name out_var)
if(QT_BUILD_SINGLE_REPO_TARGET_SET)
string(APPEND tests_config_file_name "RepoSet${QT_BUILD_SINGLE_REPO_TARGET_SET}")
endif()
# TODO: Rename this to StandalonePartsConfig.cmake in some future Qt version, if it confuses
# people too much. Currently not renamed, not to break distro installation scripts that might
# exclude # the files.
string(APPEND tests_config_file_name "TestsConfig.cmake")
set(${out_var} "${tests_config_file_name}" PARENT_SCOPE)
endfunction()
macro(qt_build_tests)
set(CMAKE_UNITY_BUILD OFF)
# Prepending to QT_BUILD_CMAKE_PREFIX_PATH helps find components of Qt6, because those
# find_package calls use NO_DEFAULT_PATH, and thus CMAKE_PREFIX_PATH is ignored.
list(PREPEND CMAKE_FIND_ROOT_PATH "${QT_BUILD_DIR}")
list(PREPEND QT_BUILD_CMAKE_PREFIX_PATH "${QT_BUILD_DIR}/${INSTALL_LIBDIR}/cmake")
if(QT_BUILD_STANDALONE_TESTS)
# Find location of TestsConfig.cmake. These contain the modules that need to be
# find_package'd when testing.
qt_get_standalone_tests_config_files_path(_qt_build_tests_install_prefix)
qt_internal_get_standalone_tests_config_file_name(_qt_tests_config_file_name)
set(_qt_standalone_tests_config_file_path
"${_qt_build_tests_install_prefix}/${_qt_tests_config_file_name}")
include("${_qt_standalone_tests_config_file_path}"
OPTIONAL
RESULT_VARIABLE _qt_standalone_tests_included)
if(NOT _qt_standalone_tests_included)
message(DEBUG
"Standalone tests config file not included because it does not exist: "
"${_qt_standalone_tests_config_file_path}"
)
else()
message(DEBUG
"Standalone tests config file included successfully: "
"${_qt_standalone_tests_config_file_path}"
)
endif()
unset(_qt_standalone_tests_config_file_path)
unset(_qt_standalone_tests_included)
unset(_qt_tests_config_file_name)
macro(qt_internal_find_standalone_test_config_file)
if(QT_INTERNAL_BUILD_STANDALONE_PARTS)
# Of course we always need the test module as well.
# When looking for the Test package, do it using the Qt6 package version, in case if
# PROJECT_VERSION is following a different versioning scheme.
@ -523,17 +638,62 @@ macro(qt_build_tests)
endif()
find_package(Qt6 "${_qt_build_tests_package_version}" CONFIG REQUIRED COMPONENTS Test)
unset(_qt_build_tests_package_version)
endif()
endmacro()
# Used by standalone tests and standalone non-ExternalProject examples to find all installed qt
# packages.
macro(qt_internal_find_standalone_parts_config_files)
if(QT_INTERNAL_BUILD_STANDALONE_PARTS)
# Find location of TestsConfig.cmake. These contain the modules that need to be
# find_package'd when building tests or examples.
qt_get_standalone_parts_config_files_path(_qt_build_parts_install_prefix)
qt_internal_get_standalone_parts_config_file_name(_qt_parts_config_file_name)
set(_qt_standalone_parts_config_file_path
"${_qt_build_parts_install_prefix}/${_qt_parts_config_file_name}")
include("${_qt_standalone_parts_config_file_path}"
OPTIONAL
RESULT_VARIABLE _qt_standalone_parts_included)
if(NOT _qt_standalone_parts_included)
message(DEBUG
"Standalone parts config file not included because it does not exist: "
"${_qt_standalone_parts_config_file_path}"
)
else()
message(DEBUG
"Standalone parts config file included successfully: "
"${_qt_standalone_parts_config_file_path}"
)
endif()
unset(_qt_standalone_parts_config_file_path)
unset(_qt_standalone_parts_included)
unset(_qt_parts_config_file_name)
endif()
endmacro()
macro(qt_build_tests)
# Tests are not unity-ready.
set(CMAKE_UNITY_BUILD OFF)
# Prepending to QT_BUILD_CMAKE_PREFIX_PATH helps find components of Qt6, because those
# find_package calls use NO_DEFAULT_PATH, and thus CMAKE_PREFIX_PATH is ignored.
list(PREPEND CMAKE_FIND_ROOT_PATH "${QT_BUILD_DIR}")
list(PREPEND QT_BUILD_CMAKE_PREFIX_PATH "${QT_BUILD_DIR}/${INSTALL_LIBDIR}/cmake")
qt_internal_find_standalone_parts_config_files()
qt_internal_find_standalone_test_config_file()
if(QT_BUILD_STANDALONE_TESTS)
# Set language standards after finding Core, because that's when the relevant
# feature variables are available, and the call in QtSetup is too early when building
# standalone tests, because Core was not find_package()'d yet.
qt_set_language_standards()
if(NOT QT_SUPERBUILD)
# Set up fake standalone tests install prefix, so we don't pollute the Qt install
# prefix. For super builds it needs to be done in qt5/CMakeLists.txt.
qt_set_up_fake_standalone_tests_install_prefix()
endif()
# Set up fake standalone parts install prefix, so we don't pollute the Qt install
# prefix with tests.
qt_internal_set_up_fake_standalone_parts_install_prefix()
else()
if(ANDROID)
# When building in-tree tests we need to specify the QT_ANDROID_ABIS list. Since we
@ -611,17 +771,22 @@ function(qt_get_relocatable_install_prefix out_var)
set(${out_var} "${CMAKE_INSTALL_PREFIX}" PARENT_SCOPE)
endfunction()
function(qt_set_up_fake_standalone_tests_install_prefix)
function(qt_internal_get_fake_standalone_install_prefix out_var)
set(new_install_prefix "${CMAKE_BINARY_DIR}/fake_prefix")
set(${out_var} "${new_install_prefix}" PARENT_SCOPE)
endfunction()
function(qt_internal_set_up_fake_standalone_parts_install_prefix)
# Set a fake local (non-cache) CMAKE_INSTALL_PREFIX.
# Needed for standalone tests, we don't want to accidentally install a test into the Qt prefix.
# Allow opt-out, if a user knows what they're doing.
if(QT_NO_FAKE_STANDALONE_TESTS_INSTALL_PREFIX)
return()
endif()
set(new_install_prefix "${CMAKE_BINARY_DIR}/fake_prefix")
qt_internal_get_fake_standalone_install_prefix(new_install_prefix)
# It's IMPORTANT that this is not a cache variable. Otherwise
# qt_get_standalone_tests_confg_files_path() will not work on re-configuration.
# qt_get_standalone_parts_config_files_path() will not work on re-configuration.
message(STATUS
"Setting local standalone test install prefix (non-cached) to '${new_install_prefix}'.")
set(CMAKE_INSTALL_PREFIX "${new_install_prefix}" PARENT_SCOPE)
@ -639,12 +804,16 @@ function(qt_set_up_fake_standalone_tests_install_prefix)
endif()
endfunction()
# Mean to be called when configuring examples as part of the main build tree, as well as for CMake
# tests (tests that call CMake to try and build CMake applications).
# Meant to be called when configuring examples as part of the main build tree (unless standalone
# examples are being built), as well as for CMake tests (tests that call CMake to try and build
# CMake applications).
macro(qt_internal_set_up_build_dir_package_paths)
list(PREPEND CMAKE_PREFIX_PATH "${QT_BUILD_DIR}/${INSTALL_LIBDIR}/cmake")
# Make sure the CMake config files do not recreate the already-existing targets
set(QT_NO_CREATE_TARGETS TRUE)
# Make sure the CMake config files do not recreate the already-existing targets.
if(NOT QT_BUILD_STANDALONE_EXAMPLES)
set(QT_NO_CREATE_TARGETS TRUE)
endif()
endmacro()
function(qt_internal_static_link_order_test)

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# Include the basic version config file to get results of regular version checking.
include("${CMAKE_CURRENT_LIST_DIR}/@package_name@ConfigVersionImpl.cmake")

View File

@ -25,8 +25,15 @@ set(_qt_compiler_warning_flags_condition
set(_qt_compiler_warning_flags_genex
"$<IF:${_qt_compiler_warning_flags_condition},${_qt_compiler_warning_flags_off},${_qt_compiler_warning_flags_on}>")
set(_qt_compiler_warning_flags_language_condition
"$<COMPILE_LANGUAGE:CXX,C,OBJC,OBJCXX>")
set(_qt_compiler_warning_flags_language_conditional_genex
"$<${_qt_compiler_warning_flags_language_condition}:${_qt_compiler_warning_flags_genex}>")
# Need to replace semicolons so that the list is not wrongly expanded in the add_compile_options
# call.
string(REPLACE ";" "$<SEMICOLON>"
_qt_compiler_warning_flags_genex "${_qt_compiler_warning_flags_genex}")
add_compile_options(${_qt_compiler_warning_flags_genex})
_qt_compiler_warning_flags_language_conditional_genex
"${_qt_compiler_warning_flags_language_conditional_genex}")
add_compile_options(${_qt_compiler_warning_flags_language_conditional_genex})

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
@PACKAGE_INIT@
cmake_minimum_required(VERSION @min_new_policy_version@...@max_new_policy_version@)
@ -62,6 +65,8 @@ if(NOT DEFINED QT_CMAKE_EXPORT_NAMESPACE)
set(QT_CMAKE_EXPORT_NAMESPACE @QT_CMAKE_EXPORT_NAMESPACE@)
endif()
__qt_internal_collect_additional_module_paths()
# Propagate sanitizer flags to both internal Qt builds and user projects.
# Allow opt-out in case if downstream projects handle it in a different way.
set(QT_CONFIGURED_SANITIZER_OPTIONS "@ECM_ENABLE_SANITIZERS@")

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
set(@INSTALL_CMAKE_NAMESPACE@_FOUND FALSE)
set(__qt_platform_requires_host_info_package "@platform_requires_host_info_package@")

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
set(QT_SUPPORTED_MIN_CMAKE_VERSION_FOR_USING_QT "@supported_min_version_for_using_qt@")
set(QT_COMPUTED_MIN_CMAKE_VERSION_FOR_USING_QT "@computed_min_version_for_using_qt@")

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(@configure_time_target@ LANGUAGES CXX)

View File

@ -21,12 +21,37 @@ function(qt_internal_add_docs)
# Function called from old generated CMakeLists.txt that was missing the target parameter
return()
endif()
if(NOT ${ARGC} EQUAL 2)
message(FATAL_ERROR "qt_add_docs called with the wrong number of arguments. Should be qt_add_docs(target path_to_project.qdocconf).")
set(error_msg "qt_add_docs called with wrong number of arguments. ")
list(APPEND error_msg
"Should be qt_add_docs\(target_name qdocconf "
"\[INDEX_DIRECTORIES EXTRA_INDEX_DIRS_LIST_TO_ENABLE_QDOC_RESOLVE_LINKS\]\)")
if(NOT ${ARGC} GREATER_EQUAL 2)
message(FATAL_ERROR ${error_msg})
return()
endif()
set(target ${ARGV0})
set(doc_project ${ARGV1})
set(qdoc_extra_args "")
# Check if there are more than 2 arguments and pass them
# as extra --indexdir arguments to qdoc in prepare and
# generate phases.
if (${ARGC} GREATER 2)
# The INDEX_DIRECTORIES key should enable passing a list of index
# directories as extra command-line arguments to qdoc.
set(qdocExtraArgs INDEX_DIRECTORIES)
cmake_parse_arguments(PARSE_ARGV 2 arg "" "" "${qdocExtraArgs}")
if(arg_UNPARSED_ARGUMENTS)
message(FATAL_ERROR ${error_msg})
return()
endif()
if(arg_INDEX_DIRECTORIES)
foreach(index_directory ${arg_INDEX_DIRECTORIES})
list(APPEND qdoc_extra_args "--indexdir" ${index_directory})
endforeach()
endif()
endif()
# If a target is not built (which can happen for tools when crosscompiling), we shouldn't try
# to generate docs.
@ -114,10 +139,13 @@ function(qt_internal_add_docs)
if(NOT QT_BUILD_ONLINE_DOCS)
list(PREPEND prepare_qdoc_args
-installdir "${QT_INSTALL_DIR}/${INSTALL_DOCDIR}"
${qdoc_extra_args}
)
endif()
if(QT_SUPERBUILD)
if(DEFINED ENV{QT_INSTALL_DOCS})
set(qt_install_docs_env "$ENV{QT_INSTALL_DOCS}")
elseif(QT_SUPERBUILD OR "${PROJECT_NAME}" STREQUAL "QtBase")
set(qt_install_docs_env "${QtBase_BINARY_DIR}/${INSTALL_DOCDIR}")
else()
set(qt_install_docs_env "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_DOCDIR}")
@ -154,6 +182,7 @@ function(qt_internal_add_docs)
if(NOT QT_BUILD_ONLINE_DOCS)
list(PREPEND generate_qdoc_args
-installdir "${QT_INSTALL_DIR}/${INSTALL_DOCDIR}"
${qdoc_extra_args}
)
endif()

View File

@ -182,7 +182,7 @@ function(qt_internal_add_executable name)
qt_get_install_target_default_args(
OUT_VAR install_targets_default_args
CMAKE_CONFIG "${cmake_config}"
ALL_CMAKE_CONFIGS "${cmake_configs}"
ALL_CMAKE_CONFIGS ${cmake_configs}
RUNTIME "${arg_INSTALL_DIRECTORY}"
LIBRARY "${arg_INSTALL_DIRECTORY}"
BUNDLE "${arg_INSTALL_DIRECTORY}")
@ -217,7 +217,8 @@ function(qt_internal_add_executable name)
# This makes the experience of an initial Qt configuration to build and run one single
# test / executable nicer.
get_target_property(linked_libs "${name}" LINK_LIBRARIES)
if("Qt::Gui" IN_LIST linked_libs AND TARGET qpa_default_plugins)
if(linked_libs MATCHES "(^|;)(${QT_CMAKE_EXPORT_NAMESPACE}::|Qt::)?Gui($|;)" AND
TARGET qpa_default_plugins)
add_dependencies("${name}" qpa_default_plugins)
endif()
@ -390,9 +391,15 @@ function(qt_internal_add_configure_time_executable target)
if(arg_INSTALL_DIRECTORY)
set(install_dir "${arg_INSTALL_DIRECTORY}")
endif()
set(output_directory_relative "${install_dir}")
set(output_directory "${QT_BUILD_DIR}/${install_dir}")
set(target_binary_path_relative
"${output_directory_relative}/${configuration_path}${target_binary}")
set(target_binary_path
"${output_directory}/${configuration_path}${target_binary}")
get_filename_component(target_binary_path "${target_binary_path}" ABSOLUTE)
if(NOT DEFINED arg_SOURCES)
@ -521,7 +528,9 @@ function(qt_internal_add_configure_time_executable target)
add_executable(${QT_CMAKE_EXPORT_NAMESPACE}::${target} ALIAS ${target})
set_target_properties(${target} PROPERTIES
_qt_internal_configure_time_target TRUE
IMPORTED_LOCATION "${target_binary_path}")
_qt_internal_configure_time_target_build_location "${target_binary_path_relative}"
IMPORTED_LOCATION "${target_binary_path}"
)
if(NOT arg_NO_INSTALL)
set_target_properties(${target} PROPERTIES

View File

@ -927,6 +927,11 @@ macro(qt_internal_compute_features_from_possible_inputs)
qt_internal_compute_feature_value_from_possible_input(no_prefix)
endmacro()
# Builds either a string of source code or a whole project to determine whether the build is
# successful.
#
# Sets a TEST_${name}_OUTPUT variable with the build output, to the scope of the calling function.
# Sets a TEST_${name} cache variable to either TRUE or FALSE if the build is successful or not.
function(qt_config_compile_test name)
if(DEFINED "TEST_${name}")
return()
@ -1049,8 +1054,11 @@ function(qt_config_compile_test name)
get_filename_component(arg_PROJECT_PATH "${arg_PROJECT_PATH}" REALPATH)
endif()
try_compile(HAVE_${name} "${CMAKE_BINARY_DIR}/config.tests/${name}" "${arg_PROJECT_PATH}"
"${name}" CMAKE_FLAGS ${flags} ${arg_CMAKE_FLAGS})
try_compile(
HAVE_${name} "${CMAKE_BINARY_DIR}/config.tests/${name}" "${arg_PROJECT_PATH}" "${name}"
CMAKE_FLAGS ${flags} ${arg_CMAKE_FLAGS}
OUTPUT_VARIABLE try_compile_output
)
if(${HAVE_${name}})
set(status_label "Success")
@ -1116,7 +1124,19 @@ function(qt_config_compile_test name)
set(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
set(CMAKE_REQUIRED_LIBRARIES "${arg_LIBRARIES}")
check_cxx_source_compiles("${arg_UNPARSED_ARGUMENTS} ${arg_CODE}" HAVE_${name})
# OUTPUT_VARIABLE is an internal undocumented variable of check_cxx_source_compiles
# since 3.23. Allow an opt out in case this breaks in the future.
set(try_compile_output "")
set(output_var "")
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.23"
AND NOT QT_INTERNAL_NO_TRY_COMPILE_OUTPUT_VARIABLE)
set(output_var OUTPUT_VARIABLE try_compile_output)
endif()
check_cxx_source_compiles(
"${arg_UNPARSED_ARGUMENTS} ${arg_CODE}" HAVE_${name} ${output_var}
)
set(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}")
set(CMAKE_C_STANDARD "${_save_CMAKE_C_STANDARD}")
@ -1128,6 +1148,7 @@ function(qt_config_compile_test name)
endif()
endif()
set(TEST_${name}_OUTPUT "${try_compile_output}" PARENT_SCOPE)
set(TEST_${name} "${HAVE_${name}}" CACHE INTERNAL "${arg_LABEL}")
endfunction()

View File

@ -1 +1,4 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
@extra_cmake_code@

View File

@ -69,7 +69,11 @@ function(qt_internal_add_linker_version_script target)
endforeach()
endforeach()
string(APPEND contents "\n};\nQt_${PROJECT_VERSION_MAJOR}_PRIVATE_API { qt_private_api_tag*;\n")
string(APPEND contents "\n};\nQt_${PROJECT_VERSION_MAJOR}")
if(QT_FEATURE_elf_private_full_version)
string(APPEND contents ".${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
endif()
string(APPEND contents "_PRIVATE_API { qt_private_api_tag*;\n")
if(arg_PRIVATE_HEADERS)
foreach(ph ${arg_PRIVATE_HEADERS})
string(APPEND contents " @FILE:${ph}@\n")
@ -400,7 +404,7 @@ function(qt_internal_enable_unicode_defines)
set(no_unicode_condition
"$<NOT:$<BOOL:$<TARGET_PROPERTY:QT_NO_UNICODE_DEFINES>>>")
target_compile_definitions(Platform
INTERFACE "$<${no_unicode_condition}:UNICODE;_UNICODE>")
INTERFACE "$<${no_unicode_condition}:UNICODE$<SEMICOLON>_UNICODE>")
endif()
endfunction()

View File

@ -37,6 +37,7 @@ macro(qt_find_apple_system_frameworks)
qt_internal_find_apple_system_framework(FWContacts Contacts)
qt_internal_find_apple_system_framework(FWEventKit EventKit)
qt_internal_find_apple_system_framework(FWHealthKit HealthKit)
qt_internal_find_apple_system_framework(FWUniformTypeIdentifiers UniformTypeIdentifiers)
endif()
endmacro()
@ -87,10 +88,12 @@ function(qt_copy_framework_headers target)
set(out_files "")
set(in_files "")
set(out_dirs "")
set(copy_commands "")
foreach(type IN ITEMS PUBLIC PRIVATE QPA RHI SSG)
set(in_files_${type} "")
set(fw_output_header_dir "${output_dir_${type}}")
list(APPEND out_dirs "${fw_output_header_dir}")
foreach(hdr IN LISTS arg_${type})
get_filename_component(in_file_path ${hdr} ABSOLUTE)
get_filename_component(in_file_name ${hdr} NAME)
@ -107,19 +110,40 @@ function(qt_copy_framework_headers target)
list(REMOVE_DUPLICATES out_files)
list(REMOVE_DUPLICATES in_files)
add_custom_command(
OUTPUT "${output_dir}/${fw_versioned_header_dir}" ${out_files}
DEPENDS ${in_files} ${target}_sync_headers
COMMAND
${CMAKE_COMMAND} -E copy_directory
"${module_build_interface_include_dir}/.syncqt_staging"
"${output_dir}/${fw_versioned_header_dir}"
${copy_commands}
VERBATIM
COMMENT "Copy the ${target} header files to the framework directory"
set(copy_fw_sync_headers_command
"${CMAKE_COMMAND}" -E copy_directory
"${module_build_interface_include_dir}/.syncqt_staging"
"${output_dir}/${fw_versioned_header_dir}"
)
set_property(TARGET ${target} APPEND PROPERTY
QT_COPIED_FRAMEWORK_HEADERS "${out_files}")
if(CMAKE_GENERATOR MATCHES "^Ninja")
add_custom_command(
OUTPUT "${output_dir}/${fw_versioned_header_dir}"
DEPENDS ${target}_sync_headers
COMMAND ${copy_fw_sync_headers_command}
VERBATIM
)
add_custom_target(${target}_copy_fw_sync_headers
DEPENDS "${output_dir}/${fw_versioned_header_dir}")
else()
add_custom_target(${target}_copy_fw_sync_headers
COMMAND ${copy_fw_sync_headers_command})
endif()
if(out_files)
add_custom_command(
OUTPUT ${out_files}
DEPENDS ${target}_copy_fw_sync_headers ${in_files}
COMMAND
${CMAKE_COMMAND} -E make_directory ${out_dirs}
${copy_commands}
VERBATIM
COMMENT "Copy the ${target} header files to the framework directory"
)
set_property(TARGET ${target} APPEND PROPERTY
QT_COPIED_FRAMEWORK_HEADERS "${out_files}")
endif()
endfunction()
function(qt_internal_generate_fake_framework_header target)

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
@PACKAGE_INIT@
set(@var_prefix@BINDIR "@INSTALL_BINDIR@")

View File

@ -242,15 +242,16 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
"$<${is_static_and_objc}:-fno-objc-msgsend-selector-stubs>"
)
endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "15.0.0")
# A bug in Xcode 15 adds duplicate flags to the linker. In addition, the
# `-warn_duplicate_libraries` is now enabled by default which may result
# in several 'duplicate libraries warning'.
# - https://gitlab.kitware.com/cmake/cmake/-/issues/25297 and
# - https://indiestack.com/2023/10/xcode-15-duplicate-library-linker-warnings/
target_link_options(PlatformCommonInternal INTERFACE
"LINKER:-no_warn_duplicate_libraries")
endif()
# A bug in Xcode 15 adds duplicate flags to the linker. In addition, the
# `-warn_duplicate_libraries` is now enabled by default which may result
# in several 'duplicate libraries warning'.
# - https://gitlab.kitware.com/cmake/cmake/-/issues/25297 and
# - https://indiestack.com/2023/10/xcode-15-duplicate-library-linker-warnings/
set(is_xcode15 "$<VERSION_GREATER_EQUAL:$<CXX_COMPILER_VERSION>,15>")
set(not_disabled "$<NOT:$<BOOL:$<TARGET_PROPERTY:QT_NO_DISABLE_WARN_DUPLICATE_LIBRARIES>>>")
target_link_options(PlatformCommonInternal INTERFACE
"$<$<AND:${not_disabled},${is_xcode15}>:LINKER:-no_warn_duplicate_libraries>")
endif()
if(MSVC)

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
@PACKAGE_INIT@
cmake_minimum_required(VERSION @min_new_policy_version@...@max_new_policy_version@)

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# Make sure @INSTALL_CMAKE_NAMESPACE@ is found before anything else.
set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE)

View File

@ -719,6 +719,9 @@ set(QT_ALLOW_MISSING_TOOLS_PACKAGES TRUE)")
get_filename_component(basename ${cmake_file} NAME)
file(COPY ${cmake_file} DESTINATION ${config_build_dir})
list(APPEND extra_cmake_files "${config_build_dir}/${basename}")
# Make sure touched extra cmake files cause a reconfigure, so they get re-copied.
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${cmake_file}")
endforeach()
list(APPEND extra_cmake_includes ${arg_EXTRA_CMAKE_INCLUDES})

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
@PACKAGE_INIT@
cmake_minimum_required(VERSION @min_new_policy_version@...@max_new_policy_version@)

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# Find "ModuleTools" dependencies, which are other ModuleTools packages.
set(@INSTALL_CMAKE_NAMESPACE@@target@_FOUND FALSE)
set(__qt_@target@_tool_deps "@package_deps@")

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
foreach(__qt_tool @tool_targets_non_prefixed@)
if(NOT TARGET Qt::${__qt_tool} AND TARGET Qt6::${__qt_tool})
add_executable(Qt::${__qt_tool} IMPORTED GLOBAL)

View File

@ -74,7 +74,7 @@ function(qt_internal_generate_pkg_config_file module)
foreach(dep IN LISTS loose_target_requires)
if(dep MATCHES "^Qt::")
string(REGEX REPLACE "Qt" "${QT_CMAKE_EXPORT_NAMESPACE}" dep ${dep})
else()
elseif(NOT dep MATCHES "^${QT_CMAKE_EXPORT_NAMESPACE}::")
# TODO: Figure out a way to get non-Qt requirements PkgConfig files.
continue()
endif()

View File

@ -195,13 +195,16 @@ function(qt_internal_android_test_arguments target timeout out_test_runner out_t
endif()
set(target_binary_dir "$<TARGET_PROPERTY:${target},BINARY_DIR>")
set(apk_dir "${target_binary_dir}/android-build")
if(QT_USE_TARGET_ANDROID_BUILD_DIR)
set(apk_dir "${target_binary_dir}/android-build-${target}")
else()
set(apk_dir "${target_binary_dir}/android-build")
endif()
set(${out_test_arguments}
"--path" "${apk_dir}"
"--adb" "${ANDROID_SDK_ROOT}/platform-tools/adb"
"--skip-install-root"
"--make" "${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target}_make_apk"
"--make" "\"${CMAKE_COMMAND}\" --build ${CMAKE_BINARY_DIR} --target ${target}_make_apk"
"--apk" "${apk_dir}/${target}.apk"
"--ndk-stack" "${ANDROID_NDK_ROOT}/ndk-stack"
"--timeout" "${timeout}"

View File

@ -1,6 +1,9 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
include_guard(DIRECTORY)
if(DEFINED QT_REPO_DEPENDENCIES AND NOT QT_BUILD_STANDALONE_TESTS)
if(DEFINED QT_REPO_DEPENDENCIES AND NOT QT_INTERNAL_BUILD_STANDALONE_PARTS)
# We're building a Qt repository.
# Skip this plugin if it has not been provided by one of this repo's dependencies.
string(TOLOWER "@PROJECT_NAME@" lower_case_project_name)

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
set(@target@_FOUND FALSE)
# note: _third_party_deps example: "ICU\\;FALSE\\;1.0\\;i18n uc data;ZLIB\\;FALSE\\;\\;"

View File

@ -91,6 +91,11 @@ function(qt_internal_add_plugin target)
qt6_add_plugin(${target} ${plugin_args})
qt_internal_mark_as_internal_library(${target})
get_target_property(target_type "${target}" TYPE)
if(plugin_init_target AND TARGET "${plugin_init_target}")
qt_internal_add_target_aliases("${plugin_init_target}")
endif()
set(plugin_type "")
# TODO: Transitional: Remove the TYPE option handling after all repos have been converted to use
# PLUGIN_TYPE.
@ -211,6 +216,13 @@ function(qt_internal_add_plugin target)
# This QT_PLUGINS assignment is only used by QtPostProcessHelpers to decide if a
# QtModulePlugins.cmake file should be generated.
set_property(TARGET "${qt_module_target}" APPEND PROPERTY QT_PLUGINS "${target}")
else()
# The _qt_plugins property is considered when collecting the plugins in
# deployment process. The usecase is following:
# QtModuleX is built separately and installed, so it's imported.
# The plugin is built in some application build tree and its PLUGIN_TYPE is associated
# with QtModuleX.
set_property(TARGET "${qt_module_target}" APPEND PROPERTY _qt_plugins "${target}")
endif()
set(plugin_target_versioned "${QT_CMAKE_EXPORT_NAMESPACE}::${target}")
@ -383,7 +395,6 @@ function(qt_internal_add_plugin target)
qt_register_target_dependencies("${target}" "${arg_PUBLIC_LIBRARIES}" "${qt_libs_private}")
get_target_property(target_type "${target}" TYPE)
if(target_type STREQUAL STATIC_LIBRARY)
if(qt_module_target)
qt_internal_link_internal_platform_for_object_library("${plugin_init_target}")

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
include_guard(DIRECTORY)
@QT_MODULE_PLUGIN_INCLUDES@

View File

@ -451,7 +451,28 @@ if(NOT DEFINED QT_SKIP_AUTO_QML_PLUGIN_INCLUSION)
set(QT_SKIP_AUTO_QML_PLUGIN_INCLUSION OFF)
endif()
file(GLOB __qt_qml_plugins_config_file_list \"\${CMAKE_CURRENT_LIST_DIR}/QmlPlugins/${INSTALL_CMAKE_NAMESPACE}*Config.cmake\")
set(__qt_qml_plugins_config_file_list \"\")
set(__qt_qml_plugins_glob_prefixes \"\${CMAKE_CURRENT_LIST_DIR}\")
# Allow passing additional prefixes where we will glob for PluginConfig.cmake files.
if(QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES)
foreach(__qt_qml_plugin_glob_prefix IN LISTS QT_ADDITIONAL_QML_PLUGIN_GLOB_PREFIXES)
if(__qt_qml_plugin_glob_prefix)
list(APPEND __qt_qml_plugins_glob_prefixes \"\${__qt_qml_plugin_glob_prefix}\")
endif()
endforeach()
endif()
list(REMOVE_DUPLICATES __qt_qml_plugins_glob_prefixes)
foreach(__qt_qml_plugin_glob_prefix IN LISTS __qt_qml_plugins_glob_prefixes)
file(GLOB __qt_qml_plugins_glob_config_file_list
\"\${__qt_qml_plugin_glob_prefix}/QmlPlugins/${INSTALL_CMAKE_NAMESPACE}*Config.cmake\")
if(__qt_qml_plugins_glob_config_file_list)
list(APPEND __qt_qml_plugins_config_file_list \${__qt_qml_plugins_glob_config_file_list})
endif()
endforeach()
if (__qt_qml_plugins_config_file_list AND NOT QT_SKIP_AUTO_QML_PLUGIN_INCLUSION)
# First round of inclusions ensure all qml plugin targets are brought into scope.
foreach(__qt_qml_plugin_config_file \${__qt_qml_plugins_config_file_list})
@ -477,8 +498,8 @@ if (__qt_qml_plugins_config_file_list AND NOT QT_SKIP_AUTO_QML_PLUGIN_INCLUSION)
endif()")
endif()
get_target_property(qt_plugins "${QT_MODULE}" QT_PLUGINS)
if(qt_plugins OR QT_MODULE_PLUGIN_INCLUDES)
get_target_property(module_plugin_types "${QT_MODULE}" MODULE_PLUGIN_TYPES)
if(module_plugin_types OR QT_MODULE_PLUGIN_INCLUDES)
list(APPEND modules_with_plugins "${QT_MODULE}")
configure_file(
"${QT_CMAKE_DIR}/QtPlugins.cmake.in"
@ -556,9 +577,8 @@ function(qt_generate_build_internals_extra_cmake_code)
if(CMAKE_BUILD_TYPE)
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS
"
# Used by qt_internal_set_cmake_build_type.
set(__qt_internal_initial_qt_cmake_build_type \"${CMAKE_BUILD_TYPE}\")
qt_internal_force_set_cmake_build_type_conditionally(
\"\${__qt_internal_initial_qt_cmake_build_type}\")
")
endif()
if(CMAKE_CONFIGURATION_TYPES)
@ -580,17 +600,6 @@ qt_internal_force_set_cmake_build_type_conditionally(
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS
"\nset(QT_MULTI_CONFIG_FIRST_CONFIG \"${QT_MULTI_CONFIG_FIRST_CONFIG}\")\n")
endif()
# When building standalone tests against a multi-config Qt, we want to choose the first
# configuration, rather than use CMake's default value.
# In the case of Windows, we definitely don't it to default to Debug, because that causes
# issues in the CI.
if(multi_config_specific)
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS "
if(QT_BUILD_STANDALONE_TESTS)
qt_internal_force_set_cmake_build_type_conditionally(
\"\${QT_MULTI_CONFIG_FIRST_CONFIG}\")
endif()\n")
endif()
if(CMAKE_CROSS_CONFIGS)
string(APPEND ninja_multi_config_specific
@ -728,10 +737,22 @@ set(OpenGL_GL_PREFERENCE \"${OpenGL_GL_PREFERENCE}\" CACHE STRING \"\")
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS
"
set(QT_COPYRIGHT_YEAR \"${QT_COPYRIGHT_YEAR}\" CACHE STRING \"\")
set(QT_COPYRIGHT \"${QT_COPYRIGHT}\" CACHE STRING \"\")
")
# Add the apple version requirements to the BuildInternals extra code, so the info is
# available when configuring a standalone test.
# Otherwise when QtSetup is included after a
# find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
# call, Qt6ConfigExtras.cmake is not included yet, the requirements are not available and
# _qt_internal_check_apple_sdk_and_xcode_versions() would fail.
_qt_internal_export_apple_sdk_and_xcode_version_requirements(apple_requirements)
if(apple_requirements)
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS "
${apple_requirements}
")
endif()
qt_compute_relative_path_from_cmake_config_dir_to_prefix()
configure_file(
"${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsExtra.cmake.in"
@ -798,7 +819,7 @@ function(qt_internal_create_config_file_for_standalone_tests)
# Create a Config file that calls find_package on the modules that were built as part
# of the current repo. This is used for standalone tests.
qt_internal_get_standalone_tests_config_file_name(tests_config_file_name)
qt_internal_get_standalone_parts_config_file_name(tests_config_file_name)
# Standalone tests Config files should follow the main versioning scheme.
qt_internal_get_package_version_of_target(Platform main_qt_package_version)
@ -842,8 +863,15 @@ function(qt_internal_generate_user_facing_tools_info)
if(NOT filename)
set(filename ${target})
endif()
set(linkname ${filename})
if(APPLE)
get_target_property(is_macos_bundle ${target} MACOSX_BUNDLE )
if(is_macos_bundle)
set(filename "${filename}.app/Contents/MacOS/${filename}")
endif()
endif()
qt_path_join(tool_target_path "${CMAKE_INSTALL_PREFIX}" "${INSTALL_BINDIR}" "${filename}")
qt_path_join(tool_link_path "${INSTALL_PUBLICBINDIR}" "${filename}${PROJECT_VERSION_MAJOR}")
qt_path_join(tool_link_path "${INSTALL_PUBLICBINDIR}" "${linkname}${PROJECT_VERSION_MAJOR}")
list(APPEND lines "${tool_target_path} ${tool_link_path}")
endforeach()
string(REPLACE ";" "\n" content "${lines}")

View File

@ -781,8 +781,23 @@ QT_PATCH_VERSION = ${PROJECT_VERSION_PATCH}
if(APPLE)
list(APPEND extra_statements "QT_MAC_SDK_VERSION = ${QT_MAC_SDK_VERSION}")
list(APPEND extra_statements
"QMAKE_MACOSX_DEPLOYMENT_TARGET = ${CMAKE_OSX_DEPLOYMENT_TARGET}")
if(NOT CMAKE_SYSTEM_NAME OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# macOS
list(APPEND extra_statements
"QMAKE_MACOSX_DEPLOYMENT_TARGET = ${CMAKE_OSX_DEPLOYMENT_TARGET}")
list(APPEND extra_statements
"QT_MAC_SDK_VERSION_MIN = ${QT_SUPPORTED_MIN_MACOS_SDK_VERSION}")
list(APPEND extra_statements
"QT_MAC_SDK_VERSION_MAX = ${QT_SUPPORTED_MAX_MACOS_SDK_VERSION}")
elseif(CMAKE_SYSTEM_NAME STREQUAL iOS)
list(APPEND extra_statements
"QMAKE_IOS_DEPLOYMENT_TARGET = ${CMAKE_OSX_DEPLOYMENT_TARGET}")
list(APPEND extra_statements
"QT_MAC_SDK_VERSION_MIN = ${QT_SUPPORTED_MIN_IOS_SDK_VERSION}")
list(APPEND extra_statements
"QT_MAC_SDK_VERSION_MAX = ${QT_SUPPORTED_MAX_IOS_SDK_VERSION}")
endif()
if (CMAKE_OSX_ARCHITECTURES)
list(APPEND architectures "${CMAKE_OSX_ARCHITECTURES}")
string (REPLACE ";" " " architectures "${architectures}")
@ -792,8 +807,6 @@ QT_PATCH_VERSION = ${PROJECT_VERSION_PATCH}
list(APPEND extra_statements "QT_ARCHS = ${architectures}")
endif()
list(APPEND extra_statements "QT_EDITION = Open Source")
if(WASM)
list(APPEND extra_statements
"QT_EMCC_VERSION = ${EMCC_VERSION}")

View File

@ -110,6 +110,20 @@ while(NOT "${configure_args}" STREQUAL "")
foreach(qtrepo IN LISTS qtrepos)
push("-DBUILD_${qtrepo}=OFF")
endforeach()
elseif(arg STREQUAL "-skip-tests")
list(POP_FRONT configure_args qtrepos)
is_non_empty_valid_arg("${arg}" "${qtrepos}")
list(TRANSFORM qtrepos REPLACE "," ";")
foreach(qtrepo IN LISTS qtrepos)
push("-DQT_BUILD_TESTS_PROJECT_${qtrepo}=OFF")
endforeach()
elseif(arg STREQUAL "-skip-examples")
list(POP_FRONT configure_args qtrepos)
is_non_empty_valid_arg("${arg}" "${qtrepos}")
list(TRANSFORM qtrepos REPLACE "," ";")
foreach(qtrepo IN LISTS qtrepos)
push("-DQT_BUILD_EXAMPLES_PROJECT_${qtrepo}=OFF")
endforeach()
elseif(arg STREQUAL "-submodules")
warn_in_per_repo_build("${arg}")
list(POP_FRONT configure_args submodules)

View File

@ -612,8 +612,8 @@ function(_qt_internal_set_apple_localizations target)
return()
endif()
set(supported_languages "${QT_I18N_LANGUAGES}")
if("${QT_I18N_LANGUAGES}" STREQUAL "")
set(supported_languages "${QT_I18N_TRANSLATED_LANGUAGES}")
if("${QT_I18N_TRANSLATED_LANGUAGES}" STREQUAL "")
get_target_property(supported_languages "${target}" _qt_apple_supported_languages)
if("${supported_languages}" STREQUAL "supported_languages-NOTFOUND")
return()
@ -692,7 +692,11 @@ function(_qt_internal_export_apple_sdk_and_xcode_version_requirements out_var)
set(assignments "")
foreach(var IN LISTS vars_to_assign)
set(value "${${var}}")
list(APPEND assignments "set(${var} \"${value}\")")
list(APPEND assignments
"
if(NOT ${var})
set(${var} \"${value}\")
endif()")
endforeach()
list(JOIN assignments "\n" assignments)

View File

@ -25,10 +25,13 @@ endfunction()
# The function checks if add_custom_command has the support of the DEPFILE argument.
function(_qt_internal_check_depfile_support out_var)
if(CMAKE_GENERATOR MATCHES "Ninja" OR
CMAKE_VERSION VERSION_GREATER_EQUAL 3.20 AND CMAKE_GENERATOR MATCHES "Makefiles"
OR CMAKE_VERSION VERSION_GREATER_EQUAL 3.21
(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20 AND CMAKE_GENERATOR MATCHES "Makefiles")
OR (CMAKE_VERSION VERSION_GREATER_EQUAL 3.21
AND (CMAKE_GENERATOR MATCHES "Xcode"
OR CMAKE_GENERATOR MATCHES "Visual Studio ([0-9]+)" AND CMAKE_MATCH_1 GREATER_EQUAL 12))
OR (CMAKE_GENERATOR MATCHES "Visual Studio ([0-9]+)" AND CMAKE_MATCH_1 GREATER_EQUAL 12)
)
)
)
set(${out_var} TRUE)
else()
set(${out_var} FALSE)
@ -78,6 +81,22 @@ function(__qt_internal_collect_additional_prefix_paths out_var prefixes_var)
set("${out_var}" "${additional_packages_prefix_paths}" PARENT_SCOPE)
endfunction()
# Collects CMAKE_MODULE_PATH from QT_ADDITIONAL_PACKAGES_PREFIX_PATH
function(__qt_internal_collect_additional_module_paths)
if(__qt_additional_module_paths_set)
return()
endif()
foreach(prefix_path IN LISTS QT_ADDITIONAL_PACKAGES_PREFIX_PATH)
list(APPEND CMAKE_MODULE_PATH "${prefix_path}/${QT_CMAKE_EXPORT_NAMESPACE}")
# TODO: Need to consider the INSTALL_LIBDIR value when collecting CMAKE_MODULE_PATH.
# See QTBUG-123039.
list(APPEND CMAKE_MODULE_PATH "${prefix_path}/lib/cmake/${QT_CMAKE_EXPORT_NAMESPACE}")
endforeach()
list(REMOVE_DUPLICATES CMAKE_MODULE_PATH)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" PARENT_SCOPE)
set(__qt_additional_module_paths_set TRUE PARENT_SCOPE)
endfunction()
# Take a list of prefix paths ending with "/lib/cmake", and return a list of absolute paths with
# "/lib/cmake" removed.
function(__qt_internal_prefix_paths_to_roots out_var prefix_paths)
@ -117,6 +136,18 @@ function(_qt_internal_collect_buildsystem_targets result dir)
endif()
get_property(subdirs DIRECTORY "${dir}" PROPERTY SUBDIRECTORIES)
# Make sure that we don't hit endless recursion when running qt-cmake-standalone-test on a
# in-source test dir, where the currently processed directory lists itself in its SUBDIRECTORIES
# property.
# See https://bugreports.qt.io/browse/QTBUG-119998
# and https://gitlab.kitware.com/cmake/cmake/-/issues/25489
# Do it only when QT_INTERNAL_IS_STANDALONE_TEST is set, to avoid the possible slowdown when
# processing many subdirectores when configuring all standalone tests rather than just one.
if(QT_INTERNAL_IS_STANDALONE_TEST)
list(REMOVE_ITEM subdirs "${dir}")
endif()
foreach(subdir IN LISTS subdirs)
_qt_internal_collect_buildsystem_targets(${result} "${subdir}" ${forward_args})
endforeach()

View File

@ -24,8 +24,22 @@ function(_qt_internal_get_build_vars_for_external_projects)
"${no_value_options}" "${single_value_options}" "${multi_value_options}"
)
# Standalone tests and examples have QT_BUILD_DIR pointing to the fake standalone prefix.
# Use instead the relocatable prefix, because qt must have been built / installed by this point.
if(QT_INTERNAL_BUILD_STANDALONE_PARTS)
qt_path_join(qt_cmake_dir
"${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}"
"${INSTALL_LIBDIR}/cmake/${QT_CMAKE_EXPORT_NAMESPACE}"
)
set(qt_prefixes "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}")
set(qt_additional_packages_prefixes "${qt_prefixes}")
if(QT_WILL_INSTALL)
list(APPEND qt_prefixes "${QT6_INSTALL_PREFIX}")
endif()
# TODO: Fix example/test builds when using Conan / install prefixes are different for each repo.
if(QT_SUPERBUILD OR QtBase_BINARY_DIR)
elseif(QT_SUPERBUILD OR QtBase_BINARY_DIR)
# When doing a top-level build or when building qtbase,
# always use the Config file from the current build directory, even for prefix builds.
# We strive to allow building examples without installing Qt first, which means we can't
@ -59,8 +73,8 @@ function(_qt_internal_get_build_vars_for_external_projects)
endif()
endif()
if(arg_CMAKE_DIR)
set("${arg_CMAKE_DIR}" "${qt_cmake_dir}" PARENT_SCOPE)
if(arg_CMAKE_DIR_VAR)
set("${arg_CMAKE_DIR_VAR}" "${qt_cmake_dir}" PARENT_SCOPE)
endif()
if(arg_PREFIXES_VAR)
set("${arg_PREFIXES_VAR}" "${qt_prefixes}" PARENT_SCOPE)

View File

@ -187,7 +187,7 @@ function(__qt_internal_get_plugin_import_macro plugin_target out_var)
set(class_name "${class_name_prefixed}")
endif()
set(${out_var} "Q_IMPORT_PLUGIN(${class_name})" PARENT_SCOPE)
set(${out_var} "Q_IMPORT_PLUGIN(${class_name})\n" PARENT_SCOPE)
endfunction()
function(__qt_internal_get_plugin_include_prelude out_var)

View File

@ -184,13 +184,13 @@ function(__qt_internal_walk_libs
if(lib_target MATCHES "^::@")
continue()
elseif(TARGET ${lib_target})
if ("${lib_target}" MATCHES "^Qt::(.*)")
# If both, Qt::Foo and Foo targets exist, prefer the target name without
if(NOT "${lib_target}" MATCHES "^(Qt|${QT_CMAKE_EXPORT_NAMESPACE})::.+")
# If both, Qt::Foo and Foo targets exist, prefer the target name with versioned
# namespace. Which one is preferred doesn't really matter. This code exists to
# avoid ending up with both, Qt::Foo and Foo in our dependencies.
set(namespaceless_lib_target "${CMAKE_MATCH_1}")
if(TARGET namespaceless_lib_target)
set(lib_target ${namespaceless_lib_target})
set(versioned_qt_target "${QT_CMAKE_EXPORT_NAMESPACE}::${lib_target}")
if(TARGET "${versioned_qt_target}")
set(lib_target ${versioned_qt_target})
endif()
endif()
get_target_property(lib_target_type ${lib_target} TYPE)
@ -255,8 +255,8 @@ function(__qt_internal_walk_libs
__qt_internal_promote_target_to_global(${lib_target_unaliased})
endif()
endif()
elseif("${lib_target}" MATCHES "^Qt::(.*)")
message(FATAL_ERROR "The ${CMAKE_MATCH_1} target is mentioned as a dependency for \
elseif("${lib_target}" MATCHES "^(Qt|${QT_CMAKE_EXPORT_NAMESPACE})::(.*)")
message(FATAL_ERROR "The ${CMAKE_MATCH_2} target is mentioned as a dependency for \
${target}, but not declared.")
else()
if(NOT operation MATCHES "^(collect|direct)_targets$")

View File

@ -30,7 +30,7 @@ function(__qt_internal_query_emsdk_version emroot_path is_fatal out_var)
set(EXECUTE_COMMANDPATH "$ENV{EMSDK}/${emroot_path}/emcc")
endif()
file(TO_NATIVE_PATH "${EXECUTE_COMMANDPATH}" EXECUTE_COMMAND)
file(TO_CMAKE_PATH "${EXECUTE_COMMANDPATH}" EXECUTE_COMMAND)
execute_process(COMMAND ${EXECUTE_COMMAND} --version
OUTPUT_VARIABLE emOutput
OUTPUT_STRIP_TRAILING_WHITESPACE
@ -53,7 +53,7 @@ endfunction()
function(__qt_internal_get_emcc_recommended_version out_var)
# This version of Qt needs this version of emscripten.
set(QT_EMCC_RECOMMENDED_VERSION "3.1.37")
set(QT_EMCC_RECOMMENDED_VERSION "3.1.50")
set(${out_var} "${QT_EMCC_RECOMMENDED_VERSION}" PARENT_SCOPE)
endfunction()

View File

@ -80,7 +80,7 @@ endfunction()
# up the host qmake's properties for cross-compiling with this Qt
# build.
function(qt_generate_qmake_and_qtpaths_wrapper_for_target)
if(NOT CMAKE_CROSSCOMPILING)
if(NOT CMAKE_CROSSCOMPILING OR QT_NO_GENERATE_QMAKE_WRAPPER_FOR_TARGET)
return()
endif()

View File

@ -217,6 +217,24 @@ macro(qt_internal_set_default_rpath_settings)
if(NOT QT_NO_DISABLE_CMAKE_INSTALL_RPATH_USE_LINK_PATH)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
endif()
# If Qt is built without rpath support, we should not add "user-project default rpaths" to
# qt qml plugins. Do this by setting QT_NO_QML_PLUGIN_RPATH to TRUE, which is
# then read by qt6_add_qml_plugin.
# We do this as part of the internal API, because we still want to allow user project qml
# plugins to have sensible default rpaths, even if Qt qml plugins were built without support
# for rpaths.
#
# Note that feature evaluation is not done yet in qtbase at this point, so we check both
# feature variable variants. In practice it doesn't really matter, because the variable is only
# read during qtdeclarative configuration time when the feature is already evaluated.
#
# We also make sure not to set it as a cache var just in case somebody wants to override it
# per directory scope.
if(NOT DEFINED QT_NO_QML_PLUGIN_RPATH
AND (QT_DISABLE_RPATH OR (NOT FEATURE_rpath) OR (NOT QT_FEATURE_rpath)))
set(QT_NO_QML_PLUGIN_RPATH "TRUE")
endif()
endmacro()
# Overrides the CMAKE_STAGING_PREFIX in a subdirectory scope, to stop CMake from rewriting build

View File

@ -26,3 +26,35 @@ function(qt_internal_set_up_sanitizer_options)
set(ECM_ENABLE_SANITIZERS "${enabled_sanitizer_features}" PARENT_SCOPE)
endif()
endfunction()
# This function clears the previously set sanitizer flags from CMAKE_<C|CXX>_FLAGS
function(qt_internal_skip_sanitizer)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR
CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR
CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
foreach(sanitizer ${ECM_ENABLE_SANITIZERS})
string(TOLOWER "${sanitizer}" sanitizer)
enable_sanitizer_flags("${sanitizer}")
qt_internal_remove_compiler_flags(${XSAN_COMPILE_FLAGS})
endforeach()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" PARENT_SCOPE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" PARENT_SCOPE)
endif()
endfunction()
# This function disables the sanitizer library linking to all targets created in a subdirectory
# where the function is called. Note that the function should be called after all involved targets
# are created, to make sure they are collected by the function.
function(qt_internal_skip_linking_sanitizer)
_qt_internal_collect_buildsystem_targets(all_targets "${CMAKE_CURRENT_SOURCE_DIR}"
INCLUDE
STATIC_LIBRARY
MODULE_LIBRARY
SHARED_LIBRARY
OBJECT_LIBRARY
EXECUTABLE
)
foreach(t IN LISTS all_targets)
set_property(TARGET ${t} PROPERTY SKIP_SANITIZER TRUE)
endforeach()
endfunction()

View File

@ -1,3 +1,8 @@
<!--
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: BSD-3-Clause
-->
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">

View File

@ -1,3 +1,6 @@
# Copyright (C) 2024 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
# TODO: Ideally this should look for each Qt module separately, with each module's specific version,
# bypassing the Qt6 Config file, aka find_package(Qt6SpecificFoo) repated x times. But it's not
# critical.

View File

@ -121,13 +121,16 @@ function(qt_internal_extend_target target)
# heuristic way of building the dependency tree between the _sync_headers targets of
# different Qt modules.
if(TARGET "${lib}")
get_target_property(is_private ${lib} _qt_is_private_module)
if(is_private)
get_target_property(lib ${lib} _qt_public_module_target_name)
get_target_property(is_imported ${lib} IMPORTED)
if(NOT is_imported)
get_target_property(is_private ${lib} _qt_is_private_module)
if(is_private)
get_target_property(lib ${lib} _qt_public_module_target_name)
endif()
set(out_genex "$<TARGET_PROPERTY:${lib},_qt_internal_sync_headers_target>")
set_property(TARGET ${target}
APPEND PROPERTY _qt_internal_sync_headers_deps "${out_genex}")
endif()
set(out_genex "$<TARGET_PROPERTY:${lib},_qt_internal_sync_headers_target>")
set_property(TARGET ${target}
APPEND PROPERTY _qt_internal_sync_headers_deps "${out_genex}")
endif()
endforeach()
@ -456,6 +459,7 @@ function(qt_internal_setup_cmake_config_postfix)
# If postfix is set by user avoid changing it, but save postfix variable that has
# a non-default value for further warning.
if("${${postfix_var}}" STREQUAL "")
set(${postfix_var} "${${default_postfix_var}}")
set(${postfix_var} "${${default_postfix_var}}" PARENT_SCOPE)
elseif(NOT "${${postfix_var}}" STREQUAL "${${default_postfix_var}}")
list(APPEND custom_postfix_vars ${postfix_var})
@ -808,9 +812,8 @@ endif()
endif()
# INTERFACE libraries don't have IMPORTED_LOCATION-like properties.
# OBJECT libraries have properties like IMPORTED_OBJECTS instead.
# Skip the rest of the processing for those.
if(target_type STREQUAL "INTERFACE_LIBRARY" OR target_type STREQUAL "OBJECT_LIBRARY")
if(target_type STREQUAL "INTERFACE_LIBRARY")
continue()
endif()
@ -821,19 +824,46 @@ endif()
# For Multi-config developer builds we should simply reuse IMPORTED_LOCATION of the
# target.
if(NOT QT_WILL_INSTALL AND QT_FEATURE_debug_and_release)
set(configure_time_target_build_location "")
get_target_property(configure_time_target_install_location ${target}
IMPORTED_LOCATION)
else()
if(IS_ABSOLUTE "${arg_CONFIG_INSTALL_DIR}")
file(RELATIVE_PATH reverse_relative_prefix_path
"${arg_CONFIG_INSTALL_DIR}" "${CMAKE_INSTALL_PREFIX}")
else()
file(RELATIVE_PATH reverse_relative_prefix_path
"${CMAKE_INSTALL_PREFIX}/${arg_CONFIG_INSTALL_DIR}"
"${CMAKE_INSTALL_PREFIX}")
endif()
get_target_property(configure_time_target_build_location ${target}
_qt_internal_configure_time_target_build_location)
string(TOUPPER "${QT_CMAKE_EXPORT_NAMESPACE}_INSTALL_PREFIX" install_prefix_var)
string(JOIN "" configure_time_target_build_location
"$\{CMAKE_CURRENT_LIST_DIR}/"
"${reverse_relative_prefix_path}"
"${configure_time_target_build_location}")
get_target_property(configure_time_target_install_location ${target}
_qt_internal_configure_time_target_install_location)
set(configure_time_target_install_location
"$\{PACKAGE_PREFIX_DIR}/${configure_time_target_install_location}")
string(JOIN "" configure_time_target_install_location
"$\{CMAKE_CURRENT_LIST_DIR}/"
"${reverse_relative_prefix_path}"
"${configure_time_target_install_location}")
endif()
if(configure_time_target_install_location)
string(APPEND content "
# Import configure-time executable ${full_target}
if(NOT TARGET ${full_target})
set(_qt_imported_location \"${configure_time_target_install_location}\")
set(_qt_imported_build_location \"${configure_time_target_build_location}\")
set(_qt_imported_install_location \"${configure_time_target_install_location}\")
set(_qt_imported_location \"\${_qt_imported_install_location}\")
if(NOT EXISTS \"$\{_qt_imported_location}\"
AND NOT \"$\{_qt_imported_build_location}\" STREQUAL \"\")
set(_qt_imported_location \"\${_qt_imported_build_location}\")
endif()
if(NOT EXISTS \"$\{_qt_imported_location}\")
message(FATAL_ERROR \"Unable to add configure time executable ${full_target}\"
\" $\{_qt_imported_location} doesn't exists\")
@ -844,6 +874,8 @@ if(NOT TARGET ${full_target})
\"$\{_qt_imported_location}\")
set_property(TARGET ${full_target} PROPERTY IMPORTED_GLOBAL TRUE)
unset(_qt_imported_location)
unset(_qt_imported_build_location)
unset(_qt_imported_install_location)
endif()
\n")
endif()
@ -853,7 +885,7 @@ endif()
# the target. It is not built by default.
if(NOT QT_WILL_INSTALL AND QT_FEATURE_debug_and_release)
get_target_property(excluded_genex ${target} EXCLUDE_FROM_ALL)
if(NOT excluded_genex STREQUAL "")
if(excluded_genex)
string(APPEND content "
# ${full_target} is not built by default in the Debug configuration. Check existence.
get_target_property(_qt_imported_location ${full_target} IMPORTED_LOCATION_DEBUG)
@ -868,6 +900,9 @@ endif()\n")
set(write_implib FALSE)
set(write_soname FALSE)
set(write_objects FALSE)
set(write_location TRUE)
if(target_type STREQUAL "SHARED_LIBRARY")
if(WIN32)
set(write_implib TRUE)
@ -876,24 +911,41 @@ endif()\n")
else()
set(write_soname TRUE)
endif()
elseif(target_type STREQUAL "OBJECT_LIBRARY")
set(write_objects TRUE)
set(write_location FALSE)
endif()
if(NOT "${uc_release_cfg}" STREQUAL "")
string(APPEND content "get_target_property(_qt_imported_location ${full_target} IMPORTED_LOCATION_${uc_release_cfg})\n")
if(write_location)
string(APPEND content "get_target_property(_qt_imported_location ${full_target} IMPORTED_LOCATION_${uc_release_cfg})\n")
endif()
if(write_implib)
string(APPEND content "get_target_property(_qt_imported_implib ${full_target} IMPORTED_IMPLIB_${uc_release_cfg})\n")
endif()
if(write_soname)
string(APPEND content "get_target_property(_qt_imported_soname ${full_target} IMPORTED_SONAME_${uc_release_cfg})\n")
endif()
if(write_objects)
string(APPEND content "get_target_property(_qt_imported_objects ${full_target} IMPORTED_OBJECTS_${uc_release_cfg})\n")
# We generate CLR props as well, because that's what CMake generates for object
# libraries with CMake 3.27. They are usually empty strings though, aka "".
string(APPEND content "get_target_property(_qt_imported_clr ${full_target} IMPORTED_COMMON_LANGUAGE_RUNTIME_${uc_release_cfg})\n")
endif()
endif()
if(write_location)
string(APPEND content "get_target_property(_qt_imported_location_default ${full_target} IMPORTED_LOCATION_$\{QT_DEFAULT_IMPORT_CONFIGURATION})\n")
endif()
string(APPEND content "get_target_property(_qt_imported_location_default ${full_target} IMPORTED_LOCATION_$\{QT_DEFAULT_IMPORT_CONFIGURATION})\n")
if(write_implib)
string(APPEND content "get_target_property(_qt_imported_implib_default ${full_target} IMPORTED_IMPLIB_$\{QT_DEFAULT_IMPORT_CONFIGURATION})\n")
endif()
if(write_soname)
string(APPEND content "get_target_property(_qt_imported_soname_default ${full_target} IMPORTED_SONAME_$\{QT_DEFAULT_IMPORT_CONFIGURATION})\n")
endif()
if(write_objects)
string(APPEND content "get_target_property(_qt_imported_objects_default ${full_target} IMPORTED_OBJECTS_$\{QT_DEFAULT_IMPORT_CONFIGURATION})\n")
string(APPEND content "get_target_property(_qt_imported_clr_default ${full_target} IMPORTED_COMMON_LANGUAGE_RUNTIME_$\{QT_DEFAULT_IMPORT_CONFIGURATION})\n")
endif()
foreach(config ${configurations_to_export} "")
string(TOUPPER "${config}" ucconfig)
if("${config}" STREQUAL "")
@ -908,10 +960,12 @@ endif()\n")
set_property(TARGET ${full_target} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${ucconfig})
")
endif()
string(APPEND content "
if(write_location)
string(APPEND content "
if(_qt_imported_location${var_suffix})
set_property(TARGET ${full_target} PROPERTY IMPORTED_LOCATION${property_suffix} \"$\{_qt_imported_location${var_suffix}}\")
endif()")
endif()
if(write_implib)
string(APPEND content "
if(_qt_imported_implib${var_suffix})
@ -922,6 +976,16 @@ endif()")
string(APPEND content "
if(_qt_imported_soname${var_suffix})
set_property(TARGET ${full_target} PROPERTY IMPORTED_SONAME${property_suffix} \"$\{_qt_imported_soname${var_suffix}}\")
endif()")
endif()
if(write_objects)
string(APPEND content "
if(_qt_imported_objects${var_suffix})
set_property(TARGET ${full_target} PROPERTY IMPORTED_OBJECTS${property_suffix} \"$\{_qt_imported_objects${var_suffix}}\")
endif()")
string(APPEND content "
if(_qt_imported_clr${var_suffix})
set_property(TARGET ${full_target} PROPERTY IMPORTED_COMMON_LANGUAGE_RUNTIME${property_suffix} \"$\{_qt_imported_clr${var_suffix}}\")
endif()")
endif()
string(APPEND content "\n")
@ -934,6 +998,10 @@ unset(_qt_imported_location)
unset(_qt_imported_location_default)
unset(_qt_imported_soname)
unset(_qt_imported_soname_default)
unset(_qt_imported_objects)
unset(_qt_imported_objects_default)
unset(_qt_imported_clr)
unset(_qt_imported_clr_default)
unset(_qt_imported_configs)")
endif()

View File

@ -582,6 +582,11 @@ function(qt_internal_add_test name)
)
set_target_properties(${name} PROPERTIES _qt_is_test_executable TRUE)
set_target_properties(${name} PROPERTIES _qt_is_manual_test ${arg_MANUAL})
set(blacklist_file "${CMAKE_CURRENT_SOURCE_DIR}/BLACKLIST")
if(EXISTS ${blacklist_file})
_qt_internal_expose_source_file_to_ide("${name}" ${blacklist_file})
endif()
endif()
foreach(path IN LISTS arg_QML_IMPORTPATH)
@ -606,12 +611,12 @@ function(qt_internal_add_test name)
endif()
endif()
# Pass 95% of the timeout to allow the test runner time to do any cleanup
# before being killed.
set(percentage "95")
qt_internal_get_android_test_timeout("${arg_TIMEOUT}" "${percentage}" android_timeout)
if (ANDROID)
# Pass 95% of the timeout to allow the test runner time to do any cleanup
# before being killed.
set(percentage "95")
qt_internal_get_android_test_timeout("${arg_TIMEOUT}" "${percentage}" android_timeout)
if(arg_BUNDLE_ANDROID_OPENSSL_LIBS)
if(EXISTS "${OPENSSL_ROOT_DIR}/${CMAKE_ANDROID_ARCH_ABI}/libcrypto_3.so")
message(STATUS "Looking for OpenSSL in ${OPENSSL_ROOT_DIR}")
@ -637,8 +642,8 @@ function(qt_internal_add_test name)
endif()
else()
message(STATUS "The argument BUNDLE_ANDROID_OPENSSL_LIBS is set "
"but OPENSSL_ROOT_DIR parameter is not set."
"Test should bundle OpenSSL libraries but they are not found."
"but OPENSSL_ROOT_DIR parameter is not set. "
"Test should bundle OpenSSL libraries but they are not found. "
"This is fine if OpenSSL was built statically.")
endif()
endif()
@ -737,6 +742,14 @@ function(qt_internal_add_test name)
set_tests_properties(${testname} PROPERTIES TIMEOUT ${arg_TIMEOUT})
endif()
if(ANDROID AND NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
# Set timeout signal and some time for androidtestrunner to do cleanup
set_tests_properties(${testname} PROPERTIES
TIMEOUT_SIGNAL_NAME "SIGINT"
TIMEOUT_SIGNAL_GRACE_PERIOD 10.0
)
endif()
# Add a ${target}/check makefile target, to more easily test one test.
set(test_config_options "")
@ -855,8 +868,13 @@ endfunction()
function(qt_internal_get_android_test_timeout input_timeout percentage output_timeout_var)
set(actual_timeout "${input_timeout}")
if(NOT actual_timeout)
# Related: https://gitlab.kitware.com/cmake/cmake/-/issues/20450
if(DART_TESTING_TIMEOUT)
# we have coin ci timeout set use that to avoid having the emulator killed
# so we can at least get some logs from the android test runner.
set(coin_timeout $ENV{COIN_COMMAND_OUTPUT_TIMEOUT})
if(coin_timeout)
set(actual_timeout "${coin_timeout}")
elseif(DART_TESTING_TIMEOUT)
# Related: https://gitlab.kitware.com/cmake/cmake/-/issues/20450
set(actual_timeout "${DART_TESTING_TIMEOUT}")
elseif(CTEST_TEST_TIMEOUT)
set(actual_timeout "${CTEST_TEST_TIMEOUT}")

View File

@ -206,7 +206,7 @@ function(qt_internal_add_tool target_name)
OUT_VAR install_targets_default_args
RUNTIME "${install_dir}"
CMAKE_CONFIG "${cmake_config}"
ALL_CMAKE_CONFIGS "${cmake_configs}")
ALL_CMAKE_CONFIGS ${cmake_configs})
# Make installation optional for targets that are not built by default in this config
if(QT_FEATURE_debug_and_release

View File

@ -11,7 +11,14 @@ function(_qt_internal_validate_no_unity_build prefix)
endfunction()
function(qt_update_ignore_unity_build_sources target sources)
if (sources)
set_source_files_properties(${sources} PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
if(sources)
# We need to add the TARGET_DIRECTORY scope for targets that have qt_internal_extend_target
# calls in different subdirectories, like in qtgraphs.
set(scope_args)
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.18")
set(scope_args TARGET_DIRECTORY ${target})
endif()
set_source_files_properties(${sources} ${scope_args}
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
endif()
endfunction()

View File

@ -224,11 +224,12 @@ function(qt_internal_create_wrapper_scripts)
qt_install(FILES "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/${__qt_cmake_install_script_name}"
DESTINATION "${INSTALL_LIBEXECDIR}")
qt_internal_create_qt_configure_tests_wrapper_script()
qt_internal_create_qt_configure_part_wrapper_script("STANDALONE_TESTS")
qt_internal_create_qt_configure_part_wrapper_script("STANDALONE_EXAMPLES")
qt_internal_create_qt_configure_redo_script()
endfunction()
function(qt_internal_create_qt_configure_tests_wrapper_script)
function(qt_internal_create_qt_configure_part_wrapper_script component)
if(QT_GENERATE_WRAPPER_SCRIPTS_FOR_ALL_HOSTS)
set(generate_unix TRUE)
set(generate_non_unix TRUE)
@ -238,17 +239,27 @@ function(qt_internal_create_qt_configure_tests_wrapper_script)
set(generate_non_unix TRUE)
endif()
# Create a private wrapper script to configure and build all standalone tests.
# Create a private wrapper script to configure and build all standalone tests / examples.
#
# The script uses qt-cmake instead of qt-cmake-private on purpose. That's to ensure we build
# only one configuration of tests (e.g RelWithDebInfo only) when Qt is configured with more
# than one configuration (RelWithDebInfo;Debug).
# Meant to be used by our CI instructions.
#
# The script takes a path to the repo for which the standalone tests will be configured.
set(script_name "qt-internal-configure-tests")
# The script takes a path to the repo for which the standalone tests / examples will be
# configured.
set(script_passed_args "-DQT_BUILD_STANDALONE_TESTS=ON -DQT_USE_ORIGINAL_COMPILER=ON")
if(component STREQUAL "STANDALONE_TESTS")
set(script_name "qt-internal-configure-tests")
set(script_passed_args "-DQT_BUILD_STANDALONE_TESTS=ON -DQT_BUILD_EXAMPLES=OFF")
elseif(component STREQUAL "STANDALONE_EXAMPLES")
set(script_name "qt-internal-configure-examples")
set(script_passed_args "-DQT_BUILD_STANDALONE_EXAMPLES=ON -DQT_BUILD_TESTS=OFF")
else()
message(FATAL_ERROR "Invalid component type: ${component}")
endif()
string(APPEND script_passed_args " -DQT_USE_ORIGINAL_COMPILER=ON")
file(RELATIVE_PATH relative_path_from_libexec_dir_to_bin_dir
${__qt_libexec_dir_absolute}

View File

@ -8,6 +8,7 @@ The following table describes the mapping of configure options to CMake argument
| -extprefix /opt/qt6 | -DCMAKE_STAGING_PREFIX=/opt/qt6 | |
| -bindir <dir> | -DINSTALL_BINDIR=<dir> | similar for -headerdir -libdir and so on |
| -hostdatadir <dir> | -DINSTALL_MKSPECSDIR=<dir> | |
| -qt-host-path <dir> | -DQT_HOST_PATH=<dir> | |
| -help | n/a | Handled by configure[.bat]. |
| -verbose | --log-level=STATUS | Sets the CMake log level to STATUS. The default one is NOTICE. |
| -continue | | |
@ -93,6 +94,8 @@ The following table describes the mapping of configure options to CMake argument
| -android-javac-source | -DQT_ANDROID_JAVAC_SOURCE=7 | Set the javac build source version. |
| -android-javac-target | -DQT_ANDROID_JAVAC_TARGET=7 | Set the javac build target version. |
| -skip <repo>,...,<repo_n> | -DBUILD_<repo>=OFF | |
| -skip-tests <repo>,...,<repo_n> | -DQT_BUILD_TESTS_PROJECT_<repo>=OFF | |
| -skip-examples <repo>,...,<repo_n> | -DQT_BUILD_EXAMPLES_PROJECT_<repo>=OFF | |
| -submodules <repo>,...,<repo_n> | -DQT_BUILD_SUBMODULES=<repo>;...;<repo> | |
| -make <part> | -DQT_BUILD_TESTS=ON | A way to turn on tools explicitly is missing. If tests/examples |
| | -DQT_BUILD_EXAMPLES=ON | are enabled, you can disable their building as part of the |
@ -160,8 +163,8 @@ The following table describes the mapping of configure options to CMake argument
| -xkbcommon | -DFEATURE_xkbcommon=ON | |
| -gif | -DFEATURE_gif=ON | |
| -ico | -DFEATURE_ico=ON | |
| -libpng | -DFEATURE_libpng=ON | |
| -libjpeg | -DFEATURE_libjpeg=ON | |
| -libpng | -DFEATURE_png=ON | |
| -libjpeg | -DFEATURE_jpeg=ON | |
| -sql-<driver> | -DFEATURE_sql_<driver>=ON | |
| -sqlite [qt/system] | -DFEATURE_system_sqlite=OFF/ON | |
| -disable-deprecated-up-to <hex_version> | -DQT_DISABLE_DEPRECATED_UP_TO=<hex_version> | |

View File

@ -1,5 +1,5 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QList>
#include <QString>

View File

@ -0,0 +1,26 @@
type: Group
instructions:
- type: ChangeDirectory
directory: "{{.BuildDir}}"
- type: ExecuteCommand
command: "{{.Env.EXAMPLES_ENV_PREFIX}} {{.Env.INSTALL_DIR_FOR_EXAMPLES}}\\bin\\qt-internal-configure-examples {{.Env.COIN_CMAKE_ARGS}}"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 1200
userMessageOnFailure: >
Failed to call configure examples.
enable_if:
condition: property
property: host.os
equals_value: Windows
- type: ExecuteCommand
command: "{{.Env.EXAMPLES_ENV_PREFIX}} {{.Env.INSTALL_DIR_FOR_EXAMPLES}}/libexec/qt-internal-configure-examples {{.Env.COIN_CMAKE_ARGS}}"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 1200
userMessageOnFailure: >
Failed to call configure examples.
disable_if:
condition: property
property: host.os
equals_value: Windows

View File

@ -0,0 +1,32 @@
type: Group
instructions:
- type: ChangeDirectory
directory: "{{.SourceDir}}"
- type: MakeDirectory
directory: "{{.SourceDir}}_standalone_examples"
- type: SetBuildDirectory
directory: "{{.SourceDir}}_standalone_examples"
- type: ChangeDirectory
directory: "{{.BuildDir}}"
- type: AppendToEnvironmentVariable
variableName: COIN_CMAKE_ARGS
variableValue: " -S {{.SourceDir}} -B ."
disable_if:
condition: runtime
env_var: COIN_CMAKE_ARGS
equals_value: null
- type: EnvironmentVariable
variableName: COIN_CMAKE_ARGS
variableValue: "-S {{.SourceDir}} -B ."
enable_if:
condition: runtime
env_var: COIN_CMAKE_ARGS
equals_value: null
- !include "{{qt/qtbase}}/call_cmake_for_standalone_examples.yaml"
- type: ExecuteCommand
command: "{{.Env.EXAMPLES_ENV_PREFIX}} cmake --build . --parallel -v"
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 4800
userMessageOnFailure: >
Failed to build examples.

View File

@ -0,0 +1,16 @@
type: Group
instructions:
- type: EnvironmentVariable
variableName: EXAMPLES_ENV_PREFIX
variableValue: "{{.Env.ENV_PREFIX}}"
- type: EnvironmentVariable
variableName: INSTALL_DIR_FOR_EXAMPLES
variableValue: "{{.InstallDir}}"
- type: EnvironmentVariable
variableName: COIN_CMAKE_ARGS
variableValue: "{{.Env.COMMON_EXAMPLES_CMAKE_ARGS}}"
- !include "{{qt/qtbase}}/cmake_build_standalone_examples.yaml"
enable_if:
condition: property
property: features
contains_value: StandaloneExamples

View File

@ -0,0 +1,30 @@
type: Group
instructions:
- type: EnvironmentVariable
variableName: EXAMPLES_ENV_PREFIX
variableValue: "{{.Env.TARGET_ENV_PREFIX}}"
- type: EnvironmentVariable
variableName: INSTALL_DIR_FOR_EXAMPLES
variableValue: "{{.InstallDir}}\\target"
enable_if:
condition: property
property: host.os
equals_value: Windows
- type: EnvironmentVariable
variableName: INSTALL_DIR_FOR_EXAMPLES
variableValue: "{{.InstallDir}}/target"
# TODO: Might need android multi-abi support whenever we decide to build examples for that
# config. See 7b9bb698b93e747e02bf6ab8310c439867318f8e in qtbase and how the instructions
# were modified for multi-abi android tests.
disable_if:
condition: property
property: host.os
equals_value: Windows
- type: EnvironmentVariable
variableName: COIN_CMAKE_ARGS
variableValue: "{{.Env.COMMON_TARGET_EXAMPLES_CMAKE_ARGS}}"
- !include "{{qt/qtbase}}/cmake_build_standalone_examples.yaml"
enable_if:
condition: property
property: features
contains_value: StandaloneExamples

View File

@ -174,5 +174,6 @@ instructions:
- type: EnvironmentVariable
variableName: COIN_CONFIG_TYPE
variableValue: "Target"
- !include "{{qt/qtbase}}/cmake_build_standalone_examples_target.yaml"
- !include "{{qt/qtbase}}/qmake/get_qmake_location_target.yaml"
- !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_instructions.yaml"

View File

@ -175,5 +175,6 @@ instructions:
- type: EnvironmentVariable
variableName: COIN_CONFIG_TYPE
variableValue: "Target"
- !include "{{qt/qtbase}}/cmake_build_standalone_examples_target.yaml"
- !include "{{qt/qtbase}}/qmake/get_qmake_location_target.yaml"
- !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_instructions.yaml"

View File

@ -84,6 +84,9 @@ instructions:
- condition: property
property: features
contains_value: Packaging
- condition: property
property: host.arch
equals_value: X86_64 # Sign only on X86 until Coin has support for arm signing
directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
@ -95,5 +98,6 @@ instructions:
- type: EnvironmentVariable
variableName: COIN_CONFIG_TYPE
variableValue: "Host"
- !include "{{qt/qtbase}}/cmake_build_standalone_examples_host.yaml"
- !include "{{qt/qtbase}}/qmake/get_qmake_location_host.yaml"
- !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_instructions.yaml"

View File

@ -81,6 +81,9 @@ instructions:
- condition: property
property: features
contains_value: Packaging
- condition: property
property: host.arch
equals_value: X86_64 # Sign only on X86 until Coin has support for arm signing
directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}"
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
@ -92,5 +95,6 @@ instructions:
- type: EnvironmentVariable
variableName: COIN_CONFIG_TYPE
variableValue: "Host"
- !include "{{qt/qtbase}}/cmake_build_standalone_examples_host.yaml"
- !include "{{qt/qtbase}}/qmake/get_qmake_location_host.yaml"
- !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_instructions.yaml"

View File

@ -52,19 +52,22 @@ instructions:
property: host.os
equals_value: Windows
# Keep the testrun quiet for ASAN testruns, since there are FAILs happening all over the place...
- type: EnvironmentVariable
variableName: CTEST_ARGS
variableValue: "-V"
# Keep the testrun quiet for ASAN testruns, since there are FAILs happening all over the place
disable_if:
condition: property
property: features
contains_value: UseAddressSanitizer
# Always print the output from a failing test, even when ctest is not in verbose mode
# ...and only print the output from a failing test, i.e. test with ASAN errors.
- type: EnvironmentVariable
variableName: CTEST_OUTPUT_ON_FAILURE
variableValue: "1"
enable_if:
condition: property
property: features
contains_value: UseAddressSanitizer
- type: AppendToEnvironmentVariable
variableName: CTEST_ARGS
@ -85,21 +88,6 @@ instructions:
- !include "{{qt/qtbase}}/coin_module_test_android_start_emulator.yaml"
- type: EnvironmentVariable
variableName: COIN_COMMAND_OUTPUT_TIMEOUT
variableValue: "900"
disable_if:
condition: property
property: features
contains_value: UseAddressSanitizer
- type: EnvironmentVariable
variableName: COIN_COMMAND_OUTPUT_TIMEOUT
variableValue: "10800"
enable_if:
condition: property
property: features
contains_value: UseAddressSanitizer
- type: ExecuteCommand
command: "{{.Env.TESTS_ENV_PREFIX}} ctest {{.Env.CTEST_ARGS}}"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution

View File

@ -104,7 +104,7 @@ instructions:
- type: ExecuteCommand
command: ["sbuild",
"--build-dep-resolver=apt",
"-sAd", "tqtc-focal",
"-sAd", "{{.Env.COIN_TARGET_DIST}}",
"-c", "{{.Env.COIN_SBUILD_CHROOT}}",
"--build-dir", "output/debian_packages",
"--extra-repository={{.Env.COIN_EXTRA_DEBIAN_REPO}}",

View File

@ -4,6 +4,13 @@ enable_if:
property: features
contains_value: DebianPackaging
instructions:
- type: EnvironmentVariable
variableName: COIN_TARGET_DIST
variableValue: "tqtc-focal"
enable_if:
condition: runtime
env_var: COIN_TARGET_DIST
equals_value: null
- type: EnvironmentVariable
variableName: COIN_SBUILD_CHROOT
variableValue: "stable-arm64-sbuild"
@ -47,20 +54,10 @@ instructions:
variableName: COIN_SKIP_DEBIAN
variableValue: "MISSING_DEBIAN_INST"
enable_if:
condition: or
conditions:
- condition: runtime
env_var: TESTED_MODULE_COIN
equals_value: "qtactiveqt"
- condition: runtime
env_var: TESTED_MODULE_COIN
equals_value: "qtqa"
- condition: runtime
env_var: TESTED_MODULE_COIN
equals_value: "qtdoc"
- condition: runtime
env_var: TESTED_MODULE_COIN
equals_value: "qt5"
condition: runtime
env_var: COIN_SKIP_DEBIAN_MODULES
contains_value: "{{.Env.TESTED_MODULE_COIN}}"
# Set version info to environment
- type: ParseEnvironmentVariableFromFile
regex: "QT_REPO_MODULE_VERSION \"(?P<QT_REPO_MODULE_VERSION>.*)\""

View File

@ -133,9 +133,26 @@ instructions:
variableName: TARGET_ARCHITECTURE
variableValue: x64_arm64
enable_if:
condition: property
property: target.arch
equals_value: ARM64
condition: and
conditions:
- condition: property
property: target.arch
equals_value: ARM64
- condition: property
property: host.arch
equals_value: X86_64
- type: EnvironmentVariable
variableName: TARGET_ARCHITECTURE
variableValue: arm64
enable_if:
condition: and
conditions:
- condition: property
property: target.arch
in_values: ["AARCH64", "ARM64"]
- condition: property
property: host
equals_property: target
- type: EnvironmentVariable
# HACK. Overwrite TARGET_ARCHITECTURE as we do not use standard MSVC cross
# compilation targets here. The target architecture will be detected by Qt.
@ -467,6 +484,9 @@ instructions:
- type: AppendToEnvironmentVariable
variableName: COMMON_TEST_CMAKE_ARGS
variableValue: " -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_MESSAGE_LOG_LEVEL=STATUS"
- type: AppendToEnvironmentVariable
variableName: COMMON_EXAMPLES_CMAKE_ARGS
variableValue: " -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_MESSAGE_LOG_LEVEL=STATUS"
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_CMAKE_ARGS
@ -477,6 +497,9 @@ instructions:
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_TEST_CMAKE_ARGS
variableValue: " -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_MESSAGE_LOG_LEVEL=STATUS"
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_EXAMPLES_CMAKE_ARGS
variableValue: " -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_MESSAGE_LOG_LEVEL=STATUS"
# Sccache
- type: Group
@ -490,6 +513,9 @@ instructions:
- type: AppendToEnvironmentVariable
variableName: COMMON_TEST_CMAKE_ARGS
variableValue: " -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
- type: AppendToEnvironmentVariable
variableName: COMMON_EXAMPLES_CMAKE_ARGS
variableValue: " -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_CMAKE_ARGS
@ -500,6 +526,9 @@ instructions:
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_TEST_CMAKE_ARGS
variableValue: " -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_EXAMPLES_CMAKE_ARGS
variableValue: " -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
enable_if:
condition: property
property: features
@ -507,6 +536,8 @@ instructions:
# Specify a custom examples installation directory, so that the built example binaries are not
# packaged into the artifact archive together with the Qt libraries.
# Also specify that during examples deployment, only a subset of examples should be deployed, to
# save time and space.
- type: Group
instructions:
- type: AppendToEnvironmentVariable
@ -515,6 +546,24 @@ instructions:
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_CMAKE_ARGS
variableValue: " -DQT_INTERNAL_EXAMPLES_INSTALL_PREFIX={{unixPathSeparators .BuildDir}}/installed_examples"
- type: AppendToEnvironmentVariable
variableName: COMMON_CMAKE_ARGS
variableValue: " -DQT_DEPLOY_MINIMAL_EXAMPLES=ON"
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_CMAKE_ARGS
variableValue: " -DQT_DEPLOY_MINIMAL_EXAMPLES=ON"
- type: Group
instructions:
- type: AppendToEnvironmentVariable
variableName: COMMON_CMAKE_ARGS
variableValue: " -DQT_INTERNAL_CI_NO_BUILD_IN_TREE_EXAMPLES=ON"
- type: AppendToEnvironmentVariable
variableName: COMMON_TARGET_CMAKE_ARGS
variableValue: " -DQT_INTERNAL_CI_NO_BUILD_IN_TREE_EXAMPLES=ON"
enable_if:
condition: property
property: features
contains_value: StandaloneExamples
enable_if:
# Only set the custom installation dir if examples are built.
condition: or
@ -608,3 +657,18 @@ instructions:
condition: property
property: host.os
equals_value: Windows
- type: EnvironmentVariable
variableName: COIN_COMMAND_OUTPUT_TIMEOUT
variableValue: "900"
disable_if:
condition: property
property: features
contains_value: UseAddressSanitizer
- type: EnvironmentVariable
variableName: COIN_COMMAND_OUTPUT_TIMEOUT
variableValue: "10800"
enable_if:
condition: property
property: features
contains_value: UseAddressSanitizer

View File

@ -1,6 +1,6 @@
// Copyright (C) 2016 The Qt Company Ltd.
// Copyright (C) 2016 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// SPDX-License-Identifier: BSD-3-Clause
#define QGLOBAL_H
#include "../../src/corelib/global/archdetect.cpp"

View File

@ -1,4 +1,4 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
// SPDX-License-Identifier: BSD-3-Clause
int libfunc() { return 0; }

View File

@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// SPDX-License-Identifier: BSD-3-Clause
#ifndef HEADER_H
#define HEADER_H

View File

@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// SPDX-License-Identifier: BSD-3-Clause
#ifndef HEADER_H
# error no go
#endif

View File

@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
// SPDX-License-Identifier: BSD-3-Clause
void staticLibFunc1();

View File

@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
// SPDX-License-Identifier: BSD-3-Clause
void staticLibFunc2();

View File

@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
// SPDX-License-Identifier: BSD-3-Clause
void objLibFunc();

View File

@ -1,5 +1,5 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
// SPDX-License-Identifier: BSD-3-Clause
void staticLibFunc2() {
}

View File

@ -1,5 +1,5 @@
// Copyright (C) 2017 Intel Corporation.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// SPDX-License-Identifier: BSD-3-Clause
// All of our supported compilers support <immintrin.h>
#include <immintrin.h>

Some files were not shown because too many files have changed in this diff Show More