Don't stop searching enums if the enum partially matches.
Pick-to: 6.5
Change-Id: Idc2b45cee5a32994d55fe90c038938f0ad8b4a59
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Currently some libraries created by Qt are lacking some compile
definitions and compile options, and this issue is causing us
troubles when building Qt statically. This patch tries to reduce
the parameter difference when compiling Qt's own libraries.
Change-Id: I3842943a874fab32ef90980e8aa29f5beb01feeb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The desktop file name should not contain ".desktop" suffix, but some
applications still specify it anyway because of the ambiguity in the
documentation that was fixed in
0c5135a9df.
This change makes setDesktopFileName remove ".desktop" suffix so
desktopFileName always returns a desktop file name with correct format
and its users don't need to chop ".desktop".
Pick-to: 6.5
Change-Id: If5abccaf3bf976449cada8891fff887870e45b5f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
1. Don't reassign different versions to same symbol
2. Define symbols used
This fixes warnings with LLD linker (or errors if -Wl,--fatal-warnings is added by toolchain e.g. with Android NDK)
3. Add -Wl,--version-script to CMAKE_REQUIRED_LINK_OPTIONS instead of CMAKE_REQUIRED_FLAGS to prevent unused argument warning in compilation phase
(there is no need for _SAVE variable because we are inside a function and our CMAKE_REQUIRED_LINK_OPTIONS won't escase its scope)
4. Fix removal of version script file (incorrect file name was used)
Pick-to: 6.2 6.5
Task-number: QTBUG-111514
Change-Id: I0a1548c4268ad511760a0d4aa69ba7a0bdcbb0bc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This patch relaxes the requirements on the context object of
continuations. Instead of having to stay alive during execution of the
whole chain, it now only has to stay alive during setup of the chain.
If the context object is destroyed before the chain finishes, the
respective future is canceled.
This patch works by using QFutureCallOutInterface and signals instead
of direct invocation of the continuation by the parent future, similar
to how QFutureWatcher is implemented.
If a continuation is used with a context object, a QBasicFutureWatcher
is connected to the QFuture via a QFutureCallOutInterface. When the
future finishes, QBasicFutureWatcher::finished() triggers the
continuation with a signal/slot connection.
This way, we require the context object to stay alive only during setup;
the required synchronization is guaranteed by the existing event and
signal-slot mechanisms. The continuation itself does not need to know
about the context object anymore.
[ChangeLog][QtCore][QFuture] Added support for context objects of
continuations being destroyed before the continuation finishes. In
these cases the future is cancelled immediately.
Fixes: QTBUG-112958
Change-Id: Ie0ef3470b2a0ccfa789d2ae7604b92e509c14591
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Create tests to check that the continuations attached to ready futures
are immediately executed, and that the proper handlers are selected.
These checks were missing from the overall test set, which was detected
while working on the linked issue.
Task-number: QTBUG-112958
Change-Id: Iae97e4b9dfb1e016869693a5162f72e027ca7f5e
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This should be better than returning unknown if xdg-desktop-portal
is not running or its backend doesn't know color scheme
This also matches the pratice of all other
QXdgDesktopPortalTheme methods
Pick-to: 6.5
Change-Id: I352e091a019bc5b683c3f1dad223e55717888d02
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
To ensure the correct invocation of the projection function, this patch
introduces the usage of std::invoke for all accesses to it. This
modification expands the coverage to include cases where the callable
object is a pointer to a member function.
Amends: 7ca633d9a8.
Change-Id: If666012d785ac74c8e856ea9be2a46b3307c8a06
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
The previous implementation of iterator-assign did not include a check
for the return value of QArrayData::allocate(~), which returns a nullptr
on failure.
Amends: bbbe5f45c4.
Change-Id: I219e63ecd6de4225364d9c3dd2006ddbbe47068f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Buffer and texture sizes (size, pixelSize) may get increased, if needed,
but those actual sizes calculated by the QRhi backends are not written
back to the QRhiBuffer m_size or QRhiTexture m_pixelSize.
In contrast, both m_depth and m_arraySize are clamped in QRhiTexture
by most backends (to ensure a lower bound of 1 and 0, respectively).
This is not great since it means the getters for depth() and arraySize()
may return values different from what the user has provided. To avoid
confusion, do not modify the m_* variables.
Change-Id: I2cc5b9abf41ea108549ffd7f2403306e6e8ebba2
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
Mainly for completeness, but it has practical uses: someone retrieving
a QRhi instance from somewhere should be able to tell the
QVulkanInstance, and so the VkInstance, used by that QRhi without
resorting to investigating other objects (e.g. retrieving the instance
from the QWindow). This provides symmetry to other 3D APIs and QRhi
backends where just a single QRhi instance is sufficient to get the
MTLDevice, ID3D11Device/Context, etc. i.e. all that is needed to
work with the 3D API directly.
Change-Id: I5a8b9871a543ea648c76b868bf6ff7be5f2098f2
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Otherwise individual sockets will still load system certificates when
a chain doesn't match against the configured CA certificates.
That's not intended behavior, since specifically setting the CA
certificates means you don't want the system certificates to be used.
Follow-up to/amends ada2c573c1
This is potentially a breaking change because now, if you ever add a
CA to the default config, it will disable loading system certificates
on demand for all sockets. And the only way to re-enable it is to
create a null-QSslConfiguration and set it as the new default.
Pick-to: 6.5 6.2 5.15
Change-Id: Ic3b2ab125c0cdd58ad654af1cb36173960ce2d1e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Use the new "/Ob3" flag introduced in VS2019 to increase the inline
level, which may give better performance. For compilers older than
VS2019, we still use the traditional "/Ob2" inline level.
Official documentation:
https://learn.microsoft.com/en-us/cpp/build/reference/ob-inline-function-expansion?view=msvc-170
Change-Id: I34a50f27a151cb7c09f0085dd037a385c71848aa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
I.e. if def.superclassList is empty, calling checkSuperClasses() is
no-op. Spotted by Fabian in code review.
Change-Id: I499baf1d2cf6dd08a26394221a48af991ccea4ad
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Testing for "res_ninit" when WrapResolv.cmake has already checked for
far more complex functions was pointless. Instead, just accept the
library that was found by find_package() as good enough and rename the
feature as "libresolv".
Amends 4a46ba1209 and
68b625901f.
Change-Id: Ib5ce7a497e034ebabb2cfffd1762c0afa2fac6e0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Can't use [=, this], as clang fails to build with:
error: explicit capture of 'this' with a capture default of '=' is a
C++20 extension [-Werror,-Wc++20-extensions]
Change-Id: I8ead9cb493cb1e295aa03386d80af6e83ba8cbb4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Drive-by include "DO NOT EDIT" in both files.
Change-Id: Ib5ce7a497e034ebabb2cfffd1762bf1d4ce737eb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
I cannot repro this myself, but from the bug report it seems to be
defined in two headers, so we should consistently use the same one.
Fixes: QTBUG-113787
Pick-to: 6.5
Change-Id: I9f1cc51e379c33dbbf659946340a5207aaeb448a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
... with q*atomic.h.
Drive-by change: include <climits> instead of <limits.h>, from the
former's docs:
«This is a Standard C++ Library file. You should @c \#include this
file in your programs, rather than any of the @a *.h implementation
files.»
Task-number: QTBUG-106722
Change-Id: Id8169c482d2231c1620db033fbed1f904e15ed9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove qglobal.h include from qcompilerdetection.h, qsystemdetection.h
and modulecppexports.h.in
Testing locally, the code builds on Linux with precompiled headers
disabled/enabled (qt_pch.h includes qglobal.h, so building with PCH
enabled isn't useful for testing this) and with/without bootstrap.
qrunnable.*: missing includes detected by compiling with
-DFEATURE_headersclean=ON.
Task-number: QTBUG-106722
Change-Id: I70864dfbf117ffd7fe492eb715a413eb6f209990
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove the manual "This enum value has been introduced..." text. Doing
that only for 6.6 to avoid unnecessary cherry-pick conflicts and general
code churn.
Change-Id: I89a6fd313582fd0c5d6209608a3740f19f91bd01
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
There was a discrepancy between what the comment was saying, and what
the function was doing before, and with this patch, we opt for what the
comment was saying, which makes more sense. In addition, I cleaned up
its documentation a bit.
Pick-to: 6.5
Change-Id: I07c20f93aa5c8e9bc942f5e69f0cf8299f4a813e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
If users prefer non-unix new line style when building Qt in Linux
'\r' leads to an issue. syncqt cannot parse Qt header files using
inputstream. Add the explicit ignorance of the carriage return
character to make sure that it won't break parsing of the Qt headers.
Pick-to: 6.5
Fixes: QTBUG-113771
Change-Id: Iac69e77788517fe160118297051597a656b2f345
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
When configuring Qt the second time it might be situation that
the set of qt_find_package calls is changed. One of the scenarios
is the changing of the submodule list that needs to be built in
top-level builds. It's also applicable for Qt features that lead to
extra package lookup in the unlocked subdirectories. Current approach
collects packages that were found at the previous run and skips
search of the packages that are missing. The problem is that
it also skips packages even if qt_find_package was not called at
previous run. QT_INTERNAL_PREVIOUSLY_SEARCHED_PACKAGES collects
all packages that were actually searched at the previous run
to make sure that qt_find_package don't skip packages that
appeared at second run only.
Note: Described scenarios may still have other issues and are not
tested well.
Fixes: QTBUG-113244
Pick-to: 6.5
Change-Id: Iab36060a28fbaa16a3b3bdba67795955c496b0c3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
This option is dysfunctional since Qt 6.0. Modify the CMake variables
CMAKE_SYSROOT_LINK and CMAKE_SYSROOT_COMPILE instead.
Change-Id: Ib97dcc765c4644b5c3975d4b61c0e567451ea977
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
There's just no good equivalent with the CMake based build.
Change-Id: I923ef3173d631afe2db0bdacc1d02c1f4649b741
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This configure option is dysfunctional since Qt 6.0. If you really want
to add the /MP compiler option, add it to CMAKE_CXX_FLAGS.
Change-Id: I00b535067944df52abbadb424ec03e53aa41c819
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This configure option is dysfunctional since Qt 6.0.
Use -cmake-generator instead.
Change-Id: Idb147ec8087018dab3ac0e571eeff7d1f18e34f6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This Qt5 configure argument does not exist anymore.
Change-Id: I68c798eb2769c93e3ca0b30d6a3da3247e319eee
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Replace QStringLiteral and QString::fromLatin1 by u""_s or ""_L1.
Also use initializer list constructor for QStringList.
Change-Id: Ife020ddf48d27dd015aed1c04878216165decf69
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Use multi-line string literals instead of repeated applications
of << operator. This should improve code size and performance.
Change-Id: I661454c007877bf86a289174e98d4cd3fe145d6f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This program is non-interactive and its output does not need
to be flushed after each line of the generated code. Using "\n"
improves code size, performance and readability.
Change-Id: I7def2a207cf4e5c3960db6ba3d8a8574eb0d27c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
std::as_const() is a 100% equivalent replacement.
[ChangeLog][Deprecation Notices][QtCore] qAsConst() is now
deprecated. You can simply globally search and replace "qAsConst" with
"std::as_const" in your code-base.
Change-Id: If9b29f9b4119cf5bdb9f0a1ada1271c6bb503916
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
We were getting InvalidReplyError because it was simply unknown, which
is not very useful. Previously, the Unix code used res_nquery(), which
does not return timeouts as a condition. It returns -1 if a timeout did
happen, but the content in errno could be a left-over from a previous
timeout (see the "Not a typewriter"[1] problem).
With the rewrite to using res_nmkquery() and res_nsend() from the
previous commits, we can rely on errno being set properly by
res_nsend().
$ $objdir/tests/manual/qdnslookup/qdnslookup @0.0.0.1
; <<>> QDnsLookup 6.6.0 <<>> qdnslookup @0.0.0.1
;; status: TimeoutError (Request timed out)
;; QUESTION:
;qt-project.org IN A
;; Query time: 10008 ms
;; SERVER: 0.0.0.1#53
Tested on FreeBSD, Linux, macOS, and Windows.
[1] https://en.wikipedia.org/wiki/Not_a_typewriter
Change-Id: I3e3bfef633af4130a03afffd175e31958247f9b1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The current code was inefficient when replies exceeded the initial
buffer size because the res_nsend() function switched to VC to get the
full reply, but that wouldn't fit our buffer before we enlarged it. This
commit tells res_nsend() to only use UDP or only use TCP, avoiding the
two unnecessary transactions in the lookup.
Since we don't get that second TCP reply now that would tell us the size
of the reply, we must allocate the largest possible buffer for a DNS
reply.
Change-Id: I3e3bfef633af4130a03afffd175e73d2e9fa9bf1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The current code is inefficient when dealing with replies exceeding the
PACKETSZ default size. This commit adds an EDNS0 footer to the DNS query
informing the DNS server how big our buffer is. We choose a larger
buffer than the old PACKETSZ so more will fit before a Virtual Circuit
(TCP socket) is required.
The choice is based on IPv6 requirements for the minimum MTU. Any
network incapable of transmitting frames with that big a payload must
support fragmenting and reassembly at the Layer 2 level, below IP.
Ethernet MTU is usually 1500, so we leave a bit on the table, but this
avoids having to discover our Path MTU to the DNS server.
This is incomplete: DNS queries above the 1232-byte limit still perform
the same query four times.
Change-Id: I3e3bfef633af4130a03afffd175e72f7fbc9265d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The current code is inefficient when dealing with replies exceeding the
PACKETSZ default size and especially those that require the use of a
Virtual Circuit (TCP socket). When the TC (Truncated) bit is set in the
DNS reply header, res_nquery() automatically switches to VC so it is
able to return the full size of the reply to us. This means we make the
same request four times:
1) over UDP, getting ~512 bytes of data
2) over TCP, getting the full reply but returning ~512 to us
3) over UDP again, getting (maybe) 1400 bytes of data
4) over TCP again, getting all the data
This commit splits res_nquery() into its two component functions,
res_nmkquery() and res_nsend(). This is incomplete: the four queries
above still happen.
Change-Id: I3e3bfef633af4130a03afffd175e728d96d6a604
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Amend 68b625901f and fix link issue with
slightly less modern libc/libresolv where not all functions have been
moved over to libc.
ld: src/network/CMakeFiles/Network.dir/kernel/qdnslookup_unix.cpp.o: in function `QDnsLookupRunnable::query(QDnsLookupReply*)':
qdnslookup_unix.cpp:(.text+0x183): undefined reference to `__res_nquery'
ld: qdnslookup_unix.cpp:(.text+0x437): undefined reference to `__dn_expand'
ld: qdnslookup_unix.cpp:(.text+0x621): undefined reference to `__dn_expand'
ld: qdnslookup_unix.cpp:(.text+0x8ff): undefined reference to `__res_nquery'
ld: qdnslookup_unix.cpp:(.text+0xbd7): undefined reference to `__dn_expand'
ld: qdnslookup_unix.cpp:(.text+0xd7f): undefined reference to `__dn_expand'
ld: qdnslookup_unix.cpp:(.text+0xf4f): undefined reference to `__dn_expand'
ld: qdnslookup_unix.cpp:(.text+0x10fa): undefined reference to `__dn_expand'
ld: qdnslookup_unix.cpp:(.text+0x131c): undefined reference to `__dn_expand'
collect2: error: ld returned 1 exit status
Change-Id: If81b292222c78d828b9fef61f30a62f1d584c183
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>