If INSTALL_LIBEXECDIR was set to something != "libexec",
qt-configure-module contained the wrong path to qt-cmake.
Fixes: QTBUG-128137
Pick-to: 6.7 6.5
Change-Id: Ic095ff8cb804bbdd72e238e75ac867b7cc3bd478
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 12b0f73a9e9cef35395d0a1560a51604c1c054ff)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
lastIndexOf will convert the `needle` to unsigned char, which is then
'upcast' to int, before we search. But the string itself was searched
using signed char, meaning any values with the signed bit set would
mismatch.
Add tests for indexOf and lastIndexOf.
Amends 4c12ae7e67
Fixes: QTBUG-128199
Change-Id: I0ce7d7d9741f21650ef6f0f012a94e00d84a0f02
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7b1f3bdc503ea7aceacc9fa8d388d843f1d7b131)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We want to be able to index into the metaobject from code generated by
qmltyperegistrar. And we don't want to rely on some implicit promise
that certain methods are in the "right" order in the output. This is
similar to what we've done with properties.
Change-Id: I8d97b65598338fcff57c6b0866708232066c94cb
Task-number: QTBUG-127442
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 484e72a1074279dca1253ae07515461ad231de3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Check the PROJECT_NAME but not CMAKE_PROJECT_NAME when attempt building
sqldrivers. This should be save since we expect that the project() is
called pre-Qt repo.
Task-number: QTBUG-127953
Change-Id: Ief3f11ba747ded0984ccfe1cfa6b7b47da538137
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3e1a223318dbda50a010ba851841a9e51c80c42b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
eb60e94020 refactored the QString::replace
helpers as to avoid a full copy of a string (when detaching) only to
then modify it in order to apply replacements into the new copy.
Unfortunately it also introduced a regression: if we are replacing into
a string that does not need detaching (that is: it's non-static and
there are no shallow copies of it), and the string does not have
sufficient capacity, then the code chose to allocate a brand new string
and do piecewise copies/replacements into the new string.
This is suboptimal, as it precludes the possibility that the string gets
reallocated in place (via a realloc() that doesn't actually move the
string data in memory), which is a huge performance win. (It also
precludes the possibility of compacting the string data "to the left" in
case we do have sufficient capacity, but not at the "right end".)
This caused a 3x slowdown when replacing in large strings.
Solve this by removing the capacity check and unconditionally
reserve()ing enough space so that we can then do in-place replacements.
Change-Id: I921e3ea65222eca8125996d8d3ea77e9c09ba205
Pick-to: 6.7
Fixes: QTBUG-127549
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 315210de916d060c044c01e53ff249d676122b1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead, the package name should be determined by the sub-attribution
target name. Otherwise the build system will try to generate multiple
files with the same name, but different content.
Amends 5daabb5a74c4e7c5d087da7f9207d79d2ee05b13
Task-number: QTBUG-122899
Change-Id: I10b4ec2fe8f38d70d13918dc980d1bd1d9145cb6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d624592ca40e05033432de72e0c4d9f6570b5544)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A project's root qt_attribution.json file might be picked up by the
build system when recording system libraries for SBOM processing.
One such case is qtgrpc.
This caused generation errors in qtgrpc with the following message:
CMake Error: Files to be generated by multiple different commands:
qt_sbom/SPDXRef-Package-qtgrpc-qt-3rdparty-sources-WrapProtobuf.cmake
This started happening since the SBOM options are now implicitly
propagated to auto-created attribution targets, and each attribution
target attempted to generate to the same partial sbom file.
Any qt attribution file in the project root is not intended to be
used for system libraries, so explicitly disable using the
root attribution file for all system libraries.
As a more long-term fix, we should consider making the partial sbom
files be more unique.
Amends 5daabb5a74c4e7c5d087da7f9207d79d2ee05b13
Task-number: QTBUG-122899
Change-Id: I67544c299e630597f26602d270cd1dfd54cccfb6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 55b399fdcd12bdfc645d4ec7d25b3c881d11a09a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The Java QtQmlComponent has been renamed to QtQuickViewContent
as a part of API reviews.
As a result, we also change the opt-in flag
From QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS
To QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS
that adds an entry to the android-deployment-settings.json.
The flags later will be used by androiddeployqt to enable the
generation of QtQuickViewContent extensions.
Task-number: QTBUG-126976
Task-number: QTBUG-127091
Change-Id: Ie08a9430a5e5a16809f78389144a4a6dfd87ce18
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit be2c03064cdb7bef977d05371e535bedcadb3a0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This class is being moved from QtDeclarative to QtCore as a part of
API review resutls.
Task-number: QTBUG-126976
Task-number: QTBUG-127082
Change-Id: I1c7a20daeb0d398bc6faad441ebae6136b4a88ba
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0acdceed353da61c3c3e1392d0af0d4ecd640821)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QtAbstractItemModel used to be a part of QtDeclarative
and is being moved to QtCore based on API reviews.
Task-number: QTBUG-126976
Task-number: QTBUG-127089
Change-Id: I28a921a113ec4f3ad298bf55b40aea334e7721cf
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit baed8a24d07de87da61e9d5e3dbffc8d8ca92918)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These classes used to be a part of QtDeclarative and are being moved
to QtCore based on API reviews.
Task-number: QTBUG-126976
Task-number: QTBUG-126977
Change-Id: Ic269f23ca2292031cda62faf41428667889537d0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 55fc15ce8272073b9b404762b83e3e7acee0111e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This can be used to configure extra cmake args for the documentation
build in coin.
Change-Id: I11417bee9630aebe0bbc118cd843b1536101da71
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b956a909c5ff29bf9824c054750966bdec42c6ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a part of API review changed of Qt 6.8. These private
APIs are being moved from QtDeclarative to QtBase.
Task-number: QTBUG-126976
Task-number: QTBUG-127087
Change-Id: I9bfdb7dea12a2fb6a179d87639364ae28c39243b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 4413c81c483fda125928392eb32e3320068a872b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Iterators no longer provide it, because they may need to return a
temporary in some occasions.
Fixes: QTBUG-128102
Change-Id: Ide0a7a84f612fff73afffffd49889321cb70505f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit cb40a1fa7f4b06acced1d17e8333742084092f9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We maintain the CBCentralManager in a retained property, which we
nil when we're done processing the callbacks. But the manager may
still be kept alive by other parts of the system, resulting in
callbacks to our delegate, where we would assert on the check
that the delegate callback manager matched our stored manager.
The conditions for the assert to occur:
- debug build (Q_ASSERT)
- permissions are actually requested
- bluetooth is toggled ON or OFF
This patch fixes this so that the listening delegate is
nil'd and therefore no additional callbacks are received.
Pick-to: 6.7 6.5
Change-Id: I1439881fd55bdfd42bc27ee57f26826fc66c3d85
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b45d26f59368f530330b7d547846b5a74d80d585)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace deleteLater with destroyWatcher.
If the continuation is called from a separate thread,
emit watcher->run() can't detect thatthe watcher has
been deleted in the separate thread, causing a race
condition and potential heap-use-after-free issue inside
QObject::doActivate. destroyWatcher forces the deletion
of the watcher to occur after emit watcher->run()
completes and prevents the race condition.
Fixes: QTBUG-126013
Fixes: QTBUG-127880
Pick-to: 6.7
Change-Id: Id5f80ad0ec3fbd2d9c1e0d134aecd6b08ba2c79c
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 2bc82f6a1126025affd6e891efc386c08d5fa013)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
text() looks up `text/plain;charset=utf-8` but the hasText() function
has no matching check.
Pick-to: 6.7
Change-Id: Id309cd3bd11003813057704338beb36c65974f4a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 014fb179d81456577c745418017e333faeb1f08e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There are doubts that the implementation would result in a huge
template bloat. Also, compareThreeWayMulti() seems to be inefficient,
because it copies the tail over and over again.
Rewrite the comparison helper functions to get rid of the
compareThreeWayMulti() calls. This also allows us to drop the asTuple()
method.
Amends ece36a7394.
Found in 6.8 API review.
Change-Id: I8be4e5f56c350039acde78c2e591e29773f3472c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 564f2cbbddbca3f118198f0fb4ca0a97b95b8a59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The ODF writer would ignore the default font set on the document
and just output default values according to spec, such as "Sans"
for the font family.
With this patch, any settings set explicitly on the default font
will be taken into account, granted that they are not overridden
by any properties in the QTextCharFormat.
[ChangeLog][Text] The ODF backend to QTextDocumentWriter will now
respect the default font set on the QTextDocument.
Fixes: QTBUG-124570
Change-Id: Ia937420f7f721bbf3264661160cb0a593907358c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 77a9a208227ecf750d620b3048053fd4fc4299a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
emsdk 3.1.62 changes the EM_BOOL type from int to bool. We were
using int in two places in the wasm platform plugin.
Use EM_BOOL instead to stay compatible with emsdk editions earlier
and and later than 3.1.62
Pick-to: 6.7
Change-Id: I837e76f869225859643dd5a98a28a1eefb5f14a4
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
(cherry picked from commit 48beca4e7635cf2031c6707042d623c4daf44778)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Also split up the CPE handling to allow for more values to be set,
rather than preferring the first one that is encountered.
Task-number: QTBUG-122899
Change-Id: I3209cb5d66f5483c7294b40816431d9df75e00e5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 47fd38be4bce0958fcfce8080d1580c4e3c2a15b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Using a single PURL for a target is not enough to represent all the
information that an SBOM processing tool might want to know about.
For example for the bundled harfbuzz package, we want to inform at
least about two versions: the upstream version that was originally
imported into Qt sources, and the Qt version or sha1 of the sources
that were used, because the 3rdparty code might have been modified and
there might be new Qt-specific vulnerabilities.
To handle this, we need to generate multiple PURLs for a single
target.
Introduce six new options to be understood by qt_internal_add_module
and other SBOM functions:
- PURL_QT_ARGS
- PURL_MIRROR_ARGS
- PURL_3RDPARTY_UPSTREAM_ARGS
- PURL_QT_VALUE
- PURL_3RDPARTY_UPSTREAM_VALUE
- PURL_MIRROR_VALUE
The first three options take multiple arguments, and will generate a
PURL for each used variant, based on the purl parsing options that
were previously handled. For example passing:
PURL_3RDPARTY_UPSTREAM_ARGS
PURL_TYPE "github"
PURL_NAMESPACE "harfbuzz"
PURL_NAME "harfbuzz"
PURL_VERSION "v8.5.0" # tag
will generate a PURL pointing to the upstream harfbuzz repo hosted
on github.
The next three options allow specifying a purl value directly as a
single string, rather than as separate parts. This might be useful
when the PURL is pre-constructed and read from a qt_attribution file.
Example:
PURL_3RDPARTY_UPSTREAM_VALUE "pkg:github/harfbuzz/harfbuzz@v8.5.0"
When no arguments are specified, targets like Qt modules or Qt
3rd party libraries will have automatically generated QT and MIRROR
variant PURLs that point to code.qt.io and github.com, along with
important info like the version and subdir source path for a given
target.
Third party libraries are expected to be manually annotated with a
3RDPARTY_UPSTREAM variant PURL that points to the original upstream.
In a future change, these will be read from a qt_attribution.json
file.
The final set of generated PURLs for the harfbuzz package might look
like:
pkg:github/harfbuzz/harfbuzz@v8.5.0
pkg:github/qt/qtbase@5018b71e99f?library_name=BundledHarfbuzz#src/3rdparty/harfbuzz-ng
pkg:generic/TheQtCompany/qtbase-BundledHarfbuzz@5018b71e99f?vcs_url=https://code.qt.io/qt/qtbase.git@5018b71e99f&library_name=BundledHarfbuzz#src/3rdparty/harfbuzz-ng
Additionally a few more purl parsing options are added.
Add a PURL_USE_PACKAGE_VERSION option that will use the
qt_attribution.json or custom PACKAGE_VERSION value as the PURL
version, so it doesn't have to be manually specified.
This is an opt-in, and not the default, because some attribution
files contain plain text, white-space separated, strings as the
version value (like the 'sha3' 3rd party lib) which ends up generating
a broken PURL and a failing JSON conversion of the SBOM.
So we have to manually annotate targets that should use the
attribution json package version, until a better way to handle this
can be found.
Add a PURL_VCS_URL option that will generate a PURL qualifier (a HTTP
query parameter) with the given value, to indicate to SBOM-processing
tools what is the upstream repo URL for the package.
They can use this information to display known vulnerabilities for the
package hosted at that URL.
This is mostly useful for the generic QT purl variant, and is
automatically generated for Qt entity types.
Task-number: QTBUG-122899
Change-Id: Ie000b01b478bef4bff6f4803dd39e37b7a8055d5
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit f7e1123620b623be0c321b54eaba7a1d618a7ce1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They should inherit the version of the 3rd party library they are part
of, and not be treated as Qt modules.
Task-number: QTBUG-122899
Change-Id: Ibf99f4481fbc1acca488fc96cca048298b080d35
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b17dfbbb992b1d38d7a1aeb2b0109bab9cb1e4e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously if an option like CPE was passed to a 3rd party target that
would create nested attribution targets, one per entry in the
attribution file, the CPE option would only apply to the first /
parent target, but not to the nested targets.
This change will now propagate all SBOM options to the nested targets,
but only if the parent target is not a Qt entity type like a module,
plugin, etc, which means it will only apply to 3rd party attribution
targets. The restriction is there because because mostly only 3rd
party attribution targets should inherit the same set of CPEs and
similar SBOM values.
If the restriction proves to be too strict, it will be re-assessed in
a future change.
Task-number: QTBUG-122899
Change-Id: I96cfa046ad611c10877b7a06504b35615b539bbe
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 5daabb5a74c4e7c5d087da7f9207d79d2ee05b13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The separator was changed at CLDR v44 to use a plain aleph, U+0623,
rather than the U+0627 aleph with hamza above previously used. This
is, in both cases, followed by U+0633, "seen".
Task-number: QTBUG-121325
Task-number: QTBUG-126060
Pick-to: 6.7 6.5
Change-Id: I013525e0876c4c47111846135c9311e7b3442dd3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 45ec096672a67db01d29f78e7e910bebab36e31b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Unify the wording "running" and "active".
"Running" seems more natural, so keep that wording,
and replace "active" with "running" in API docs.
Change-Id: I300f530d1cfe789f74ed32f57afe9388f2127ead
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 94f87d6d65f42140dbf58b8c6badd1a4c61c8c76)
Empty transfer is caused by using its password,
resulting in a crash
Pick-to: 6.5
Change-Id: I2b208ce48b5abc2adea3278d875f3005cda77a8b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8143e85bb4706799f9275c25b2caf72b22b457a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While other compilers don't seem to have trouble with this, the latest
NDK (27) compiler does. That compiler diagnoses the empty-pack case, even though in that case there is no actual use of declval, as the pack-expanded expression contains no use of declval.
For other compilers, that may work for functions that have no arguments, but will not work for any function that does have arguments; in that case, the attempt to use declval will always be ill-formed, and there will be an attempt to use declval.
The fix is straightforward; we have a Ret(*)(Args...), its return type
is simply Ret. So use a simple trait instead of the result of a call.
Task-number: QTBUG-127468
Change-Id: I0dc9e1201914ab94acc2940870be7c6d8cb16c12
Pick-to: 6.7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 236c6ec6f4c777d0534539f1c293cfc74006a6eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix polishing QCommandLinkButton in Windows 11 style: The condition
for QCommandLinkButton needs to be checked before the condition for
QAbstractButton; otherwise it is never entered and the colors from
the Vista style are used breaking darkmode.
Pick-to: 6.7
Change-Id: Ie9e1c20b38a52b2d72f28279e38deb533595b974
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit a17c34d2b7ef8391e5485d0ba06966ece793d184)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix the name of the env var in the debug output for QT_LOGGING_CONF
and adjust the documentation to not suggest to add quotes around the
value of QT_LOGGING_RULES as this will not get properly parsed.
Change-Id: I2da4f841c42c6af6e73d09f19d9baada3582bcd1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 753d035e152f0572ba99717d04116a882a506bef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After qbswap() has run, the Id128Bytes active member is data64, yet
the rest of the QUuid constructor accesses .data. This is UB.
Use the void* dest overload of qbswap() or memcpy() the Id128Bytes
into a char buffer and consume data from there instead.
Amends 686c02224c.
Task-number: QTBUG-120637
Pick-to: 6.7 6.6 6.5
Change-Id: Iba62a692391a5600b867c30dcb3bc50b82ee072f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f5b7e8a3fbc27082651b8eda08f1fe4ff7d70f3f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Despite using different code paths, both stop and then
re-start an already active timer, which invalidates
the id().
While at it, port the occurrences of timerId() to the
modern function id(), which exists in both QTimer and
QChronoTimer
Change-Id: I5db099b198b1c11e1cdbd0fbb30ecece5d0135c8
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit ea0f8cee55e56d0f03ea9a185faee328b5cfa7bf)
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
QMimeDataPrivate::retrieveTypedData() converts if the target MIME type
is text/plain or if the target meta type is QByteArray.
Fixes: QTBUG-127296
Change-Id: I4878533dcb2d4b3e8efefffd17e49ade9fbb32f8
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 05aaf2a684e49d6034f3860fb55a70e75de61e49)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of mapping QAccessible::Border to ATSPI_ROLE_FRAME
("A top level window with a title bar, border, menubar, etc." [1]),
map it to ATSPI_ROLE_PANEL ("A generic container that is often used to
group objects."), as widgets using that role (in particular QFrame)
are not top-level windows, but rather containers for other widgets.
[1] https://docs.gtk.org/atspi2/enum.Role.html#frame
Fixes: QTBUG-127552
Pick-to: 6.7 6.5
Change-Id: I565793b6e02903402cfc764e2e38d391a2960af1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a19d66385fc9fa13ce5ee811386ad104c0718941)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If we own the byte device we can just delete it directly when we are
done with it.
Change-Id: I9da99943ff61925f6f5416df403bcd747c2558d5
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
(cherry picked from commit 4bc878ff4fbacd39d4c0ed1e8e742fd18fa74fed)
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
We now assume that is_integral works for qint128 if QT_SUPPORTS_INT128
is defined, so we no longer need to roll our own version of
std::is_integral.
Amends 0d85d0a72f (which is in 6.7, but
we're only guaranteeing that std::is_integral works for qint128 since
6.8, so not picking all the way).
Task-number: QTBUG-119901
Task-number: QTBUG-117637
Change-Id: I0651f1f17c1abfe4dc2b2d08ae4304fc8dcae092
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit da580a12b10f33fcff5783ca595d1c53b5b8b7de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A previous commit disabled QT_SUPPORTS_INT128 if the Standard Library
doesn't properly specialize <type_traits> and <limits> for the 128-bit
types, like libstdc++ in strict mode. As a consequence, we now need to
compile Qt in non-strict mode so QT_SUPPORTS_INT128 is true when
building Qt, at least if the compiler supports 128-bit integers in
principle.
Statically assert that QT_SUPPORTS_INT128 is defined if the compiler
in principle supports it, to catch other problematic platforms early.
We have a few out-of-line implementations that should be built if the
compiler supports int128 in principle, so that Qt users are free to
use the types if their compiler supports them and not run into missing
support in the Qt library. This patch ensures this.
Compiling in non-strict mode removes the early warning we were getting
from it, but a) headersclean still uses strict mode, so at least our
headers are regularly checked and b) this is a cross-platform project;
if we were to use platform-specific extensions unprotected, other
platform's compilers will still complain.
Fixes: QTBUG-119901
Change-Id: I974f95ca0f26085dd0fe5ceb8bbef4f62467979a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 30e04340dac26ebd09f9bc8ceb598e873ab63ba7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It turns out that libstdc++ in -ansi mode defines __SIZEOF_INT128__,
but not the corresponding specializations of <type_traits> and
<limits>. This has caused numerous pain points over time, esp. since
is_signed doesn't work, so qt_saturate e.g. can't be used on qint128
inputs e.g.
After another such issue (cmp_equal()), we decided to require
<type_traits> and <limits> support for extended integer types in the
stdlib, or we will disable Qt's support for it, too.
So check that if QT_SUPPORTS_INT128 is defined, is_signed_v,
is_integral_v and numeric_limits work, too. Disable QT_SUPPORTS_INT128
when compiling with libstdc++ in __STRICT_ANSI__ mode (-ansi or
-std=c++NN instead of (the default) -std=gnu++NN).
[ChangeLog][Potentially Source-Incompatible Changes] Qt's support for
128-bit integers (qint128/quint128) is now conditional on support for
these types from the Standard Library, in particular <type_traits> and
<limits>. Qt no longer tries to work around missing Standard Library
support. As a consequence, e.g. GCC -ansi and GCC -std=c++NN (instead
of -std=gnu++NN, the default) builds will now no longer support these
types.
Task-number: QTBUG-119901
Change-Id: I8529e72a52a2f5da0f469bae543688e18220255f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9bb2ab5978625eee96f703871d5eca8e54b31386)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is in preparation of adding some static assertions here that we
need to have evaluated in both "normal" and "strict" mode, namely
<type_traits> and <limits> support for qint128.
But this change is more general, so making it a separate change.
Turns out we already have (non-static) assertions here about <limits>
support for qint128. These force us to define precisely when
GCC/libstdc++ has gained <limits> support for __int128_t: the
timestamp of the __GLIBCXX__ macro is the Daily Bump immediately
preceding the gcc commit that fixed <limits>
(gcc/8eb9a45e87bdb81cb44948c651edee846c622a0f).
Let's hope no-one is running the prerelease version of GCC 10.3 from
that particular day, otherwise these might become XPASSes. But just
not testing is also wrong; we want to be informed about True Positives
and Negatives here.
Task-number: QTBUG-119901
Pick-to: 6.7 6.5
Change-Id: I6f9be047f846fff74133c466c5bed40d0039d60f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e7c54248987d474cff9f49cad502822eb9dcb114)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>