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>
qwindowscombase.h pulls in windows.h so not guarding its content by
including qt_windows.h might cause hard to track down issues like
min/max macros being defined.
Pick-to: 6.5 6.2 5.15
Change-Id: I3c48660ed87122bb0c4f6830c8d0b288ec62a509
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
This issue arose during the comparison of two different ordering types.
When comparing QPartialOrdering::Less to QStrongOrdering::Less, an
unintended overload was considered due to the SFINAE ctor-overload of
CompareAgainstLiteralZero. For example:
static_assert(QPartialOrdering::Less == QStrongOrdering::Less);
would consider:
friend constexpr bool operator==(QtPrivate::CompareAgainstLiteralZero,
QStrongOrdering rhs) noexcept
as an overload. To address this, a stricter approach is now used
by triggering the SFINAE-check on std::nullptr_t instead.
This resolves the ambiguity while still rejecting std::nullptr_t
as intended. As the compiler is unable to resolve this automatically,
this refactoring is required.
Pick-to: 6.5 6.2
Change-Id: I9ab7e55d2822980198f38f5a66143387999a4d94
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Avoids the implicit cast to int, which then fixes the overloading
problem of QDeadlineTimer with older functions taking an integer with
the number of milliseconds. Without this and the workarounds, an
expression like
waitCondition.wait(&mutex, QDeadlineTimer::Forever);
would be the same as
waitCondition.wait(&mutex, 0);
which is the opposite of "forever".
This means we can remove the overloads added earlier this week in
commits 37f1fb78ee (QMutex),
63704529b7 (QReadWriteLock), and
37f1fb78ee (QSemaphore). I hadn't thought
this solution until noting that QWaitCondition needed the same solution
and then remembering how Qt::Uninitialized was fixed of the same
problem.
Change-Id: I5f7f427ded124479baa6fffd176023ddfb91077d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Add an image and a QDoc file, remove the (in some cases misleading)
doc comments from the CPP sources, group the slots all together in the
source so as to document them together, group the two private methods
together. Dust the header lightly with comments to classify the class
members and enclose relevant parts in QDoc snippet markers.
Task-number: QTBUG-111228
Pick-to: 6.5
Change-Id: I0090fb45ce8d5a8f168fde9b3247d541b709c1b2
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
It's cleaner than declaring, using << to populate, then using once.
Just construct it and use it where it's needed.
Task-number: QTBUG-111228
Pick-to: 6.5
Change-Id: Id10483b26937a97899d656c4b26f27b37b8d39b6
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Many slots can be connected to one signal so, unlike a virtual method
that must be named for the situation in which it is called, a slot can
(so should) be named for what it does, rather than naming it to match
the signal it's connected to.
Task-number: QTBUG-111228
Pick-to: 6.5
Change-Id: If2fa40cac0e51a243054526d7d2997fdd54aea3e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
QNetworkAccessManager takes care of doing that by default anyway,
these days.
Task-number: QTBUG-111228
Pick-to: 6.5
Change-Id: I890d258599e22efb6fc6ce0140304a97edcbb3f8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>