This is very old code, predating the public Qt history (Qt 4.5). It
predates all other SIMD code in qstring.cpp, actually. Now that we do
have implementations for MIPS DSP, ARM Neon and x86 SSE2, this content
has very little value. It would be relevant for other architectures Qt
still supports (POWER and RISC-V come to mind), but I guess the
compiler's auto-vectorizer functionality can do a better job than this
content.
Change-Id: I0e5f6bec596a4a78bd3bfffd16c90733fb0d8f22
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Add a "HURD" CMake platform specification, so it can be properly
checked in the build system.
Set QT_DEFAULT_MKSPEC to the existing hurd-g++ mkspec.
Hurd supports $ORIGIN in RPATH, so enable it.
Hurd uses X11, so add it to the X11_SUPPORTED list.
Enable few more feature checks that apply to Hurd as well: either
because they are provided by GNU libc itself, or because they are
implemented on Hurd.
Check and set the ELF interpreter, as it is a common functionality of
the GNU toolchain.
Change-Id: Id347033560bbc5a2a4e2c3abb493c948c002b40e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
As a drive-by this fixes the qtbase build to also have the
CMAKE_AUTOGEN_VERBOSE option set.
Pick-to: 6.2 6.3
Change-Id: I32324fb1e8e16299c5f34517edbc7ff335d84e14
Reviewed-by: Toni Saario <toni.saario@qt.io>
Get rid of the function-static main window, which would be destroyed
after QApplication if the test is run with a subset of test row (that
does not include the TestEnd state test).
Make the MainWindow a class member of the test class instead, and rename
it from "mainW" to "mainWindow" to avoid shadowing by "mainW" widgets in
other test functions.
Amends 55928821d1.
Task-number: QTBUG-99630
Pick-to: 6.2 6.3
Change-Id: I83efce5b54afc3a0027a7c0e63efee6a235af585
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Amends commit 837a29b0b92c72b7b9d66a427c24a9fa8037f4f4's fix for
shadowing to take account of the loss of const-qualification of
uiLanguages where it was then used in a ranged-for loop.
Pick-to: 6.3 6.2
Change-Id: Ic4021bd9917cb27832a197126cc80a7f384a14a2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
To make it explicit
Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-92909
Change-Id: I8f8dc99628168a566158acef72ae2a5e001eef88
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The public suffix list scanner's utf8encode()'s main loop always
worked out whether a character is a hex digit, even when it didn't
need to know. Package the computation in a lambda and only test it
when it is needed. Also assert non-empty input generates non-empty
output.
Change-Id: Iaf48aad382624e421cea9c9cdb8bba5fc47b1596
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
If the "icu" option is passed for the build then add the optional
ICU Conan package dependency. The ICU version needs to be parsed
from a file which is provisioned by the Qt CI.
If the ICU version can not be parsed, e.g. if "conan export" is
being executed outside Qt CI machines, then use a fallback
version for it.
For the Qt build system to pick up the ICU dependency built
by Conan we need to pass the ICU package path via
CMAKE_PREFIX_PATH.
Pick-to: 6.2 6.3
Task-number: QTBUG-97072
Change-Id: I83059664c59dff68af76da8509e618442b530516
Reviewed-by: Toni Saario <toni.saario@qt.io>
The version script compile test did not use the linker that the build
system determined to use to link Qt, but rather the system linker.
Run qt_run_linker_version_script_support only after the global qtbase
features have been evaluated and make sure to include the active
linker flags.
Pick-to: 6.2 6.3
Change-Id: I0ff82406828daaf0dc5ec25a55f53ac7d98e3347
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Previously we passed flags like -ld-fuse=lld only to compile
calls, but not to the link call of a compile test project.
Make sure to pass it to the link call instead by using
check_cxx_source_compiles + CMAKE_REQUIRED_LINK_OPTIONS
instead of
check_cxx_compiler_flag.
Note the flag that is passed is still via passed via the
compiler launcher and not directly to the linker.
Remove duplicate flag handling code.
Pick-to: 6.2 6.3
Change-Id: I1bf90573904a9df83240b6debfee3cc9e425c6bb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The generated dbus headers would not appear in IDE source lists
because of incorrectly named variables.
Pick-to: 6.2 6.3
Change-Id: I276d4284eb94b98cc75f791de62ca332ad947004
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
PIPE_BUF is optional in POSIX, e.g. "where the corresponding value is
equal to or greater than the stated minimum, but where the value can
vary depending on the file to which it is applied." [1]
GNU/Hurd does not provide PIPE_BUF, so fallback to its minimum
acceptable value, that is _POSIX_PIPE_BUF.
[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
Also, explicitly include <limits.h> in this file, to make sure PIPE_BUF
or _POSIX_PIPE_BUF are available without relying on other headers to
pull <limits.h>.
Change-Id: Ifae964db81841e1d31fc09e73b45594af9a326d1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Hot function, so help the compiler out. In particular, this removes any
touch to the ref count, so there are no atomic operations or dead code
leading to memory allocations and deallocations.
Change-Id: I0e5f6bec596a4a78bd3bfffd16c9a0fbd8dd2c12
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Bug introduced in 6.0. This is the only unprotected d_ptr I could find.
[ChangeLog][QtCore][QMetaType] Fixed a bug that would cause
QMetaType::compare() and QVariant::compare() to crash on invalid meta
types and variants.
Pick-to: 6.2 6.3
Fixes: QTBUG-99960
Change-Id: I0e5f6bec596a4a78bd3bfffd16cb1f7b2d146688
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid,
or at least reduce, memory allocations.
Pick-to: 6.3
Change-Id: Ied2574734949b2dadc1bcbaa9d1e3c0ed98ba50a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Same treatment as is given to GCC further below.
Pick-to: 6.3 6.2
Change-Id: I3762c39a0b5d9add365ecf828b80d3ba432578c2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Previously, if you had multiple entries with the same name in an object,
and some of them were again objects or arrays, parsing the JSON document
would leak memory.
Also, we use std::stable_sort instead of std::sort now, so that we don't
accidentally randomize the order of elements with equal keys.
[ChangeLog][QtCore][JSON] A memory leak in the JSON parser when reading
objects with duplicate keys was fixed.
Pick-to: 5.15 6.2 6.3
Fixes: QTBUG-99799
Change-Id: Ic2065f2e490c2d3506a356745542148ad9c24262
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use QVarLengthArray instead of QList to avoid allocations in the case
where the result fits into inline storage.
Of course, we now perform one allocation more when we need the QList
backend, but a) that should be the rarer case and b) we use 32 (more
than InlineSegmentsCount) Prealloc for the QVarLengthArray to reliably
skip the first few QList non-reserved capacity jumps (measured to be
{4, 12, 28} for back-insertion, not all of which is probably available
for append()s) to come out ahead either way.
Reviewers may object, saying that we could just reserve(32) the QList,
too, but while that would skip over the first few QList reallocations
alright, it means we'd be carrying the extra capacity around for the
duration of the QVersionNumber's lifetime (unless we'd shrink it at
the end, bringing back the additional allocation and that solution
back to par compared to this one).
As a consequence:
[ChangeLog][QtCore][QVersionNumber] Can now be also be constructed
from QVarLengthArray.
Change-Id: I4016367f64f6cefa6ed9147d33b06636f36b02cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We can handle the UTF-8 case by reinterpreting it as Latin-1.
This way, the suffixIndex stays valid as a return value.
As a drive-by, optimize away toLatin1() calls by using a QVLA.
We really need a better way of converting UTF-16 -> L1 than
qt_to_latin1()...
[ChangeLog][QtCore][QVersionNumber] fromString() now takes
QAnyStringView (was: QString, QStringView, QLatin1String)
and a qsizetype pointer (was: int pointer).
Change-Id: I86abaadba2792658fbf93ccd1e0b86e3302c697c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This completes the update to qsizetype in this class, adding a couple of
methods that need to be removed in Qt 7. They're only required where int
is not qsizetype (i.e., 64-bit platforms).
Change-Id: I0e5f6bec596a4a78bd3bfffd16c9de29bec4c637
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This makes testing of actually produced output easy in unit tests.
Pick-to: 6.3
Task-number: QTBUG-99962
Change-Id: Ia806539230af12d1eae1e31ef7a47155d9bc1bed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Except for MIPS, which is disabled in Qt 5 too. It's not my place to
question why.
This partially reverses commit b6e75ff3ea.
Change-Id: Ib42b3adc93bf4d43bd55fffd16c1feffb9c5890c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
When qtbase is configured with CMAKE_STAGING_PREFIX set, then Qt modules
built against this qtbase should also get CMAKE_STAGING_PREFIX by
default. Like CMAKE_INSTALL_PREFIX in regular builds, this prefix will
be determined by the location of QtBuildInternalsExtra.cmake to support
building Qt modules against an installer-provided Qt.
CMAKE_INSTALL_PREFIX on the other hand must be exactly the value that
was provided when building qtbase.
If CMAKE_STAGING_PREFIX is specified by the user, honor it.
To opt out of automatically setting CMAKE_STAGING_PREFIX, set
QT_BUILD_INTERNALS_NO_FORCE_SET_STAGING_PREFIX to ON.
Remove the old code that was supposed to set CMAKE_STAGING_PREFIX.
Pick-to: 6.2 6.3
Fixes: QTBUG-99666
Change-Id: I20edef54c102ca9784fcdef0decf0bd83266ae11
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
qstrncmp() would stop at the first null character, which isn't correct.
The tests that had been disabled in tst_qstring.cpp (with an inaccurate
comment) were actually passing. I've added one more to ensure that the
terminating null is compared where needed.
[ChangeLog][QtCore][QLatin1String and QUtf8StringView] Fixed a
couple of bugs where two QLatin1Strings or two QUtf8StringViews
would stop their comparisons at the first embedded null
character, instead of comparing the full string. This issue
affected both classes' relational operators (less than, greater
than, etc.) and QUtf8StringView's operator== and operator!=.
Pick-to: 5.15 6.2 6.3
Change-Id: I0e5f6bec596a4a78bd3bfffd16c90ecea71ea68e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
QNetworkHeadersPrivate::toHttpDate() used a custom format to output a
date-time; the format supplied GMT as suffix, but neglected to convert
the date-time to UTC, so local-time was formatted as if it were UTC,
regardless of its actual offset from it. Fixing this (by the obvious
toUTC() call) broke formatting when the supplied header value was a
QDate, since it's packaged as a QVariant and QVariant's conversion of
QDate to QDateTime uses local time's (not UTC's) start of day. So fix
headerValue() to separate QDate and QDateTime cases and use
startOfDay(Qt::UTC) to get the right start of the day. Added tests for
non-UTC date-times appearing correctly in HTTP headers.
Fixes: QTBUG-80666
Pick-to: 6.3 6.2 6.2.3 5.15
Change-Id: I2792bce14a07be025cf551b0594630260c112269
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Two cases coincide without feature textdate, and the first falls
through to the second with the feature, making it possible to simplify
the #if-ery, converting its tests to positive form and skipping a
duplicate case body in the process.
Change-Id: I2c0ee800442474707bf8893bd72b9706fef54485
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Very simplistic initial test, inspired by the fix in 'fusion' style,
but not style-specific.
Pick-to: 6.3
Change-Id: I55ceca7ad214c86cb11032c5342bdae2a83852f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Force takeStandardSnapshots() to take and log all snapshots before
launching QFAIL. Macros QBASELINE_CHECK_DEFERRED and
QBASELINE_CHECK_DEFERRED_SUM have been added in qbaselinetest.h
Task-number: QTBUG-99790
Pick-to: 6.3
Change-Id: Ia015de808f354e842ac4029c5c84be18c4a4e209
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Files that are not meant to be executed should not have the execute
permission bit set.
Task-number: QTBUG-81503
Pick-to: 6.3 6.2 5.15
Change-Id: I10666bd958adfc5c425216bcff7456facd1fe5f3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
The 'qt_host_path' should not affect the package_id as it is most
probably completely different in different environment and would make
the CI produced cross compiled binaries unusable by end users.
Pick-to: 6.2 6.3
Change-Id: I91019dacb99a3ee69fadbf3435d37bac0c279330
Reviewed-by: Toni Saario <toni.saario@qt.io>
Move the window logic and state out of QWasmEventTranslator and into
QWasmCompositor.
The reasoning for this change is that the state of the windowing
system was split between QWasmCompositor (eg. window stack) and
QWasmEventTranslator (eg. dragged and pressed windows). This change
moves the input handling and state to QWasmCompositor and demotes
QWasmEventTranslator to a helper class. In this model, QWC acts
as a proper window system / display server and can leverage multiple
helper classes which are "owned" by the QWC.
Here is a quick diagram illustrating the proposed general architecture
around WASM window handling and its difference from typical OSes:
https://i.imgur.com/vcBwUPf.png
Change-Id: Idca617992b8e1b431e5c71d46b5db61597c99e75
Pick-to: 6.3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
QDoc made some assumptions about the module a class/header belongs to,
based on the source file path. This feature is rather error-prone and
unnecessarily complex and will be removed from QDoc.
Define modules explicitly to avoid documentation warnings when this
removal happens.
Pick-to: 6.2 6.3
Change-Id: I7947d197db5ac36c12e816caa19bb2f74eda8849
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
When they are disabled ('NoButtons'). Otherwise, we end up with a tiny
dot (top left or right corner of a spinbox).
Pick-to: 6.2 6.3 5.15
Fixes: QTBUG-99486
Change-Id: Ic99f4bce2abd57c988254296a749b5d5b23cfb39
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Some lines in tests had to be updated because they lost the implicit
conversion from char* to QString.
Change-Id: I95af5859ced95b9ca974205398e38c0bd4395652
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
qDebug() << i.next();
can become a NOOP if the code is compiled with QT_NO_DEBUG_OUTPUT.
Pick-to: 5.15 6.2 6.3
Fixes: QTBUG-97535
Change-Id: I9085b40ac9b4de2bb06f16e03fd5100902b08d4f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
It is out of print since years, and probably quite dated by now (released
1997).
Pick-to: 6.3
Change-Id: I1653eb404713c15d70b8a15858e8c7d12b2e71cb
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Emscripten now warns against passing e.g. “ALLOW_MEMORY_GROWTH”
as a compile option.
Add EMCC_THREAD_CFLAGS, which gets compiler flags only.
Pick-to: 6.3
Change-Id: Ifcf40c45ca75cfdfc98a12e6b9d47f34158b3407
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Use “-pthreads” instead of “-s USE_PTHREADS=1”. This
is both a compile and linker option.
Pick-to: 6.3
Change-Id: Iaf7cb4ec41577fe596c3e81fda05c03fe0074c08
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
The “emterpreter” was the precursor to the current
asyncify support, but is not in use any more.
Pick-to: 6.3
Change-Id: I07ca04b61747e90939444525641b5aa34f7087b5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
The names are the keys of a hash so they can come in any
order. That means the loop above, which stops before the end if
it finds a name that is not the official one, may not have seen
the official yet. If it has reached the end, then there is no
typedef alias.
Fixes: QTBUG-99620
Pick-to: 6.2 6.3
Change-Id: I3bd638766c494b32c665190d01db15c4cbc587b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
QString::utf16() needlessly detaches fromRawData() to ensure a
terminating NUL. Use data() where we don't require said NUL, taking
care not call the mutable data() overload, which would detach,
too.
Task-number: QTBUG-98763
Change-Id: Ibd5e56798c0c666893c12c91ff0881842b8430c7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This fixes a build problem (use of PATH_MAX) by eliminating a
Linux-specific condition that can't happen on HURD anyway.
Pick-to: 6.3
Change-Id: I5dcaf104a60b7850b8af3964fc4cd02ab24acd7b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This class is not exported, so we can change the non-exported
methods. None of the exported methods required change; notably,
QVersionNumber::Segments::setVector didn't because it's only called with
values 1, 2, and 3.
[ChangeLog][Potentially source-incompatible changes] Updated the
QVersionNumber API to use qsizetype where length and index values were
used. This change retains binary compatibility and the vast majority of
users will not experience a source compatibility problem. It could occur
with ambiguous overloads when passing results from QVersionNumber to
other API not using either int or qsizetype. There could also be new
warnings from compilers about converting 64-bit types to 32-bit ones.
Change-Id: I0e5f6bec596a4a78bd3bfffd16c9984b61c9b55b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Port the internals to qsizetype, and use QStringView instead of QString
as a function parameter.
The padding() function is changed to take a qsizetype to avoid warnings,
but the maximum padding that can be specified is still limited by the
range of an int (this is guarded via an assert).
Change-Id: I9dd98e5a534990a1758b080900a12dc793528d19
Reviewed-by: Marc Mutz <marc.mutz@qt.io>