We must not pass null pointers to memcpy.
Pick-to: 6.0
Fixes: QTBUG-88780
Change-Id: Ic1d77b4672310a3f6d0d4fbee5f2889e3e4d219d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
As a requirement for unordered_set (and QSet) both "iterator" and
"const_iterator" are const, so we cannot reassign or move the key.
That means this overload is no different to the const & overload, so
we can just remove it.
Pick-to: 6.0
Change-Id: Ia14dccf7f610967649bab38161ce6d963509316b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Previously we only checked if there was something in the h2 queue or
if we had not yet switched to http2. These means in some cases that
following an error it would enter this branch and, because it had not
yet switched to http2, it would call 'ensureConnection' which would try
start a reconnection. This could make the proxy socket engines try to
emit 'auth required' with no replies, meaning nothing happens.
Fixes: QTBUG-88417
Pick-to: 5.15 6.0
Change-Id: If37b8c71ac36597adc305fb1b1ea4fa7b48b0d28
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The requests will remove themselves once they get deleted
but since the deletion is done through a _queued_ invokeMethod
to 'deleteLater' we will call
QHttpNetworkConnection::_q_startNextRequest first which may
end up starting a reconnect of the TCP socket which we had the error on.
In this specific instance it manifested as a race condition where we
either don't get a proxyAuthorizationRequired signal at all (it was
emitted while we didn't have any valid replies), or we get the signal
emitted too late and it gets emitted on whatever the next reply was.
Task-number: QTBUG-88417
Pick-to: 5.15 6.0
Change-Id: If3f8ececc5550f1868c90124559cb8e3029646d8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
We already have all we need in QHash to support this, so the addition
is simple enough.
Add test checking how many copies and/or moves are needed for a single
insert.
As a drive-by: remove some unneeded static_cast
Change-Id: Iaf768657644afa45f78f5c81ffcf89ba9607be96
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Current description was confronting the general description of the
class, which states that prepend() is fast.
The updated description gives more information about the method's
behavior in different conditions.
Pick-to: 6.0
Task-number: QTBUG-87962
Change-Id: I7b6dfb536d143d78c441214f83320c1bf1263e0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QXmlSimpleReader was moved to qt5compat. In the qt6 migration guide, we
would like to point to it. This patch adds qt5compat to the dependencies
of QtXml documentation in order to be able to do this.
Task-number: QTBUG-88533
Pick-to: 6.0
Change-Id: Ifaad595862b80d31310ed594e21168cec56133a0
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
The example was renamed in 6cb36d825d.
Pick-to: 6.0
Change-Id: Ic9daac60002c9988dfeb5c7dcde74edb69388f37
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
In preparation for the next changes.
Change-Id: Ibe0635dfa040842073749aa3e2ae140f27dc983a
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QEventPoint instead of TouchPoint: we have source compatibility for that,
but we can use the new type to avoid the deprecation warnings.
Some position accessors have been renamed too.
Change-Id: I5bfe5bc853931127a883d2bd61fab122495fd427
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
[ChangeLog][QtCore][QSet] Added erase_if() for consistent
container erasure. Added removeIf() as a method.
Change-Id: I4af57b654036aa08bee3f769ab2f60be37115094
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This is refactor/revisit for Qt 6 of the original commit [1]
by Marc, limited to QList and QVLA.
[1] see 11aa9a2276ba5367adbbd96d0ba13111d58145f8
[ChangeLog][QtCore][QList] Added erase() and erase_if(),
for consistent container erasure. Added removeIf() as a
method, complementing removeOne() / removeAll().
[ChangeLog][QtCore][QVarLengthArray] Added erase() and erase_if(),
for consistent container erasure. Added removeIf() as a
method, complementing removeOne() / removeAll().
Change-Id: I2499504e221431ead754dd64cc8a4d4e9f116183
Done-by: Marc Mutz
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QProcessPrivate::tryReadFromChannel() returns 'true' only if we emitted
readyRead() signal on the current read channel. Thus, these additional
checks are unnecessary.
Change-Id: Id98620cd08ee8808f60539c009986b869e517ef0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Add QMetaType::hasRegisteredDataStreamOperators() to complement
the method to check whether a data stream operator exists.
Fixes: QTBUG-82916
Change-Id: Ib2f841131b7c401d5a3ae76d49104e41697c4eac
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
There were two issues:
- Some of the continuations were allocating memory for the
continuation's context dynamically, but deleting the allocated memory
only if they were actually invoked. Since the continuations may not be
invoked at all, this could cause memory leaks. Fixed by postponing the
allocations to the point when the continuations need to be invoked.
- In other cases the parent future is captured by copy in the
continuation's lambda, which is then saved in the parent. This causes
the following problem: the data of the ref-counted parent will be
deleted as soon as its last copy gets deleted. But the saved
continuation will prevent it from being deleted, since it holds a copy
of parent. To break the circular dependency, instead of capturing the
parent inside the lambda, we can pass the parent's data directly to
continuation when calling it.
Fixes: QTBUG-87289
Change-Id: If340520b68f6e960bc80953ca18b796173d34f7b
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
(cherry picked from commit 5d26d40a5596be048be87f309df9264bac741be9)
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
QHeaderView sorting may be triggered when the user performs
some mouse interactions that should really not result in sorting.
Generally speaking, this happens when the user:
* presses on a non-movable section (A)
* moves on another section (B)
* releases on that section
resulting in B becoming sorted / flipping sorting.
(Non-movable is required, otherwise dragging would cause section moving,
not sorting.)
To make the matter worse, QHeaderView doesn't check that the release
happens within its geometry. This makes sense when moving sections: one
is able to drag a section horizontally/vertically even if the mouse
leaves the QHeaderView.
But when not moving sections, this means that one can
* press on section (A),
* move the mouse anywhere vertically (for a horizontal bar, mut.mut
for a vertical) above or below another section (B), that is,
outside QHeaderView's geometry
* release the mouse
and cause B to be sorted.
Fix it by
1) remembering which one was the section that the user originally
clicked on; that's the only one that can possibly become sorted
(if we're not moving and other conditions hold). No other variable
seemed to remember this.
2) on release, check that it happens within that section's geometry.
If so, sort.
Pick-to: 6.0 5.15
Change-Id: Icfb67662221efbde019711f933781ee1e7d9ac43
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The documentation on High DPI was recently rewritten, renaming
several sections. This patch fixes the links which were broken
by this change.
Task-number: QTBUG-88533
Pick-to: 6.0
Change-Id: I5e9417554270a6740986d7cec5e3433d043e5560
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Avoid spurious bindings by resetting the binding state before calling
the setter of eager properties.
Fixes: QTBUG-88999
Pick-to: 6.0
Change-Id: I1e3b5662307d906598335a21d306be9c606529d4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Streaming operators for types used together with QMetaType should
get declared in the same namespace as the type itself because
of C++s ADL rules. Add a note about that to the documentation.
Pick-to: 6.0
Fixes: QTBUG-88990
Change-Id: I5d687576c6d926823dd0f1fec0743e877ae271af
Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
qdoc did not find the hidden friend comparison functions at gave
errors like
qcompare.qdoc:82: (qdoc) warning:
clang couldn't find function when parsing
\fn bool operator==(QPartialOrdering p1, QPartialOrdering p2) noexcept
This patch documents them as if they were class members to fix this.
Document the constants as \variables.
Task-number: QTBUG-88533
Pick-to: 6.0
Change-Id: Ife56f16894e454f324060aeb73f66aba2d45e530
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
On Windows, tryReadFromChannel() just publishes the data that was
already buffered by the pipe reader. Reading from the pipe was still
possible only because the pipe writer enters an alertable wait state
which can trigger an I/O callback for the read operation as well. This
made the implementation unclear and tied to APC behavior.
To avoid this, we now call the "proper" pipe reader wait function
instead, which also unifies the code with the other waitFor...()
implementations.
Change-Id: I7376d7973477a722472ff8763f95f39e6ea2fce9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Currently untested
The socks case is odd: after accepting the first connection it shows as
unconnected. Details as for why is unknown, out of scope of adding this
test.
Pick-to: 6.0
Change-Id: I0e7658f23b89f3af8db379b001ee33a844f3bec4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
One patch from many years ago already did most of it, but the key of
the hash was still int.
Change-Id: I557fa19d2573addbef7557d1a16fdd6554a117cc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It didn't initially have tests. To avoid relying on realizing
breakage implicitly through other classes we'll just add tests instead.
Task-number: QTBUG-88183
Pick-to: 6.0
Change-Id: I7449dc1f9a118d4b7a8158a2c34563dbd9c43c66
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
qt6_add_executable will forward all arguments to add_executable, which
works fine on Windows and macOS in regards of WIN32 and MACOSX_BUNDLE
arguments.
On Android however add_library is being used, and those arguments need
to be removed otherwise they will be consided as source files.
Pick-to: 6.0
Fixes: QTBUG-88926
Change-Id: Id22fdf91d58d9053eaad2d3c080ea72060d928c0
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
int overflows are usually avoided by clipping the qreal coordinates to
the device rect. However the clip function did not handle inf or nan
coordinates, so such values would be passed on. Fix by treating any
line with such coordinates a fully clipped away, i.e. rejecting it,
since it cannot be meaningfully stroked anyway.
Fixes oss-fuzz issue 25330.
Pick-to: 6.0 5.15 5.12
Change-Id: I4646172fc7a7e0a3a5f5cf03ce10ff0fb56b0d03
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
This patch disables four failing unit tests when executed with the
offscreen backend.
Change-Id: Ie67341b886984e6de19cd8dd8a8a237a620a1b7a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
QMetaType::TypeFlag::IsQmlListType was renamed to
QMetaType::TypeFlag::IsQmlList . This change was not reflected in
the documentation. This patch adapts the documentation to this change.
Task-number: QTBUG-88533
Pick-to: 6.0
Change-Id: I70be218f5f72b42aacb15ecd46972d5c808d86de
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
androiddeployqt might be misleading when the path is adir
and the warning says that the file does not exist.
Pick-to: 5.15
Change-Id: I1129f49af58a0637a240fcfd425a61b2ed15c840
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
And also, reduce the utter sloppiness, weirdness of the test and
make it more a test and not a joke. Since the test itself depends
on !QT_NO_SSL, why bother building and running its main, to create
a useless tst_QSslError and do nothing then? Exclude test from
no-ssl build.
Pick-to: 5.15
Pick-to: 6.0
Change-Id: I67879b0de036cbc8c2f75a18f4cf94e6c43c5af0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Unlike the QTextBrowser backend, litehtml does not render elements
inside <iframe> correctly. This prevented external links to
YouTube from working in offline documentation.
Move the <iframe> to a macro override specific to online doc builds.
Pick-to: 6.0 6.0.0
Fixes: QTBUG-88975
Change-Id: Iff7828ddeed353620eaa9ac669a3e0c03749daa2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This enables documentation building in add-ons and other modules that
need to build docs.
Task-number: QTQAINFRA-3972
Change-Id: Ic2763d6d36d26e5a1267b312727c3c268ad6d114
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e84e85dd4c59f2c79f81ba4d8d7f04397eb0003c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use universal references instead of rvalue references for passing
callables in the implementations of QFuture's continuations.
Change-Id: I1288c78f78f84f30c6607e505e7f9807a9272071
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit b002722dabef794da0e80010b115b2c6cd6dc6b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Constructing a QMetaProperty can be unnecessarily expensive due to the
QMetaEnum resolution. Add a private method to construct only
QMetaProperty::Data. Make us of it in indexOfProperty.
Task-number: QTBUG-82931
Change-Id: If954538106bcfaa7d088db26591f6bd6eeaf3731
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>