I don't know which of the previous commits caused this: as far as I can
tell, this test should never have passed.
Pick-to: 5.15 6.0
Change-Id: I55083c2909f64a1f8868fffd164e7e8c24eec1f8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Because CBOR strings are encoded in UTF-8, it's possible that the string
that won't fit a QString in UTF-16 would still fit QByteArray in UTF-8
(e.g., anything US-ASCII and most Latin text).
The previous solution was an improvement because we used to read into a
QByteArray then convert the QByteArray to QString, thus using 3x the
amount of memory (1x in QByteArray, 2x in QString). The previous commit
skipped the middle allocation and made the regular readString() function
do the decoding either directly on source memory or by reading in small
chunks (16 kB).
Future improvement for Qt 6.1: add readStringChunk(char16_t *, qsizetype)
so we can do the validation / skipping at O(1) memory.
Pick-to: 5.15 6.0
Change-Id: I7b9b97ae9b32412abdc6fffd1645458c655cc566
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This allows us to decode long UTF-8 strings in chunks, instead of
allocating a big block of the size of the UTF-8 source and then another
for the full UTF-16 content.
Pick-to: 5.15 6.0
Task-number: QTBUG-88253
Change-Id: I7b9b97ae9b32412abdc6fffd16452a47b1036ef3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
If the error occurs during the call to
QHttpNetworkConnectionPrivate::queueRequest coming from the http thread
delegate then we will not yet have connected to the signal! But the http
thread delegate checks if the error code is not NoError, and handles
those situations. To let that work we must update the replies.
Pick-to: 6.0 5.15
Change-Id: I47188e9439920694aaad1765ab28add1e86ccdff
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Can't be done before Qt 7 unless we do it now, as it'd be BiC.
Task-number: QTBUG-86400
Change-Id: Ib7b2e7b20b4a80b53dfc6535efe90d1674f38e81
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 53a1e015fdb4082900f306b5e2cca7bd5df77d03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Compiler (gcc) keeps nagging and complaining about an address of function
to be never nullptr in any particular instantiation, when argument is an
address of a function.
Change-Id: If67e80f2ff4d408608429d53814083777cc8441c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
In some case CROSSCOMPILING_EMULATOR property is not INHERITED and is
set to 'NOTFOUND' by get_test_property. Force it to empty string in
this case.
Add missed 'name' argument to '_qt_internal_wrap_test'. 'name'
previously was used from parent scope.
Pick-to: 6.0
Fixes: QTBUG-88053
Change-Id: I5286bcb9b11659f638e178ce52172dfee994fc34
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The QPropertyAlias example did not compile and comments were out of
sync with code. This patch fixes both.
Pick-to: 6.0
Change-Id: I5717f8df99f4936d0bcbae8df7d2d17e8086951d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The comments in the QProperty examples slightly mismatched the
implementation. This patch fixes it.
Pick-to: 6.0
Change-Id: I03cfb35c024fad8ea4eaa5d5db220e1907f06bc3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Amend to 8738f09b9f.
The last frame of animation might be lacked if [_skip < fps].
Fixes: QTBUG-89118
Pick-to: 6.0 5.15
Change-Id: Ia0345e2aff7579afe2d60c4e7495bfaa1f36198c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
C++ comment was terminated by "/" instead of "*/"
Task-number: QTBUG-88533
Pick-to: 6.0
Change-Id: I560b69602856009509781e56df36fee5879a297f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
As the standard library does not provide equivalent functionality, those
functions are really useful to everyone, not only to Qt itself.
[ChangeLog][QtCore] The overflow-safe math functions qAddOverflow(),
qSubOverflow(), qMulOverflow() were added.
Change-Id: I5a0a4742dae9b6f0caa65d0e93edcf3658bee9f8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The qmake variable QMAKE_APPLE_DEVICE_ARCHS was added for iOS,
to support universal builds, as the QT_ARCH is a single value.
Since the qmake macOS builds are non-universal (at the moment),
we remove the hard-coded value for QMAKE_APPLE_DEVICE_ARCHS on
macOS, and let the normal architecture test resolve the arch,
like on other platforms.
To ensure that the following configuration tests are run with
an -arch argument, we trigger a commit of the preliminary Qt
configuration after running the architecture test. This is not
strictly necessary, but makes it clearer what's going on during
configure.
The device_and_simulator configuration option was used by the
iOS toolchain, and needed to be moved up in the configuration
test order to not break later tests.
The logic in mac/default_post.prf for both Xcode and Makefiles
to add -arch flags was kept as is, based on the existing
variable, to avoid too many changes to this logic.
The logic in toolchain.prf was amended to make it clear and
ensure that it only applies to iOS builds. macOS builds do
not have this issue.
Pick-to: 6.0
Pick-to: 5.15
Pick-to: 5.12
Change-Id: I70db7e4c27f0d3da5d0af33cb491d72c312d3fa8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Add custom targets with '_benchmark' suffixes to make run of
benchmarks using generators possible, e.g.:
$ ninja tst_bench_qudpsocket_benchmark
Extend '-[no]make' option to pass benchmark. Rework
'-[no]make' processing to unify these options processing.
Also looks like it doesn't make sense to enable benchmarks without
having test enabled. So '-DQT_BUILD_BENCHMARKS' enables test as own
dependency automatically.
Task-number: QTBUG-89076
Pick-to: 6.0
Change-Id: Ieee9eadaf6d75a1efec120242d6eb786ace1b071
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Dropped the RTEMS patch (upstream now uses posix_madvise).
Drop support for the TILE architecture (dropped by upstream).
[ChangeLog][Third-Party Code] PCRE2 has been updated to version
10.36.
Pick-to: 6.0 5.15
Change-Id: Idb4467bef0ff520605b8b5d9188b9d67d8e4d0f2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Looking at grafana it rarely fails in dev so unblacklisting it.
Though it is a little more flaky after switching to http 2 by default
because then we only have one channel and more requests end up queued in
the same channel, which will get errored out when the server
disconnects.
Task-number: QTBUG-88943
Change-Id: If5d6335864ce6bbc35f519b2c6d7068e4181afd2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
headFromHttp hasn't been flaky since 5.14 times according to grafana,
does not fail locally.
Same situation with ioHttpRedirect as above.
ioHttpRedirectMultipartPost has not failed on Windows since october
2019, assumed stable now.
backgroundRequestInterruption no longer exists.
ioPostToHttpFromSocket would fail in debug MSVC builds but was
fixed in 710886fbdd.
Task-number: QTBUG-88943
Change-Id: Ida640179ef15a3452291745e4e94a71a385f57ae
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The intention was always that you can define properties that do
not require a changed signal. But having to explicitly pass
a nullptr as signal parameter into the macro is ugly, so
use the cool QT_OVERLOADED_MACRO to make it optional.
Pick-to: 6.0
Change-Id: I0ce366d043850f983c968d73c544d89933c48df9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The windows library user32 is no longer a known library for qmake; add
it explicitly.
Pick-to: 6.0
Change-Id: I61f44e8a2cbccbabbdc5d58bd2615b431097aafd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
When a CMake release introduces a new policy that affects most Qt
modules, it may be appropriate to make each module aware of that newer
CMake version and use the NEW policy without raising the minimum CMake
version requirement. To reduce the churn associated with making that
change across all Qt modules individually, this change allows it to be
updated in a central place (qtbase), but in a way that allows a Qt
module to override it in its own .cmake.conf file if required (e.g. to
address the issues identified by policy warnings at a later time). The
policies are modified at the start of the call to
qt_build_repo_begin().
For commands defined by the qtbase module, qtbase needs to be in
control of the policy settings at the point where those commands are
defined. The above mechanism should not affect the policy settings for
these commands, so the various *Config.cmake.in files must not specify
policy ranges in a way that a Qt module's .cmake.conf file could
influence.
Starting with CMake 3.12, policies can be specified as a version range
with the cmake_minimum_required() and cmake_policy() commands. All
policies introduced in CMake versions up to the upper limit of that
range will be set to NEW. The actual version of CMake being used only
has to be at least the lower limit of the specified version range.
This change uses cmake_minimum_required() rather than cmake_policy()
due to the latter not halting further processing upon failure.
See the following:
https://gitlab.kitware.com/cmake/cmake/-/issues/21557
Task-number: QTBUG-88700
Pick-to: 6.0
Change-Id: I0a1f2611dd629f847a18186394f500d7f52753bc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Both on Unix and Windows, _q_processDied() unconditionally releases all
resources associated with the terminated child process, resets QProcess
to the initial state, and emits finished() signal. Thus, we can omit
reporting success, which also eliminates the related checks from
callers.
Change-Id: I40e32d1a9ccc8d488be6badba934355d734a8abd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
One was only called once. For the other, one of the calls wasn't
necessary.
Pick-to: 5.15 6.0
Change-Id: I7b9b97ae9b32412abdc6fffd16454eec59d72b8a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Similar to the previous commit which applied to QCborStreamReader, don't
allocate too much data before checking that the stream actually has that
much.
Pick-to: 5.15 6.0
Fixes: QTBUG-88256
Change-Id: I7b9b97ae9b32412abdc6fffd16454b7568a063ba
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
By calling the internal readStringChunk() function with a QByteArray
pointer, QCborStreamReader::readByteArray() can now avoid allocating the
resulting buffer until the internals have confirmed that there is
sufficient data in the incoming buffer. As a result, we first detect the
EOF condition before we conclude the payload would have been too big for
QByteArray (validation()) test. Meanwhile, the hugeDeviceValidation()
test ends up with a few conditions where it would have copied 1 GB of
data, so limit that too.
We make a choice of reporting OOM vs DataTooLarge only if QByteArray
fails to allocate in the first place (QByteArray::resize() ->
Q_CHECK_PTR -> qBadAlloc, QtCore is always built with exceptions on).
The QCborValue unit test needed a temporary work around until we apply
the same allocation fix (see next commit).
Pick-to: 5.15 6.0
Fixes: QTBUG-88253
Change-Id: I7b9b97ae9b32412abdc6fffd164523eeae49cdfe
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
And add a currently-unused QByteArray pointer parameter. This function
will resize the array as necessary as data comes in.
Pick-to: 5.15
Change-Id: I7b9b97ae9b32412abdc6fffd16451f5c6b280f3b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The QByteArray documentation is extended to align with QList and
QString regarding common wording and ideas:
- Extend general class description
- Revise description of several methods
- Wrap descriptions at 80 characters
Pick-to: 6.0
Task-number: QTBUG-87962
Change-Id: Ie9e8ef47a85d0867c2fa63889a60cafbe76ee47a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
So these two classes throw when trying to allocate silly sizes or in OOM
conditions.
We probably want to move these Q_CHECK_POINTER into QTypedArrayData but
I didn't want to do that in this commit.
Task-number: QTBUG-88256
Task-number: QTBUG-88253
Change-Id: Ifc61bb80b9bf48a386abfffd1648176111770174
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Wrap Qt tests to handle TESTRUNNER and TESTARGS environment variables.
Variables are handled according to qmake build procedure. All test
now are wrapped by generated CMake script.
Fixes: QTBUG-88053
Pick-to: 6.0
Change-Id: I339977ce6ce11ddd38a4bf0bd26eb8f2ae463ba3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Employ the same kind of optimization existing for removeAll/erase.
Change-Id: I0781cc02d4430ceab60e6e50a5ffe6fde87be9ce
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The old link zstd.net is not working any more. Zstandard is now at
http://facebook.github.io/zstd/. To ease maintenance in the future,
those links now point to "Zstandard Site" which is maintained in
external-resources.qdoc.
Task-number: QTBUG-88533
Pick-to: 6.0
Change-Id: Ic8f067fd5d7ce1a088d0272797fca98fd506a26e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We don't want to (officially) expose customizations like this
to the user, now that high-DPI is always enabled and should
work.
Change-Id: I2f0bd7c625b565896b0766586f191ff5001eb60a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
At the same time I'll add a generic protection against being called in
unprotected mode in the schannel backend (openssl already has it in a
different form).
Pick-to: 5.15 6.0
Change-Id: I97c1be6239c27e306de0af7ad568fbcfde09da71
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
We want to remove the Qt .pro files for projects, except examples,
because examples are still meant to build with qmake.
To not lose coverage on examples built with qmake, add instructions that
will build the qtrepo/examples folder with qmake when the CMake
configuration has -DQT_BUILD_EXAMPLES=ON.
This means that such configurations will build examples both with CMake
and qmake.
Aside from making sure that our examples will still build with qmake, it
will gives us some some coverage that a CMake-built qmake works
correctly.
Implementation-wise, add new instructions files that can call qmake and
make depending on configuration and target type.
Pick-to: 6.0
Fixes: QTBUG-85986
Change-Id: Ie8f4cbcda03c94da2aef455e32f48dad41a4bdb0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Previously a default constructor was required for the result type
of mappedReduced() and filteredReduced(), even if a default value
was provided.
This patch fixes the problem.
The issue was in the ResultReporter type, that was calling
QList::resize() to adjust the size of expected reported results.
A default-value parameter was added to the class, so that
a corresponding overload of QList::resize could be invoked.
Task-number: QTBUG-88452
Change-Id: I51113753e314d76aa74d201b5a7e327a6ca75f47
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
QColors were not premultiplied before being set.
Pick-to: 6.0 5.15 5.12
Change-Id: Id3765b6932a72374ddfd788fae4bb628a4edf0b7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>