65956 Commits

Author SHA1 Message Date
Edward Welbourne
84d5754a81 Pass trivially-copyable types by value, not by const ref
The LikelyPair and QLocaleId types are small enough to pass by value.

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

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

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

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

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

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

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

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

Reason for revert: Latest emulator fixed the issue.

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

Reason for revert: The latest emulator fixed the issue.

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

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

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

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

Reason for revert: latest emulator version fixed the issue.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Add context object.

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

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

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

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

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

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

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

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

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

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

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

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

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

Amends ea6abe583f8534495c3c43e2b6aab95742b102a3.

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

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

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

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

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

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

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

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

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

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

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

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

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

Initialize it to zero.

Found by Coverity.

Amends df0e98d4080f50de7ecacdc4cae079ab31280481.

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

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

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

This amends 8cd7a3d4723ca414f3fe544704a0ccb752da94b8.

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

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

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

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

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

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

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

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

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

Pick-to: 6.6 6.5 6.2 5.15
Coverity-Id: 444141
Coverity-Id: 444135
Change-Id: I5fcc664c3cea608429036cad75c37f5c38059733
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 19aeb431cf1bd4e864356ff02db6337dc59b2835)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-03-26 19:27:00 +00:00