Commit Graph

61566 Commits

Author SHA1 Message Date
Amir Masoud Abdol
574cf24a65 Replace AUTO_RESOURCE_PREFIX with RESOURCE_PREFIX in qt-cmake-project
Pick-to: 6.5
Change-Id: I53b9e8887e8e79c1c1e836c514171aece8cf35aa
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-05-30 10:38:33 +02:00
Laszlo Agocs
09597d05f7 rhi: avoid backends modifying the frontend depth and arraySize
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>
2023-05-30 10:29:55 +02:00
Laszlo Agocs
afe0bf0914 rhi: vulkan: expose the instance in the nativeHandles query
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>
2023-05-30 10:29:51 +02:00
Topi Reinio
1cd35cff4d Doc: Fix documentation warnings for Qt Gui
* Fix file quoting in RHI Window example
* Add missing \inmodule commands for QRhi Classes
* Add missing dependency to qtshadertools
* Remove documentation for non-existent overload of
  QRhiGraphicsPipeline::setTargetBlends()

Other fixed warnings:

src/gui/rhi/qrhi.cpp:
* warning: clang couldn't find function when parsing
  \fn void setUsage(UsageFlags u)
* warning: clang couldn't find function when parsing
  \fn virtual bool QRhiSwapChain::isFormatSuported(Format f)

Change-Id: I73ff7896c3d5c8bb491368e941b32c8026a47191
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-05-30 08:29:26 +00:00
Andre Hartmann
2a90efcfc2 Diagram Scene: Fix documentation word repetiton
Pick-to: 6.5
Fixes: QTCREATORBUG-29214
Change-Id: I356a6ffbd48bf918208180b8b403b5c74ad368d5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-05-29 19:51:21 +02:00
Andre Hartmann
2297056221 QPainter: Fix missing variable in drawPixmap snippet
Fixes: QTCREATORBUG-29216
Pick-to: 6.5
Change-Id: If055e7b4d6ba7734bc29da29db68b3224fc734c1
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-05-29 19:51:14 +02:00
Mårten Nordheim
57ba6260c0 Ssl: Copy the on-demand cert loading bool from default config
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>
2023-05-29 16:03:35 +02:00
Yuhang Zhao
51becfbd23 CMake: use VS2019's flag for stronger inlining
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>
2023-05-29 05:57:08 +00:00
Ahmad Samir
44cfdfa7c0 Moc: port to qsizetype
Simple s/int/qsizetype/. Fixes some narrowing conversion warnings.

Pick-to: 6.5
Change-Id: Ied82e861298fa9763089cadc7eae6e536f1bb9ca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-28 01:18:56 +03:00
Ahmad Samir
c452a43b59 Moc: only call checkSuperClasses() if the class inherits another
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>
2023-05-28 01:18:53 +03:00
Ahmad Samir
10510c0405 Moc: fix narrowing conversion warnings with iterators/algorithms
Drive-by change: check a QList isn't empty before using first()

Pick-to: 6.5
Change-Id: I24171d17244ae96ad5779d721c65d33e5489f5f3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-05-28 01:18:49 +03:00
Thiago Macieira
26dd7fe4ed CMake: remove "res_ninit" feature and collapse to just "libresolv"
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>
2023-05-27 12:57:16 -07:00
Ahmad Samir
369952fbd7 QTimer: lambdas don't implicitly capture 'this' in C++20
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>
2023-05-27 19:21:44 +02:00
Thiago Macieira
f89c4c4f8f qsimd_x86: update from upstream and enable a few more features
After https://github.com/opendcdiag/opendcdiag/pull/223.

Enabled for Qt:
* waitpkg
* RAO (Remote Atomic Operations)
* CMPccXADD
* avxifma
* LAM (Linear Address Masking)

Disabled:
* AVX-512 VNNI

Change-Id: I5f7f427ded124479baa6fffd1760c35ed5b2adbb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-05-26 16:22:22 -07:00
Thiago Macieira
718dae8e0b x86simdgen: update the Makefile to include the copyright in the .cpp
Drive-by include "DO NOT EDIT" in both files.

Change-Id: Ib5ce7a497e034ebabb2cfffd1762bf1d4ce737eb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-05-26 16:22:15 -07:00
Mårten Nordheim
456cfa0bd2 Network: Fix IFF_UP conflict on Linux with unity builds
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>
2023-05-26 23:06:50 +02:00
Ahmad Samir
f3d0f4f4c3 qgenericatomic.h: fix includes
Change-Id: Ibac2204c971b16da9117c66a18c5c679ed331d3e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-26 19:48:33 +03:00
Ahmad Samir
516aa662a0 Break qglobal.h cyclic includes [3/3]
... 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>
2023-05-26 19:48:32 +03:00
Ahmad Samir
0677d334f8 Break cyclic includes in qglobal.h [2/3]
Task-number: QTBUG-106722
Change-Id: I6cf2b3fcd419659cc8a0633892393febd26e505b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-26 19:48:31 +03:00
Ahmad Samir
43ec3d8d01 Break some include cycles in qglobal.h [1/3]
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>
2023-05-26 19:48:29 +03:00
Volker Hilsheimer
2d9f7633bf Doc: use [since] tag for enum values added in Qt 6.6
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>
2023-05-26 18:48:24 +02:00
Amir Masoud Abdol
966e256116 Make CONFIGS arguments of qt_internal_remove_compiler_flags optional
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>
2023-05-26 18:48:23 +02:00
Alexey Edelev
fec618b723 Ignore carriage return character symbol explicitly
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>
2023-05-26 18:48:23 +02:00
Eike Ziller
47db21965d Examples: Do not add the same category twice
Amends 1371cd107a

Task-number: QTCREATORBUG-29197
Change-Id: I0dd4a08a597c237fd09f788cafb79af755953d0d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2023-05-26 17:44:54 +02:00
Alexey Edelev
18ef6849d2 Add the list of previously searched packages to qt_find_package
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>
2023-05-26 17:44:54 +02:00
Joerg Bornemann
f18842dc38 Remove the -no-gcc-sysroot configure option
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>
2023-05-26 17:44:53 +02:00
Joerg Bornemann
fcf5eb7fee Remove the -silent option from configure-cmake-mapping.md
There's just no good equivalent with the CMake based build.

Change-Id: I923ef3173d631afe2db0bdacc1d02c1f4649b741
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-05-26 17:44:52 +02:00
Joerg Bornemann
360ccedd2c CMake: Remove the -mp configure option
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>
2023-05-26 17:44:51 +02:00
Joerg Bornemann
9639d11687 CMake: Remove the -make-tool configure option
This configure option is dysfunctional since Qt 6.0.
Use -cmake-generator instead.

Change-Id: Idb147ec8087018dab3ac0e571eeff7d1f18e34f6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-05-26 17:44:51 +02:00
Joerg Bornemann
a02be0f1cc Remove -list-libraries from configure-cmake-mapping.md
This Qt5 configure argument does not exist anymore.

Change-Id: I68c798eb2769c93e3ca0b30d6a3da3247e319eee
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-05-26 17:44:50 +02:00
Joerg Bornemann
06f117d7ca CMake: Update USE_FOLDERS comment in qt_standard_project_setup
Mention that CMake 3.26 introduced CMP0143 which enables USE_FOLDERS by
default.

Change-Id: I35deed9838f99f377657ca19a4e6058e1ecbedcf
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
2023-05-26 17:44:49 +02:00
Ievgenii Meshcheriakov
1538d30c76 qdbusxml2cpp: Use modern string literals
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>
2023-05-26 15:46:37 +02:00
Ievgenii Meshcheriakov
f6be12f2f9 qdbusxml2cpp: Combine string literals
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>
2023-05-26 15:46:36 +02:00
Ievgenii Meshcheriakov
464bcc0b6a qdbusxml2cpp: Use "\n" instead of Qt::endl
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>
2023-05-26 15:46:35 +02:00
Ievgenii Meshcheriakov
4f65f91d6f QDBus: Fix typo in a function name
Rename connectionCapabilies -> connectionCapabilities

Change-Id: I07deff1b944b30404548181d5c930b76fb1a575c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-26 15:46:34 +02:00
Marc Mutz
c7af8d5808 Deprecate qAsConst()
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>
2023-05-26 15:46:34 +02:00
Thiago Macieira
432d67b43f QDnsLookup: add TimeoutError for timeouts
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>
2023-05-26 06:46:33 -07:00
Thiago Macieira
5ecdce0c35 QDnsLookup/Unix large replies: manually handle VC [3/3]
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>
2023-05-26 06:46:32 -07:00
Thiago Macieira
df07d98243 QDnsLookup/Unix large replies: use EDNS0 [2/3]
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>
2023-05-26 06:46:31 -07:00
Thiago Macieira
b673fa09c3 QDnsLookup/Unix large replies: use res_nmkquery & res_nsend [1/3]
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>
2023-05-26 06:46:31 -07:00
Samuli Piippo
4a46ba1209 network: fix link issue with older libc
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>
2023-05-26 06:46:30 -07:00
Giuseppe D'Angelo
2794742fac QLogging: fix indentation
Just a whitespace change.

Change-Id: Ib54cb2f8c49c0cece3ff9b85f290c0c21eb85487
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-26 11:10:06 +02:00
Oliver Wolff
cbf29a8720 Guard qwindowscombase.h with qt_windows.h include
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>
2023-05-26 06:17:24 +02:00
Dennis Oberst
1d487e5593 CompareAgainstLiteralZero: fix SFINAE considerations
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>
2023-05-25 22:04:57 +02:00
Thiago Macieira
5f531ae2ac QDeadlineTimer: make the ForeverConstant an enum class
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>
2023-05-25 08:43:52 -07:00
Thiago Macieira
b5c9eec15c Enable QT7_ONLY for bootstrapped mode too
Change-Id: Ib5ce7a497e034ebabb2cfffd1761e2ab9a335103
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-25 08:40:38 -07:00
Edward Welbourne
f2ab85429d Document the RSS Listing example
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>
2023-05-25 17:40:38 +02:00
Edward Welbourne
2e09d03cd1 rsslisting example: use initializer list to construct string list
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>
2023-05-25 17:40:37 +02:00
Edward Welbourne
3c78f1e96e rsslisting example: rename a slot to reflect what it does
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>
2023-05-25 17:40:36 +02:00
Edward Welbourne
fe2af0f8a3 RSSListing: remove metaDataChanged slot to handle redirects
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>
2023-05-25 17:40:35 +02:00