65698 Commits

Author SHA1 Message Date
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