Compare commits

...

965 Commits
dev ... 6.7.0

Author SHA1 Message Date
Wladimir Leuschner
98602c26fc QWindows11Style: Add offset for decoration in QComboBoxPrivateContainer
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>
(cherry picked from commit 382505e22f9037a13f793786c2b12c3f68bc2724)
2024-03-22 08:06:27 +00:00
Tor Arne Vestbø
169a2f212d 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
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>
(cherry picked from commit 8ee25c66d934850eba4167246cdab2310704c45d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-20 08:11:51 +00:00
Edward Welbourne
63d6012b03 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.

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>
(cherry picked from commit 28911a81d4bc109c740919c3c952ef9096946d4d)
2024-03-19 05:13:38 +00:00
Piotr Wierciński
dbda7d2f8b wasm: Dont access QNetworkReply header data through dangling pointer
Fixes: QTBUG-122893
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>
(cherry picked from commit 9a59f6bc574e3b9dfa09ac33e6dd951f105f87bb)
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2024-03-18 09:31:42 +00:00
Christian Ehrlicher
9888d8ee22 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>
(cherry picked from commit 9478e25284ccd04208c384d026ee3740ddcd82fd)
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2024-03-17 12:04:50 +00:00
Mårten Nordheim
d86a93ba21 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>
(cherry picked from commit 58991ca2ae2b92a96760fb781360caebc6c6fdc8)
2024-03-17 07:55:03 +00:00
Paul Olav Tvete
b45d7cc24c Revert "QTextEngine: Protect against integer overflow with huge texts"
This change introduced a regression for the case where the string is
just a little bit too large.

This reverts commit 79ac8b110ae998ad2545238536cb254197540b57.

Task-number: QTBUG-123339
Change-Id: I7b629450d88421201919d82a433d973f76328509
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2024-03-15 12:36:52 +01:00
Timothée Keller
cfcfe7d07b 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>
2024-03-15 06:10:22 +00:00
Eirik Aavitsland
9d791aabad Update bundled libpng to version 1.6.43
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.43

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>
(cherry picked from commit e1f069e65de96906438f5bec75708bec93d2bee5)
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-03-15 06:10:03 +00:00
Thiago Macieira
0df3ff3d70 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.

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>
(cherry picked from commit a2d67a2671f8b2ab96d4b458d80972c2bd83b3db)
2024-03-14 07:24:47 +00:00
Assam Boudjelthia
9057431efb 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
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>
(cherry picked from commit 2ba01c7ace47c7b8f4b9e1baf8e4b5e2eeb87703)
2024-03-14 07:24:43 +00:00
Marc Mutz
c7cddc92ff 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.

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>
(cherry picked from commit d9da7c9362363e32d732370d5f340119d6fe9dd5)
2024-03-14 07:24:38 +00:00
Cristian Adam
494aa93334 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
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>
(cherry picked from commit 1fb2c58ef381101f2219af7f874f4007b163e90d)
2024-03-13 08:28:26 +00:00
Lucie Gérard
e12a87c233 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
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>
(cherry picked from commit d289d35183fc900f6c5b34813d9c9b9a03caae27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 08:28:19 +00:00
Lucie Gérard
1fd0dcfd8e 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

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>
(cherry picked from commit d6414a02e95b589639b45925bc9363e65ee8a683)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-13 08:28:12 +00:00
Juha Vuolle
d87d4eb6b1 Bump Android platform version in documentation to 34
The supported level since Qt 6.7 is 34

Fixes: QTBUG-123059
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>
(cherry picked from commit 032e127ad5185568144e4b54bb21aaf5d17e7bd9)
2024-03-13 08:28:04 +00:00
Cristian Adam
f32abfdc78 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
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>
(cherry picked from commit 76c6b71db41962005854fac57b09ca0907e2ed96)
2024-03-13 08:27:57 +00:00
Thiago Macieira
b444ae3996 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
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>
(cherry picked from commit 2b13207c2e408a6552b2486a1c90ad1d29e4c4b9)
2024-03-13 05:30:30 +00:00
Ivan Solovev
026aecf47c QCborStreamReader: rename toStringish() -> readAllStringish()
Amends 8af346c1f66f813c3c8fe4d8b892ecfbe96eacfb and
1d9137e13f9eb3f183c967e9e911c5b260f93dc0.

Found in 6.7 API review

Task-number: QTBUG-123115
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>
(cherry picked from commit 287cff7169bbf164d93506a8374f0d15818b894b)
2024-03-13 05:30:13 +00:00
Ivan Solovev
c9556213ac QCborStreamReader: rename appendToType() -> readAndAppendToType()
Amends ff034ebbfa7c1cc47cdcc15bc854972cd960db1a.

Found in 6.7 API review

Task-number: QTBUG-123115
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>
(cherry picked from commit 2d101abed49cb99f8d7b36137ab8d3600b75bd12)
2024-03-13 05:30:09 +00:00
Wladimir Leuschner
a1e3d310ed QWindows11Style: Draw ScrollArea opaque in QAbstractItemView
Change-Id: Ica2c62355a576dda4eaefacbc41b8609009d0073
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-03-07 19:40:20 +00:00
Wladimir Leuschner
d11d503850 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)
2024-03-07 15:53:40 +00:00
Tinja Paavoseppä
1e96139cf2 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: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-03-07 12:39:37 +00:00
Tinja Paavoseppä
0533f7c075 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: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-03-07 12:39:23 +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
3080 changed files with 68328 additions and 41972 deletions

View File

@ -10,8 +10,7 @@ endif()
set(QT_REPO_MODULE_VERSION "6.7.0")
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

@ -203,15 +203,8 @@ 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_impl_tests()
qt_build_repo_end()
if(NOT QT_BUILD_STANDALONE_TESTS AND QT_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
qt_build_repo_impl_examples()

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

@ -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

@ -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

@ -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

@ -73,7 +73,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}")

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

@ -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,129 @@
# 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 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_BUILD_STANDALONE_TESTS 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 +138,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()

View File

@ -205,6 +205,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 +239,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

@ -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)
@ -333,7 +333,7 @@ macro(qt_build_repo_end)
endif()
endif()
qt_build_internals_add_toplevel_targets()
qt_build_internals_add_toplevel_targets(${qt_repo_targets_name})
if(NOT QT_SUPERBUILD)
qt_print_build_instructions()
@ -428,9 +428,13 @@ 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)
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()
@ -440,7 +444,11 @@ macro(qt_build_repo_impl_examples)
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/examples/CMakeLists.txt"
AND NOT QT_BUILD_STANDALONE_TESTS)
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()

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

@ -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
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

@ -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

@ -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

@ -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

@ -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

@ -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,3 +1,6 @@
# 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)

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

@ -211,6 +211,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}")

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

@ -477,8 +477,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 +556,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 +579,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 +716,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"
@ -842,8 +842,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

@ -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)
@ -117,6 +120,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

@ -59,8 +59,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

@ -189,7 +189,7 @@ function(__qt_internal_walk_libs
# 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)
if(TARGET "${namespaceless_lib_target}")
set(lib_target ${namespaceless_lib_target})
endif()
endif()

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()
@ -808,9 +811,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()
@ -853,7 +855,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 +870,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 +881,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 +930,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 +946,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 +968,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

@ -606,12 +606,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 +637,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 +737,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 +863,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

@ -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

@ -93,6 +93,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 +162,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

@ -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.
@ -608,3 +625,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>

View File

@ -1,5 +1,5 @@
// Copyright (C) 2022 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
#include <immintrin.h>

View File

@ -196,6 +196,12 @@ Component selection:
-skip <repo>[,<repo>] Exclude one or more entire repositories from the
build. The list should be separated with commas.
e.g. -skip qtimageformats,qtsvg
-skip-tests <repo>[,<repo>] ... Skip building tests for one or more
repositories. The list should be separated with commas.
e.g. -skip-tests qtimageformats,qtsvg
-skip-examples <repo>[,<repo>] ... Skip building examples for one or more
repositories. The list should be separated with commas.
e.g. -skip-examples qtimageformats,qtsvg
-make <part> ......... Add <part> to the list of parts to be built.
Specifying this option clears the default list first.
(allowed values: libs, tools, examples, tests,

2
configure vendored
View File

@ -1,7 +1,7 @@
#!/bin/sh
# Copyright (C) 2016 The Qt Company Ltd.
# Copyright (C) 2016 Intel Corporation.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
# SPDX-License-Identifier: BSD-3-Clause
#-------------------------------------------------------------------------------
# script initialization

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 GPL-3.0-only WITH Qt-GPL-exception-1.0
:: SPDX-License-Identifier: BSD-3-Clause
@echo off
setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
@ -83,7 +83,12 @@ set REDO_FILE_PATH=%TOPQTDIR%\config.redo.last
set REDO_TMP_FILE_PATH=%TOPQTDIR%\config.redo.in
set FRESH_REQUESTED_ARG=
if not defined redoing (
echo.%*>"%OPT_TMP_FILE_PATH%"
:: The '.' in 'echo.%*' ensures we don't print "echo is off" when no arguments are passed
:: https://devblogs.microsoft.com/oldnewthing/20170802-00/?p=96735
:: The space before the '>' makes sure that when we have a digit at the end of the args, we
:: don't accidentally concatenate it with the '>' resulting in '0>' or '2>' which redirects
:: into the file from a stream different than stdout, leading to broken or empty content.
echo.%* >"%OPT_TMP_FILE_PATH%"
cmake -DIN_FILE="%OPT_TMP_FILE_PATH%" -DOUT_FILE="%OPT_FILE_PATH%" -DIGNORE_ARGS=-top-level -P "%QTSRC%\cmake\QtWriteArgsFile.cmake"
) else (

View File

@ -18,6 +18,10 @@ if(TARGET ZLIB::ZLIB)
set_property(TARGET ZLIB::ZLIB PROPERTY IMPORTED_GLOBAL TRUE)
endif()
# Look for Threads in the same scope as OpenSSL package, because OpenSSL sometimes depends on
# Threads (for static OpenSSL builds) and we want to promote the target to global in the same
# directory scope.
qt_find_package(Threads PROVIDED_TARGETS Threads::Threads)
qt_find_package(WrapOpenSSLHeaders PROVIDED_TARGETS WrapOpenSSLHeaders::WrapOpenSSLHeaders MODULE_NAME core)
# openssl_headers
# OPENSSL_VERSION_MAJOR is not defined for OpenSSL 1.1.1
@ -628,13 +632,9 @@ qt_feature_config("c++2a" QMAKE_PUBLIC_QT_CONFIG)
qt_feature("c++2b" PUBLIC
LABEL "C++2b"
AUTODETECT OFF
)
qt_feature_config("c++2b" QMAKE_PUBLIC_QT_CONFIG)
qt_feature("c++2b" PUBLIC
LABEL "C++2b"
AUTODETECT FALSE
CONDITION QT_FEATURE_cxx20 AND (CMAKE_VERSION VERSION_GREATER_EQUAL "3.20") AND TEST_cxx2b
)
qt_feature_config("c++2b" QMAKE_PUBLIC_QT_CONFIG)
qt_feature("precompile_header"
LABEL "Using precompiled headers"
CONDITION BUILD_WITH_PCH AND TEST_precompile_header
@ -965,16 +965,24 @@ qt_feature_config("gui" QMAKE_PUBLIC_QT_CONFIG
NEGATE)
qt_feature("network" PRIVATE
LABEL "Qt Network"
SECTION "Module"
PURPOSE "Provides the Qt Network module."
)
qt_feature("printsupport" PRIVATE
LABEL "Qt PrintSupport"
CONDITION QT_FEATURE_widgets
SECTION "Module"
PURPOSE "Provides the Qt PrintSupport module."
)
qt_feature("sql" PRIVATE
LABEL "Qt Sql"
SECTION "Module"
PURPOSE "Provides the Sql module."
)
qt_feature("testlib" PRIVATE
LABEL "Qt Testlib"
SECTION "Module"
PURPOSE "Provides the Qt Testlib module."
)
qt_feature("widgets" PRIVATE
LABEL "Qt Widgets"
@ -986,6 +994,8 @@ qt_feature_config("widgets" QMAKE_PUBLIC_QT_CONFIG
NEGATE)
qt_feature("xml" PRIVATE
LABEL "Qt Xml"
SECTION "Module"
PURPOSE "Provides the Qt Xml module."
)
qt_feature("libudev" PRIVATE
LABEL "udev"
@ -1254,16 +1264,17 @@ https://github.com/llvm/llvm-project/issues/53520
]=]
)
else()
string(CONCAT error_message
"x86 intrinsics support missing. Check your compiler settings.\n"
"If this is an error, report at https://bugreports.qt.io with your compiler ID and "
"version, and this output:\n"
"\n"
"${TEST_x86intrin_OUTPUT}"
)
qt_configure_add_report_entry(
TYPE ERROR
CONDITION (NOT QT_FEATURE_x86intrin)
MESSAGE [========[
x86 intrinsics support missing. Check your compiler settings. If this is an
error, report at https://bugreports.qt.io with your compiler ID and version,
and this output:
${TEST_x86intrin_OUTPUT}
]========]
MESSAGE "${error_message}"
)
endif()
endif()
@ -1290,8 +1301,7 @@ qt_extra_definition("QT_VERSION_MAJOR" ${PROJECT_VERSION_MAJOR} PUBLIC)
qt_extra_definition("QT_VERSION_MINOR" ${PROJECT_VERSION_MINOR} PUBLIC)
qt_extra_definition("QT_VERSION_PATCH" ${PROJECT_VERSION_PATCH} PUBLIC)
qt_extra_definition("QT_COPYRIGHT" \"${QT_COPYRIGHT}\" PRIVATE)
qt_extra_definition("QT_COPYRIGHT_YEAR" \"${QT_COPYRIGHT_YEAR}\" PRIVATE)
qt_extra_definition("QT_COPYRIGHT" \"${QT_COPYRIGHT}\" PUBLIC)
qt_configure_add_report_entry(
TYPE WARNING

View File

@ -7,7 +7,7 @@
qt_path_join(doc_install_dir ${QT_INSTALL_DIR} ${INSTALL_DOCDIR})
foreach(dir global config)
qt_copy_or_install(DIRECTORY ${dir} DESTINATION ${doc_install_dir})
if(QT_SUPERBUILD)
if(QT_SUPERBUILD OR "${PROJECT_NAME}" STREQUAL "QtBase")
qt_path_join(destination ${QtBase_BINARY_DIR} ${INSTALL_DOCDIR})
file(COPY ${dir} DESTINATION ${destination})
endif()

View File

@ -3,7 +3,7 @@
dita.metadata.default.author = Qt Project
dita.metadata.default.permissions = all
dita.metadata.default.publisher = Qt Project
dita.metadata.default.copyryear = 2023
dita.metadata.default.copyryear = 2024
dita.metadata.default.copyrholder = The Qt Company Ltd
dita.metadata.default.audience = programmer

View File

@ -116,6 +116,11 @@
\title CMake target_link_libraries Documentation
*/
/*!
\externalpage https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html
\title CMake BUILD_SHARED_LIBS Documentation
*/
/*!
\externalpage https://conan.io/
\title Conan
@ -566,3 +571,8 @@
\externalpage https://www.qt.io/product/quality-assurance/test-center
\title Test Center
*/
/*!
\externalpage https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html
\title FreeDesktop.org Trash specification version 1.0
*/

View File

@ -78,7 +78,7 @@ HTML.footer += \
" <ul id=\"menu-footer-submenu\" class=\"right clearfix\"><li id=\"menu-item-1795\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1795\"><a title=\"Sign into your account.\" href=\"https://account.qt.io/login\">Sign In</a></li>\n" \
" <li id=\"menu-item-10375\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-10375\"><a href=\"mailto:feedback@theqtcompany.com?Subject=Feedback%20about%20doc.qt.io%20site\">Feedback</a></li>\n" \
" <li id=\"menu-item-1494\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1494\"><a href=\"http://qt.io/contact-us/\">Contact us</a></li>\n" \
" <li id=\"menu-item-4472\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-4472\"><a href=\"http://qt.io/about-us/\">© 2023 The Qt Company</a></li>\n" \
" <li id=\"menu-item-4472\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-4472\"><a href=\"http://qt.io/about-us/\">© 2024 The Qt Company</a></li>\n" \
" </ul>\n" \
"</div>\n" \
"</div>\n" \

View File

@ -8,13 +8,13 @@ HTML.footer = \
"</div>\n" \
"<div class=\"footer\">\n" \
" <p>\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2023 The Qt Company Ltd.\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2024 <span translate=\"no\">The Qt Company Ltd.</span>\n" \
" Documentation contributions included herein are the copyrights of\n" \
" their respective owners.<br/>" \
" The documentation provided herein is licensed under the terms of the" \
" <a href=\"http://www.gnu.org/licenses/fdl.html\">GNU Free Documentation" \
" License version 1.3</a> as published by the Free Software Foundation.<br/>" \
" Qt and respective logos are <a href=\"https://doc.qt.io/qt/trademarks.html\">" \
" trademarks</a> of The Qt Company Ltd. in Finland and/or other countries\n" \
" License version 1.3</a> as published by the <span translate=\"no\">Free Software Foundation</span>.<br/>" \
" <span translate=\"no\">Qt</span> and respective logos are <a href=\"https://doc.qt.io/qt/trademarks.html\">" \
" trademarks</a> of <span translate=\"no\">The Qt Company Ltd.</span> in Finland and/or other countries\n" \
" worldwide. All other trademarks are property of their respective owners. </p>\n" \
"</div>\n" \

View File

@ -70,6 +70,25 @@ macro.QUL = "Qt Quick Ultralite"
macro.QtAA = "Qt for Android Automotive"
macro.QOI = "Qt Online Installer"
macro.QMT = "Qt Maintenance Tool"
macro.QMLLS = "QML Language Server"
macro.QtTAS = "Qt Tools for Android Studio"
# The following macros are used for various Android docs. The purpose is to keep
# it as simple as updating these instead of updating multiple lines in scattered locations.
macro.AndroidAbis = "\\c{arm64-v8}, \\c{x86_64}, \\c{x86}, and \\c{armeabi-v7a}"
macro.NdkVer = "r26b"
macro.NdkFullVer = "26.1.10909125"
macro.NdkCompilerVer = "Clang 17.0.2"
macro.JdkVer = "17"
macro.AndroidMinApiVer = "26"
macro.AndroidMaxApiVer = "34"
macro.AndroidMinVer = "8.0"
macro.AndroidMaxVer = "14"
macro.AndroidPlatformVer = "34"
macro.AndroidBuildToolsVer = "34.0.0"
macro.GradleVer = "8.3"
macro.AGPVer = "7.4.1"
macro.AAOSVer = "10 to 13"
macro.beginfloatleft.HTML = "<div style=\"float: left; margin-right: 2em\">"
macro.beginfloatright.HTML = "<div style=\"float: right; margin-left: 2em\">"

View File

@ -57,8 +57,8 @@ manifestmeta.android.names = "Qt3D/Qt 3D: Basic Shapes C++ Example" \
"QtNFC/Annotated URL Example" \
"QtNFC/QML Poster Example" \
"QtOpenGL/Hello GLES3 Example" \
"QtPositioning/SatelliteInfo (C++/QML)" \
"QtPositioning/Weather Info (C++/QML)" \
"QtPositioning/Satellite Info" \
"QtPositioning/Weather Info" \
"QtPurchasing/Qt Purchasing Examples - QtHangman" \
"QtQML/Extending QML - Attached Properties Example" \
"QtQML/Extending QML - Grouped Properties Example" \
@ -108,7 +108,7 @@ manifestmeta.android.tags = android
manifestmeta.ios.names = "QtCore/Contiguous Cache Example" \
"QtCore/Mandelbrot Example" \
"QtCore/Queued Custom Type Example" \
"QtCore/Queued Custom Type" \
"QtGui/OpenGL Window Example" \
"QtGui/Raster Window Example" \
"QtNetwork/Network Chat Example" \
@ -152,7 +152,6 @@ manifestmeta.ios.names = "QtCore/Contiguous Cache Example" \
"QtWidgets/Border Layout Example" \
"QtWidgets/Flow Layout Example" \
"QtWidgets/Basic Drawing Example" \
"QtWidgets/Concentric Circles Example" \
"QtWidgets/Font Sampler Example" \
"QtWidgets/Gradients" \
"QtWidgets/Image Composition Example" \
@ -201,7 +200,6 @@ manifestmeta.ios.tags = ios
manifestmeta.thumbnail.attributes = "imageUrl:qthelp\://org.qt-project.qtdoc.$QT_VERSION_TAG/qtdoc/images/qt-codesample.png"
manifestmeta.thumbnail.names = "QtCore/Contiguous Cache Example" \
"QtCore/Custom Type Example" \
"QtCore/Saving and Loading a Game" \
"QtCore/Producer and Consumer using Semaphores" \
"QtCore/Producer and Consumer using Wait Conditions" \

View File

@ -5,7 +5,7 @@
HTML.footer = \
" </div>\n" \
" <p class=\"copy-notice\">\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2023 The Qt Company Ltd.\n" \
" <acronym title=\"Copyright\">&copy;</acronym> 2024 The Qt Company Ltd.\n" \
" Documentation contributions included herein are the copyrights of\n" \
" their respective owners. " \
" The documentation provided herein is licensed under the terms of the" \

View File

@ -1,7 +1,7 @@
// Copyright (C) 2022 Giuseppe D'Angelo <dangelog@gmail.com>.
// Copyright (C) 2022 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
//! [0]
QString p("a .*|pattern");

View File

@ -574,7 +574,6 @@ ol.I > li {
.qmlextra {
padding-left: 5px;
float: right;
color: #254117;
}
.rightAlign {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -1,5 +1,5 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
//! [0]
myApplication -qws -display svgalib

View File

@ -28,6 +28,7 @@ qt_add_executable(androidnotifier
)
target_link_libraries(androidnotifier PRIVATE
Qt6::CorePrivate
Qt6::Widgets
)

View File

@ -4,12 +4,9 @@
android:installLocation="auto"
android:versionCode="1"
android:versionName="1.0">
<!-- The comment below will be replaced with dependencies permissions upon deployment.
Remove the comment if you do not require these default permissions. -->
<!-- %%INSERT_PERMISSIONS -->
<!-- The comment below will be replaced with dependencies permissions upon deployment.
Remove the comment if you do not require these default features. -->
<!-- %%INSERT_PERMISSIONS -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<!-- %%INSERT_FEATURES -->
<supports-screens
@ -45,10 +42,6 @@
<meta-data
android:name="android.app.background_running"
android:value="false"/>
<meta-data
android:name="android.app.extract_android_style"
android:value="none" />
</activity>
</application>
</manifest>

View File

@ -5,10 +5,22 @@
#include <QtCore/qjniobject.h>
#include <QtCore/qcoreapplication.h>
#include <QtCore/private/qandroidextras_p.h>
using namespace Qt::StringLiterals;
NotificationClient::NotificationClient(QObject *parent)
: QObject(parent)
{
if (QNativeInterface::QAndroidApplication::sdkVersion() >= __ANDROID_API_T__) {
const auto notificationPermission = "android.permission.POST_NOTIFICATIONS"_L1;
auto requestResult = QtAndroidPrivate::requestPermission(notificationPermission);
if (requestResult.result() != QtAndroidPrivate::Authorized) {
qWarning() << "Failed to acquire permission to post notifications "
"(required for Android 13+)";
}
}
connect(this, &NotificationClient::notificationChanged,
this, &NotificationClient::updateAndroidNotification);
}

View File

@ -19,7 +19,7 @@
\image convert.png
\sa {Parsing and displaying CBOR data}, {JSON Save Game}
\sa {Parsing and displaying CBOR data}, {Saving and Loading a Game}
\section1 The Converter Class

View File

@ -18,20 +18,15 @@
\section1 Overview
In the \l{Custom Type Example}, we showed how to integrate custom types with
the meta-object system, enabling them to be stored in QVariant objects, written
out in debugging information and used in signal-slot communication.
In this example, we create a new value class, \c Block, and register it
with the meta-object system to enable us to send instances of it between
threads using queued signals and slots.
In this example, we create a value class, \c Block, and register it with
the meta-object system to enable us to send instances of it between threads
using queued signals and slots.
\section1 The Block Class
The \c Block class is similar to the \c Message class described in the
\l{Custom Type Example}. It provides the default constructor, copy
constructor and destructor in the public section of the class that the
meta-object system requires. It describes a colored rectangle.
The \c Block class provides the default constructor, copy constructor, and
a destructor in the public section of the class as required by the
meta-object system. The class describes a colored rectangle.
\snippet threads/queuedcustomtype/block.h custom type definition and meta-type declaration
@ -127,9 +122,7 @@
This example showed how a custom type can be registered with the
meta-object system so that it can be used with signal-slot connections
between threads. For ordinary communication involving direct signals and
slots, it is enough to simply declare the type in the way described in the
\l{Custom Type Example}.
between threads.
In practice, both the Q_DECLARE_METATYPE() macro and the qRegisterMetaType()
template function can be used to register custom types, but

View File

@ -4,6 +4,7 @@
/*!
\example tools/contiguouscache
\title Contiguous Cache Example
\examplecategory {Data Processing & I/O}
\brief The Contiguous Cache example shows how to use QContiguousCache to manage memory usage for
very large models. In some environments memory is limited and, even when it

View File

@ -93,5 +93,24 @@ void Car::timerEvent(QTimerEvent *event)
setTransform(QTransform().rotate(rotation), true);
setTransform(QTransform::fromTranslate(0, -speed), true);
if (!scene()->views().isEmpty()) {
QRect viewRect = scene()->views().at(0)->sceneRect().toRect();
QTransform fx = transform();
qreal dx = fx.dx();
qreal dy = fx.dy();
while (dx < viewRect.left() - 10)
dx += viewRect.width();
while (dy < viewRect.top() - 10)
dy += viewRect.height();
while (dx > viewRect.right() + 10)
dx -= viewRect.width();
while (dy > viewRect.bottom() + 10)
dy -= viewRect.width();
setTransform(QTransform(fx.m11(), fx.m12(), fx.m13(),
fx.m21(), fx.m22(), fx.m23(),
dx, dy, fx.m33()));
}
update();
}

View File

@ -23,7 +23,7 @@ int main(int argc, char *argv[])
view.setRenderHint(QPainter::Antialiasing);
view.setBackgroundBrush(Qt::darkGray);
view.setWindowTitle(QT_TRANSLATE_NOOP(QGraphicsView, "Qt DBus Controlled Car"));
view.resize(400, 300);
view.resize(view.sizeHint());
view.show();
new CarInterfaceAdaptor(car);

View File

@ -16,11 +16,23 @@ qt_add_dbus_interface(controller_SRCS
)
qt_add_executable(controller
controller.cpp controller.h controller.ui
controller.cpp controller.h
main.cpp
${controller_SRCS}
)
qt_add_resources(controller
PREFIX
"/"
FILES
down.svg
left.svg
right.svg
up.svg
connected.svg
connecting.svg
)
set_target_properties(controller PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE

View File

@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M19 11C19 11.5523 19.4477 12 20 12C20.5523 12 21 11.5523 21 11V10.8478C21 8.11075 19.7088 5.53404 17.5163 3.89561C17.0739 3.56501 16.4472 3.65565 16.1166 4.09805C15.786 4.54046 15.8767 5.1671 16.3191 5.4977C18.0064 6.75857 19 8.74149 19 10.8478V11ZM4 12C4.55228 12 5 11.5523 5 11V10.8478C5 8.74149 5.99363 6.75857 7.68091 5.4977C8.12331 5.1671 8.21395 4.54046 7.88335 4.09805C7.55275 3.65565 6.92611 3.56501 6.4837 3.89561C4.29117 5.53404 3 8.11075 3 10.8478V11C3 11.5523 3.44772 12 4 12ZM7.10555 19.5528C7.35253 19.0588 7.95321 18.8586 8.44719 19.1055C10.6837 20.2238 13.3162 20.2238 15.5528 19.1056C16.0467 18.8586 16.6474 19.0588 16.8944 19.5528C17.1414 20.0468 16.9412 20.6474 16.4472 20.8944C13.6476 22.2942 10.3523 22.2942 7.55276 20.8944C7.05878 20.6474 6.85856 20.0467 7.10555 19.5528Z" fill="black"/>
<path id="Layer02" fill-rule="evenodd" clip-rule="evenodd" d="M13 5C13 5.55228 12.5523 6 12 6C11.4477 6 11 5.55228 11 5C11 4.44772 11.4477 4 12 4C12.5523 4 13 4.44772 13 5ZM15 5C15 6.65685 13.6569 8 12 8C10.3431 8 9 6.65685 9 5C9 3.34315 10.3431 2 12 2C13.6569 2 15 3.34315 15 5ZM5 17C5.55228 17 6 16.5523 6 16C6 15.4477 5.55228 15 5 15C4.44772 15 4 15.4477 4 16C4 16.5523 4.44772 17 5 17ZM5 19C6.65685 19 8 17.6569 8 16C8 14.3431 6.65685 13 5 13C3.34315 13 2 14.3431 2 16C2 17.6569 3.34315 19 5 19ZM19 17C19.5523 17 20 16.5523 20 16C20 15.4477 19.5523 15 19 15C18.4477 15 18 15.4477 18 16C18 16.5523 18.4477 17 19 17ZM19 19C20.6569 19 22 17.6569 22 16C22 14.3431 20.6569 13 19 13C17.3431 13 16 14.3431 16 16C16 17.6569 17.3431 19 19 19Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path id="Layer01" d="M14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12Z" fill="#0D0D0D"/>
<path id="Layer02" fill-rule="evenodd" clip-rule="evenodd" d="M3 12C3 14.2728 3.94193 16.5032 5.71196 18.2978C6.09978 18.691 6.09543 19.3241 5.70223 19.712C5.30902 20.0998 4.67587 20.0954 4.28805 19.7022C2.18112 17.5661 1 14.8427 1 12C1 9.15729 2.18112 6.43389 4.28805 4.29777C4.67587 3.90457 5.30902 3.90022 5.70223 4.28804C6.09543 4.67587 6.09978 5.30902 5.71195 5.70223C3.94193 7.49678 3 9.72715 3 12ZM8.80201 14.404C8.27734 13.6971 7.99902 12.8569 7.99902 12C7.99902 11.1431 8.27734 10.3029 8.80201 9.596C9.13117 9.15252 9.0385 8.52617 8.59502 8.19701C8.15154 7.86785 7.5252 7.96052 7.19604 8.404C6.41969 9.44998 5.99902 10.7067 5.99902 12C5.99902 13.2933 6.41969 14.55 7.19604 15.596C7.5252 16.0395 8.15154 16.1321 8.59502 15.803C9.0385 15.4738 9.13117 14.8475 8.80201 14.404ZM15.197 14.404C15.7217 13.6971 16 12.8569 16 12C16 11.1431 15.7217 10.3029 15.197 9.596C14.8679 9.15252 14.9605 8.52617 15.404 8.19701C15.8475 7.86785 16.4738 7.96052 16.803 8.404C17.5793 9.44998 18 10.7067 18 12C18 13.2933 17.5793 14.55 16.803 15.596C16.4738 16.0395 15.8475 16.1321 15.404 15.803C14.9605 15.4738 14.8679 14.8475 15.197 14.404ZM18.2871 18.2978C20.0571 16.5032 20.999 14.2728 20.999 12C20.999 9.72715 20.0571 7.49678 18.2871 5.70223C17.8992 5.30902 17.9036 4.67587 18.2968 4.28804C18.69 3.90022 19.3232 3.90457 19.711 4.29777C21.8179 6.43389 22.999 9.15729 22.999 12C22.999 14.8427 21.8179 17.5661 19.711 19.7022C19.3231 20.0954 18.69 20.0998 18.2968 19.712C17.9036 19.3241 17.8992 18.691 18.2871 18.2978Z" fill="#0D0D0D"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -2,18 +2,47 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include "controller.h"
#include <QGridLayout>
#include <QHBoxLayout>
using org::example::Examples::CarInterface;
Controller::Controller(QWidget *parent) : QWidget(parent)
{
ui.setupUi(this);
car = new CarInterface("org.example.CarExample", "/Car", QDBusConnection::sessionBus(), this);
connect(ui.accelerate, &QPushButton::clicked, car, &CarInterface::accelerate);
connect(ui.decelerate, &QPushButton::clicked, car, &CarInterface::decelerate);
connect(ui.left, &QPushButton::clicked, car, &CarInterface::turnLeft);
connect(ui.right, &QPushButton::clicked, car, &CarInterface::turnRight);
accelerate = new QPushButton(QIcon(":up.svg"), "", this);
accelerate->setFixedSize(80, 64);
accelerate->setIconSize(QSize(44, 44));
decelerate = new QPushButton(QIcon(":down.svg"), "", this);
decelerate->setFixedSize(80, 64);
decelerate->setIconSize(QSize(44, 44));
left = new QPushButton(QIcon(":left.svg"), "", this);
left->setFixedSize(64, 80);
left->setIconSize(QSize(44, 44));
right = new QPushButton(QIcon(":right.svg"), "", this);
right->setFixedSize(64, 80);
right->setIconSize(QSize(44, 44));
status = new QLabel(this);
statusSymbol = new QLabel(this);
statusSymbol->setFixedHeight(24);
QGridLayout *layout = new QGridLayout(this);
layout->addWidget(accelerate, 1, 1);
layout->addWidget(left, 2, 0);
layout->addWidget(right, 2, 2);
layout->addWidget(decelerate, 3, 1);
QHBoxLayout *statusLayout = new QHBoxLayout();
statusLayout->addWidget(status);
statusLayout->addWidget(statusSymbol);
layout->addLayout(statusLayout, 0, 1, 1, 2, Qt::AlignTop | Qt::AlignRight);
connect(accelerate, &QPushButton::clicked, car, &CarInterface::accelerate);
connect(decelerate, &QPushButton::clicked, car, &CarInterface::decelerate);
connect(left, &QPushButton::clicked, car, &CarInterface::turnLeft);
connect(right, &QPushButton::clicked, car, &CarInterface::turnRight);
startTimer(1000);
}
@ -21,5 +50,9 @@ Controller::Controller(QWidget *parent) : QWidget(parent)
void Controller::timerEvent(QTimerEvent *event)
{
Q_UNUSED(event);
ui.label->setText(car->isValid() ? tr("connected") : tr("disconnected"));
static QPixmap connectedIcon = QPixmap::fromImage(QImage(":connected.svg"));
static QPixmap connectingIcon = QPixmap::fromImage(QImage(":connecting.svg"));
status->setText(car->isValid() ? tr("connected") : tr("searching..."));
statusSymbol->setPixmap(car->isValid() ? connectedIcon : connectingIcon);
}

View File

@ -4,7 +4,10 @@
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include "ui_controller.h"
#include <QWidget>
#include <QPushButton>
#include <QLabel>
#include "car_interface.h"
class Controller : public QWidget
@ -18,8 +21,13 @@ protected:
void timerEvent(QTimerEvent *event) override;
private:
Ui::Controller ui;
org::example::Examples::CarInterface *car;
QPushButton *accelerate;
QPushButton *decelerate;
QPushButton *left;
QPushButton *right;
QLabel *statusSymbol;
QLabel *status;
};
#endif

Some files were not shown because too many files have changed in this diff Show More