Commit Graph

62544 Commits

Author SHA1 Message Date
Kai Köhne
62e3fa28d7 Doc: Improve description of QT_FATAL_ environment vars
Much like QT_FATAL_WARNINGS, QT_FATAL_CRITICALS also is
interpreted as a counter. Revamp both function descriptions
to make scope and purpose clearer.

Also, mention logging rules as a way to surpress output,
in addition to a custom message hander.

Pick-to: 6.5 6.6
Change-Id: I44767abb067a6accd81f13dc549c9787ef9a4729
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-06 10:52:32 +02:00
Marc Mutz
06d520dbef QLogging: add qYieldCpu() to CAS loop
CAS failures should result in PAUSE/YIELD, cf. qYieldCpu() docs.

qYieldCpu() is only available since Qt 6.3, though, so adding it as a
follow-up with limited pick-to.

Task-number: QTBUG-115062
Pick-to: 6.6 6.5
Change-Id: Ibcc73881875a47935940015e30b9a27a282054d4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-06 09:26:39 +02:00
Marc Mutz
b933a5668c Make sure we don't count down past 0 QT_FATAL_CRITICALS
The old code first checked for == 0, then, if false, executed a
fetchAndAdd(-1), both with relaxed memory ordering. This can lead to
executions that, counter to what the code comment states, can count
down past 0:

    // T1                   T2
    loadRelaxed()                                  // true
                            loadRelaxed()          // true
    fetchAndAddRelaxed(-1)                         // e.g. 1 → 0
                            fetchAndAddRelaxed(-1) // 0 → -1

while fatality is detected exactly once, this execution doesn't stop
at 0 and causes further calls to isFatal() to count down further, with
the (very) remote spectre of underflow past INT_MIN.

Fix by using a CAS loop instead, so each count-down uses only one
step, not two, which therefore can no longer interleave.

Fixes: QTBUG-115062
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: If77b906c94cb4b9fa91bfad84fe63bc8d9103b0a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-06 09:26:39 +02:00
Axel Spoerl
bbb71e7e80 QDialogButtonBox - Update focus chain when buttons show or hide
Hiding a button in a QDialogButtonBox doesn't remove its default and
focus behavior. Hiding the button shown in the first position, breaks
the focus chain. Tabbing between the button is no longer possible.

This patch implements listening to the buttons' HideToParent and
ShowToParent events. Hidden buttons are removed from the button box
and kept in a separate hash. That ensures focus chain consistency.
When they are shown again, they are added to the button logic and
their default/focus behavior is restored.

An autotest is added in tst_QDialogButtonBox.

Fixes: QTBUG-114377
Pick-to: 6.6 6.5
Change-Id: Id10c4675f43d6007206e41c694688c4f0a34ee52
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-07-06 08:41:04 +02:00
Thiago Macieira
ef9fe7a99a qC{Debug,Info,Warning,Critical}: move the function call to the macro
The change in commit 04ee5795cc was
source-incompatible if the function in question was a non-static member.
I could add a new, template constructor to catch those, but this is
simpler.

Fixes: QTBUG-115043
Pick-to: 6.5 6.6
Change-Id: I53335f845a1345299031fffd176f1071afbae7a9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-07-05 22:24:55 -07:00
Ahmad Samir
5a523981f4 Moc: don't make variables inside an unnamed namespace static
Because an unnamed namespace, and variables inside it, have internal
linkage[1]; and the variable is constexpr in this case so static
redundant.

This fixes a clang-tidy warning:
readability-static-definition-in-anonymous-namespace

[1] https://eel.is/c++draft/basic.link#4

Change-Id: I95600214cd51b03872ee22995d93d1b5658d5a18
Task-number: QTBUG-112870
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-07-06 06:28:22 +03:00
Ahmad Samir
7a253f293e QXmlStream: remove extra "$" character in generated code
It looks like a left-over from converting to SPDX-License-Identifier in
05fc3aef53.

Change-Id: Ia925f8443b35f850512627d985d570616c548cd0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-07-06 06:28:22 +03:00
Ahmad Samir
a982b67538 QXmlStream: fix generating ERROR enum value
It was changed from ERROR to XML_ERROR to disambiguate static variables
in d3f8d7fd41. Make the change in
qxmlstream.g, so that generating the C++ code doesn't revert it.

Pick-to: 6.6
Change-Id: Ie51955a2b013ce8d9580ce64f708598f9a103754
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-07-06 06:28:22 +03:00
Ahmad Samir
effb3bddf6 QXmlStreamReader: use std::optional
The optional-like FastScanNameResult was used to make some previous
changes backport-able to Qt 5.15 (std::optional is C++17 whereas Qt 5.15
requires C++14).

Amends commit 6326bec46a.

Pick-to: 6.6 6.5
Change-Id: I409e1da83f82927c1eb24c47c1414c0c7ab1bf5b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-07-06 03:28:21 +00:00
Marc Mutz
b2b5862479 QAnyStringView: add QDebug stream operator
When QDebug::quoted(), indicates the encoding using the u/u8 prefixes
or the _L1 suffix. This is information that might come in handy, and
we plan to make it off-switchable (QTBUG-114936). The default should
be true, though, for QAnyStringView, because we should confront users
with this feature so they learn it exists. For concrete view types,
changing the default behavior is probably not a good idea.

[ChangeLog][QtCore][QAnyStringView/QDebug] Can now stream
QAnyStringView into QDebug.

Fixes: QTBUG-114935
Change-Id: Icd5bf700c8b7958e942468b54248487998f262d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-06 02:18:38 +00:00
Marc Mutz
4443d392e4 QOpenGLFunctions: fix -Wunused-private-field (Clang 15)
I see this with -unity-build -unity-build-batch-size 32, but I don't
know whether it's unity-build or just Clang 15, so also pick to
6.2. The issue exists in 5.15, too, presumably, but I have no desire
to find a non-C++17 fix.

It appears the generator (glgen) is out-of-sync with the state of its
supposed output as of at least 18aae36a90,
so don't try to update the generator (I failed to find where these
fields originate from, anyway).

Pick-to: 6.6 6.5 6.2
Task-number: QTBUG-115031
Change-Id: Ia27620b8f8034c3e8eff383abb849e6ce93dce8a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-07-05 23:13:08 +00:00
Marc Mutz
a4125f421b qYieldCpu(): use Q_CC_GNU_ONLY
Simplifies the expression.

Change-Id: Ia0524d10126bf77980711c83b45fc974d9f0ae1f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-06 01:13:07 +02:00
Lucie Gérard
a9dccebf1e Correct wrong SPDX license expression
Task-number: QTBUG-106228
Change-Id: I9a035ea80499052fc41b8281b6c1e2596682f348
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-07-05 21:57:27 +00:00
Axel Spoerl
634ef449bf QIbaseResult: null parameter follow up fix
a7deddba51 implemented a warning for
disallowed null parameters. A check, was missing, if the argument is
actually null.

This patch adds the missing check.

Fixes: QTBUG-114683
Pick-to: 6.6 6.5
Change-Id: Iecbd636599a28284a0a9afe2987e48552f3658ff
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-07-05 20:40:30 +02:00
Amanda Hamblin-Trué
9de8e7532b QtTest: fix documention wording and typo
Pick-to: 6.6 6.5
Change-Id: I71c38e40db9ff222016ed24a43f646ceef749180
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-07-05 18:55:15 +02:00
Giuseppe D'Angelo
ec653fad39 QtWidgets: code tidies: use the 4-arg connect overload
The 3-arg connect is error-prone and makes the lifetime of the
connection unclear.

Change-Id: I1b6b10d814412f02ae534d408723762ba7cd815b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-07-05 17:08:03 +02:00
Giuseppe D'Angelo
c87cbc38f1 QtTest: code tidies: use the 4-arg connect overload
The 3-arg connect is error-prone and makes the lifetime of the
connection unclear.

Change-Id: I51f9bd87caa9baa57d06c8f3fd9ed8b37ef49cae
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-07-05 17:08:03 +02:00
Mikolaj Boc
844009f8e0 Immediately drag when start distance is 0 in abstract item view
This change makes system drag become initiated right after dragging
is detected when drag start distance from
QApplication::startDragDistance is 0. Otherwise the starting distance
is ignored and the value of 1 is implicitly used.
The startDragDistance of 0 is needed on WASM, as the native
dragstart event arrives exactly after the first mousemove event.
With this change, it is possible to set up drag correctly prior to
the native dragstart event arriving.

Fixes: QTBUG-114947
Change-Id: I112d97d251c9e9b1a39196ddcc39a37024b441f6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-07-05 16:45:41 +02:00
Alexandru Croitor
3f6041a24f CMake: Add missing check for tool target promotion
We shouldn't try to promote tool targets if they were not created
when Qt6FooTools_FOUND is FALSE due to missing dependencies and
Qt6FooToolsTargets.cmake is not included.

Add a check for Qt6FooTools_FOUND to prevent errors like:

 CMake Error at lib/cmake/Qt6/QtPublicTargetHelpers.cmake:257
 (get_property):
  get_property could not find TARGET Qt6::qtprotobufgen.  Perhaps it
  has not yet been created.

Pick-to: 6.5 6.6
Change-Id: Ie26db637d4d8ef682a0ada5ea36ef0e8ceced008
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-07-05 15:09:33 +02:00
Alexandru Croitor
0e56dd2746 CMake: Make qtbase tests standalone projects
Add the boilerplate standalone test prelude to each test, so that they
can be opened with an IDE without the qt-cmake-standalone-test script,
but directly with qt-cmake or cmake.

Boilerplate was added using the following scripts:
https://git.qt.io/alcroito/cmake_refactor

Manual adjustments were made where the code was inserted in the wrong
location.

Task-number: QTBUG-93020
Change-Id: I77299f990692b4fe4721a9bc35071608d0d23982
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
2023-07-05 15:09:32 +02:00
Alexandru Croitor
463d232457 CMake: Make network tests standalone projects
Add the boilerplate standalone test prelude to each test, so that they
can be opened with an IDE without the qt-cmake-standalone-test script,
but directly with qt-cmake or cmake.

Boilerplate was added using the following scripts:
https://git.qt.io/alcroito/cmake_refactor

Manual adjustments were made where the code was inserted in the wrong
location.

Task-number: QTBUG-93020
Change-Id: I000cd3b0809b6417c3b1ab520e4de746afee71fc
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-07-05 15:09:32 +02:00
Alexandru Croitor
68cb89c8b2 CMake: Make widgets tests standalone projects
Add the boilerplate standalone test prelude to each test, so that they
can be opened with an IDE without the qt-cmake-standalone-test script,
but directly with qt-cmake or cmake.

Boilerplate was added using the following scripts:
https://git.qt.io/alcroito/cmake_refactor

Manual adjustments were made where the code was inserted in the wrong
location.

Task-number: QTBUG-93020
Change-Id: I3c0d1a63c474969e5eaee5fdbb1bb0229482fc5b
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-07-05 15:09:32 +02:00
Alexandru Croitor
8450ab8dec CMake: Make gui tests standalone projects
Add the boilerplate standalone test prelude to each test, so that they
can be opened with an IDE without the qt-cmake-standalone-test script,
but directly with qt-cmake or cmake.

Boilerplate was added using the following scripts:
https://git.qt.io/alcroito/cmake_refactor

Manual adjustments were made where the code was inserted in the wrong
location.

Task-number: QTBUG-93020
Change-Id: I2ef59684cf297a0222a136ce7b5630037294d000
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-07-05 15:09:32 +02:00
Alexandru Croitor
d4b7acec4b CMake: Make corelib tests standalone projects
Add the boilerplate standalone test prelude to each test, so that they
can be opened with an IDE without the qt-cmake-standalone-test script,
but directly with qt-cmake or cmake.

Boilerplate was added using the following scripts:
https://git.qt.io/alcroito/cmake_refactor

Manual adjustments were made where the code was inserted in the wrong
location.

Task-number: QTBUG-93020
Change-Id: I28b6d3815c5f43d2c33ea65764f6f3f8f129eaf3
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-05 15:09:32 +02:00
Giuseppe D'Angelo
d45ac7b898 QtNetwork: code tidies: use the 4-arg connect overload
The 3-arg connect is error-prone and makes the lifetime of the
connection unclear.

Amends dae24df07f

Change-Id: Iec1c2cb266fcaca1a1c407a6158cc8bbb282756b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-07-05 15:09:31 +02:00
David Edmundson
d0a5866f6f qgenericunixservices: Move x11 specific code to the Xcb backend
QGenericUnixServices is an abstract class subclassed by the wayland
backend for wayland specific functionality. This moves to a consistent
pattern where X11 code is also the X11 backend rather than guarded with
if statements.

Change-Id: I1cc7ebac811463451d744fdc034f5ad5fd022bc6
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-07-05 14:09:31 +01:00
Safiyyah Moosa
d2a73883ae Doc: State that Qt5.15 is compatible with OpenSSL3
Task-number: QTBUG-114138
Pick-to: 6.5 6.6
Change-Id: Ida224255d4aac323cb4bebeb7825a07bb55fc041
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-07-05 15:09:31 +02:00
Marc Mutz
3ffc1f9775 QLogging: DRY isFatal(QtMsgType)
Extract Method on the count-down algorithm of fatalCriticals and
fatalWarnings, so we don't have the repeat the calculation and the
comment.

Task-number: QTBUG-115062
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I4bcbc2f5a21b999e7f301085581677b437a889e9
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-07-05 11:03:44 +00:00
Marc Mutz
af32768f18 QDebug: add getter/setter for noQuotes
There were setters (quote(), noquote()), but, unlike
space()/nospace(), there was no getter.

Add the getter, and, for symmetry, a parametrized setter, too.

[ChangeLog][QtCore][QDebug] Added setQuoteStrings()/quoteStrings() to
access and manipulate the quote()/noquote() state.

Change-Id: I1b73138819b4d02726a6ef862c190206431ccebc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-05 12:56:55 +02:00
Laszlo Agocs
e090853ad5 rhi: metal: Fix external MTLDevice import
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-115002
Change-Id: I57c12685f8451420c30c65a1a25064607b52e31c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-07-05 11:25:44 +02:00
Laszlo Agocs
6d9a99d6d8 rhi: vulkan: Fix cloned VkRenderPass wrt multiview
Change-Id: I2c97151d144a332fd078ec8940c063b30d3a6d7d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-07-05 11:25:44 +02:00
Laszlo Agocs
0e80b3b527 rhi: vulkan: Include multiViewCount in renderpass compatibility
Change-Id: I3185ce27c52c138053fee4805eccbe3575b9433a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-07-05 11:25:43 +02:00
Mårten Nordheim
ee736717d3 CMake: Don't use VCPKG_DEFAULT_TRIPLET for triplet deduction
This environment variable is used by vcpkg to avoid having to pass
the --triplet argument on the command line on every vcpkg invocation
and shouldn't influence the triplet used during build. In fact,
the vcpkg.cmake toolchain will automatically attempt to deduce the
target triplet if we don't define this beforehand.

As a replacement, read from the QT_VCPKG_TARGET_TRIPLET environment
variable. It has the QT_ prefix to make it clear this is not a
standard vcpkg environment variable.

[ChangeLog][Build System] Qt no longer uses the VCPKG_DEFAULT_TRIPLET
environment variable to deduce target triplet. By default we let
vcpkg's toolchain file automatically deduce the triplet to use.
The new QT_VCPKG_TARGET_TRIPLET environment variable can be used
instead, or pass -DVCPKG_TARGET_TRIPLET=<triplet> to CMake.

Pick-to: 6.6
Change-Id: Idc6cbd52a68578d1762ca175c4973355409688ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-07-05 08:42:54 +00:00
Volker Hilsheimer
1fe60cbcc3 QVariant: always compare floating point with double precision
When Qt is configured with `-qreal float`, then we should still compare
QVariants containing floating point values with the full precision of
the stored type, and not cast to qreal (ie. float).

Cast all floating point types up to double, which is the highest-
precision floating point type we support in Qt. This might have a small
performance impact when compiling with `-qreal float`, if the FPU does
not perform well with double-precision floating point values.

We don't test any `-qreal float` configurations in CI, so not adding
a unit test for this.

Fixes: QTBUG-114991
Pick-to: 6.6 6.5 6.2
Change-Id: I198ec2c39913b501ef2fe99ae3048b160baa1fd8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-05 06:41:52 +02:00
Marc Mutz
5f9ab113e3 QWidgetTextControl: share setActionIcon() with QLineEdit
... unbreaking -unity-build-batch-size 103.

Task-number: QTBUG-115031
Pick-to: 6.6 6.5
Change-Id: I004163000a422b05ee0c882f065286c043d58206
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-07-05 01:25:54 +02:00
Marc Mutz
19bfe3e0b1 QTabBar: share verticalTabs(Shape) with QStyleSheetStyle
... unbreaking -unity-build-batch-size 103.

As a drive-by, make the shared function constexpr and noexcept.

Task-number: QTBUG-115031
Pick-to: 6.6 6.5
Change-Id: I2bf30a280eccd896a5aa7de92c72aab30e797640
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-07-05 01:25:54 +02:00
Marc Mutz
199a339f38 QFusionStyle: rename dock_widget_close_xpm to avoid clash with qcommonstylepixmaps_p.h
They're different XPMs, so we can't share them.

Detected by -unity-build-batch-size 103.

Task-number: QTBUG-115031
Pick-to: 6.6 6.5
Change-Id: Ifa5ce59df10883f95582aefe37e413db2e5a13f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-07-05 01:25:54 +02:00
Allan Sandfeld Jensen
7c6be5e884 Make while iterations over height safer
Changing the repeating pattern to one that can survive negative numbers,
even if most places it isn't possible.

Pick-to: 6.6 6.5
Fixes: QTBUG-115003
Change-Id: I636e246b00a9dda65c147dff3e1f1d1a748d1879
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-07-05 01:25:53 +02:00
Axel Spoerl
a7deddba51 QIbaseResult: qWarning, when disallowed null parameter becomes zero
QIbaseResult turns null into zero when database field doesn't
accept a null argument.

This patch adds a warning in that case. It would be better to return
with an error, but that breaks existing behavior with code relying on
it.

Fixes: QTBUG-114683
Pick-to: 6.6 6.5
Change-Id: Ib50b7b6b4dd6c51489ba8b355f7baa8b1b14dc15
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2023-07-04 23:31:51 +02:00
Marc Mutz
3748b194d4 QEventLoopLocker: defend against nullptr arguments
The class would previosuly produce a crash when the QEventLoop* or the
QThread* were nullptr or if no QCoreApplication existed. We want,
however, the out-of-line constructors of the class to be noexcept, and
for that, they should neither allocation nor have preconditions. The
former is for another patch; this patch deals with the latter.

[ChangeLog][QtCore][QEventLoopLocker] Is now a no-op on nullptr
QEventLoop*, QThread*, QCoreApplication::instance() (was: crash).

Task-number: QTBUG-114793
Pick-to: 6.6
Change-Id: I4246f74008df6ad7fcbfde56403397b065fbe861
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-07-04 18:29:36 +00:00
Marc Mutz
d18a9dd977 QEventLoopLocker: use visit() to DRY ctors
Collapse all three Private ctors into one (void*, Type) one.

Task-number: QTBUG-114793
Pick-to: 6.6
Change-Id: Ia5c67c0ffdcddfdecb38fe3e095d60f6761f1160
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-07-04 18:29:28 +00:00
Marc Mutz
586e07785c QtNetwork: replace clashing statics with lambdas II: isSeparator
Detected with -unity-build-batch-size 103.

Here, we just replace one of the static functions with a lambda,
because the transformed function was far away from the use site while
the unchanged instances (in qhsts.cpp) had several brethren isFoo()
functions and the use was close to the definition.

Pick-to: 6.6 6.5
Task-number: QTBUG-115031
Change-Id: Ib84a64cd8b9f20cad7806659990df76552c0c5e4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-07-04 18:16:38 +02:00
Marc Mutz
5b7c8eb984 QtNetwork: replace clashing statics with lambdas I: downloadBufferDeleter
Detected with -unity-build-batch-size 103.

Pick-to: 6.6 6.5
Task-number: QTBUG-115031
Change-Id: Ia67082efbdb3f403a8c8010ec15f9f796f97feb6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-07-04 18:16:37 +02:00
Alexey Edelev
f0ae4b07eb Fix handling of QT_PATH_ANDROID_ABI_xxxx in android multi-abi tests
Fix 'IN_LISTS' typo, should be IN LISTS.

Pick-to: 6.5 6.6
Change-Id: Ia0bd1bf45922b2c9c1779e03b40dad6eab97eef1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-07-04 16:53:16 +02:00
Alexey Edelev
97268742e4 Install the missing deprecated header files
Deprecated Qt header files generated by syncqt were missing in
installation package of Qt, after migration to cpp based syncqt.
Restore them.

Note: we didn't receive bugs since 6.5 release so far. I would check
the existing files and remove them completely in 6.7. See QTBUG-115029.

Pick-to: 6.5 6.6
Fixes: QTBUG-112956
Change-Id: I2e5375ee0dbd87a76135594cd489bb67f6d3456d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-07-04 16:53:16 +02:00
Marc Mutz
8c2c4f178a QEventLoopLocker: add a visit() member
Still suffers from a bit of an impedance mismatch, because it's the
first step in making QEventLoopLocker shed its Private, but will be
used in a subsequent commit to DRY more code.

Task-number: QTBUG-114793
Pick-to: 6.6
Change-Id: Ia14effb6255961edae68eaf941fece9dca0cb844
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-04 16:53:15 +02:00
Marc Mutz
c70257e9b2 QEventLoopLockerPrivate: store the tag in the pointer variable
There's enough space in the LSB of the three pointers to encode the
type.

Saves sizeof(void*) in the Private class, but, more importantly, paves
the way for the next patch to get rid of the Private class and its
memory allocation altogether, turning QEventLoopLocker::d_ptr into
what this patch still calls QEventLoopLockerPrivate::p.

Neither QTaggedPointer nor QML's QBiPointer apply here. QTaggedPointer
only supports a single T, plus flags; QBiPointer supports only two Ts,
and one flag; we need three Ts and no flags. This could be a

    QVariantPointer<QEventLoopPrivate, QCoreApplicationPriivate*, QThreadPrivate*>

I'm thinking about it; just would want to find a second use-case for it.

Task-number: QTBUG-114793
Pick-to: 6.6
Change-Id: I0e21bd8745cc75a9c04b71343c398ad953283857
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-07-04 14:53:15 +00:00
Marc Mutz
97adda8675 QEventLoopLocker: unexport
Non-polymorphic classes should not be exported wholesale. Luckily, in
this case, all SMFs are either out-of-line or (implicitly or
explicitly) deleted, so we don't need to wait for Qt 7 to do the
change.

This is a prerequisite of adding move semantics to the class, as well
as some other optimizations that require non-exported functions.

As a drive-by, collapse ctor declarations into single lines, because a
follow-up patch will need to touch the original lines, anyway, to add
noexcept, so there's no point in keeping separate lines to optimize
the API review diffs.

Task-number: QTBUG-114793
Pick-to: 6.6
Change-Id: Iccfcc11d37aa9274e48345a1e01e0f827e465644
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-07-04 14:53:15 +00:00
Marc Mutz
093a0b4f6e Unity-build: exclude qrandom.cpp (#undef's Q_ASSERT/_X())
qrandom.cpp #undef's Q_ASSERT/_X(), breaking TUs that happen to use it
after qrandom.cpp has processed.

Exclude it.

Pick-to: 6.6 6.5
Fixes: QTBUG-115031
Change-Id: Ie419f4ed2323f9c9e91f4dceaf8fecc097673d0e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-07-04 14:53:15 +00:00
Marc Mutz
b8dd99a1b2 Unity-build: exclude qdebug.cpp (#undef's qDebug())
Like qlogging.cpp, qdebug.cpp also #undef's qDebug, breaking TUs that
happen to use it after qdebug.cpp has processed.

Exclude it.

In CMakeLists.txt, also mention qlogging.cpp undef's qInfo() and
qDebug(), too.

Pick-to: 6.6 6.5
Task-number: QTBUG-115031
Change-Id: I4c910f051f1578f27cac8e5e6b358e7ee2eeb97e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-07-04 14:53:15 +00:00