Commit Graph

54690 Commits

Author SHA1 Message Date
Thiago Macieira
ba0864ae52 QString: remove the old unaligned 4-byte compares in ucstrncmp()
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>
2022-01-18 21:38:12 -08:00
Pino Toscano
099e0fff61 CMake: add support for GNU/Hurd
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>
2022-01-19 01:53:14 +01:00
Alexandru Croitor
6e5c7b9e4f coin: Move AUTOGEN and tests options addition into a common location
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>
2022-01-19 01:28:02 +01:00
Volker Hilsheimer
e8bf2c6eba Further improve QShortcut test
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>
2022-01-18 22:42:44 +01:00
Edward Welbourne
7fea7dfaf3 Restore std::as_const() where a qAsConst was lost between 5.15 and 6
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>
2022-01-18 20:42:19 +00:00
Mårten Nordheim
7e82cefb72 QNetworkRequest: Document how Qt handles 301 and 302 status codes
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>
2022-01-18 18:43:55 +00:00
Dimitrios Apostolou
5180e70dbe qt-testrunner: be more clear that it was the test that crashed
Task-number: QTBUG-99970
Change-Id: Id2d01b6ab7d428356d9dfc953107014791393d35
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2022-01-18 19:43:54 +01:00
Axel Spoerl
a620a6bf15 Add QDial test in tst_baseline_widgets
Task-number: QTBUG-99712
Pick-to: 6.3
Change-Id: Ib133dd4c1395060be2aac4d3ca1b17eaccc24676
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-18 18:29:00 +01:00
Edward Welbourne
26082a0dd2 Remove (set but) unused member from QTimerPrivate
Change-Id: I004fef8ce84cdc74837f674239c05901000bee33
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-01-18 16:23:56 +01:00
Edward Welbourne
755b0aa681 Turn a condition into a lambda to save needless evaluation
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>
2022-01-18 16:23:56 +01:00
Iikka Eklund
f2230ea1a6 Conan: Add optional ICU Conan package dependency
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>
2022-01-18 16:01:54 +02:00
Alexandru Croitor
9198a9b8cc CMake: Fix qt_run_linker_version_script_support to use active linker
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>
2022-01-18 14:28:57 +01:00
Alexandru Croitor
d6066d53fa CMake: Fix detection of linker availability
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>
2022-01-18 14:28:57 +01:00
Alexandru Croitor
461f68c5c9 CMake: Fix dbus headers not being added in qt_internal_extend_target
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>
2022-01-18 10:18:54 +01:00
Pino Toscano
13a11f1c35 QProcess/Unix: fallback on _POSIX_PIPE_BUF w/ missing PIPE_BUF
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>
2022-01-18 06:42:51 +01:00
Thiago Macieira
86b346823e QString::toLatin1_helper_inplace: simplify the code
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>
2022-01-17 19:56:41 -08:00
Thiago Macieira
a59e736171 QMetaType: add a missing check for null d_ptr
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>
2022-01-18 03:56:40 +00:00
Marc Mutz
9ab44777d6 QRhiGles2: replace two QSet<int> with QDuplicateTracker
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>
2022-01-18 04:56:40 +01:00
Marc Mutz
208cfad9ad Clang: don't error out on -Wdeprecated-enum-enum-conversion
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>
2022-01-18 04:07:14 +01:00
Ulf Hermann
1b4a5ecc91 JSON: When clearing duplicate object entries, also clear containers
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>
2022-01-18 02:31:30 +01:00
Marc Mutz
6f6c8d0618 QVersionNumber: don't allocate in fromString() in the common case
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>
2022-01-18 01:31:33 +01:00
Marc Mutz
9ffcab6562 QVersionNumber: port fromString() to QAnyStringView
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>
2022-01-18 01:31:33 +01:00
Thiago Macieira
1a440e557b QVersionNumber: change int to qsizetype in fromString()
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>
2022-01-17 16:31:32 -08:00
Volker Hilsheimer
f718c35055 Offscreen: Implement QPlatformBackingStore::toImage
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>
2022-01-18 01:31:32 +01:00
Thiago Macieira
b6fb53a47a CMake: re-enable SIMD on Android
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>
2022-01-17 21:31:32 -03:00
Joerg Bornemann
037fd545c4 CMake: Propagate qtbase's CMAKE_STAGING_PREFIX to Qt modules
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>
2022-01-18 00:20:37 +01:00
Thiago Macieira
e52d50a03d QLatin1String: perform the comparison to another QL1S using memcmp()
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>
2022-01-17 22:17:01 +00:00
Joerg Bornemann
238e3beb6f Remove unused .qrc files
Task-number: QTBUG-94446
Change-Id: I136d8b4ab070a832866aa50b5701fc6bd863df8a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-01-17 23:17:01 +01:00
Edward Welbourne
aa8fd6bc39 Convert date-time to UTC before claiming it's in GMT
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>
2022-01-17 22:29:30 +01:00
Edward Welbourne
21735f24cf Simplify some #if-ery and use positive tests
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>
2022-01-17 22:29:30 +01:00
Timur Pocheptsov
f854e77b8e widgets baseline test: add QSpinBox
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>
2022-01-17 21:44:29 +01:00
Axel Spoerl
fd93c298d6 Prevent takeStandardSnapshots() from stopping on first mismatch
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>
2022-01-17 21:24:27 +01:00
Edward Welbourne
6ee2664883 Remove execute permission from XML files
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>
2022-01-17 18:47:22 +01:00
Iikka Eklund
aca9fe0709 Conan: Exclude 'qt_host_path' option from package_id checksum
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>
2022-01-17 19:23:50 +02:00
David Skoland
5359d420af Move input event logic into QWasmCompositor
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>
2022-01-17 18:23:50 +01:00
Topi Reinio
b99c08dd4e Doc: Use \inmodule for all classes and headers
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>
2022-01-17 17:23:50 +00:00
Timur Pocheptsov
8c4dee6f97 QFusionStyle: don't draw an invalid outline for up/down buttons
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>
2022-01-17 18:23:50 +01:00
Mårten Nordheim
c0ca46de3e QAuthenticator: Use views for arguments in private functions
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>
2022-01-17 18:11:43 +01:00
Kai Köhne
713967ae30 Doc: Make QListIterator snippets more robust
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>
2022-01-17 18:11:43 +01:00
Kai Köhne
bc3ac007d8 Doc: Remove mentioning of Fowler book
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>
2022-01-17 18:11:42 +01:00
Morten Johan Sørvig
a1c666b6e5 wasm: fix EXPORTED_RUNTIME_METHODS also for qmake
Emscripten has deprecated the “EXTRA_” prefix.

Pick-to: 6.3
Change-Id: I8cbfab933ba46e293f3bd6262cf0147c3c8978cf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-01-17 09:01:25 +00:00
Morten Johan Sørvig
f50dbdb38f wasm: don’t pass thread linker opts to compiler
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>
2022-01-17 09:01:20 +00:00
Morten Johan Sørvig
bb8c73ab9e wasm: modernize pthreads option
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>
2022-01-17 09:01:14 +00:00
Morten Johan Sørvig
cf390e48b1 wasm: remove emterpreter flags
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>
2022-01-17 09:01:08 +00:00
Jonas Kvinge
260294346b qmetatype: Fix incorrect more than one typedef warning
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>
2022-01-17 08:51:23 +00:00
Øystein Heskestad
74955f386d Replace QString::utf16 with QString::data where appropriate
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>
2022-01-17 09:48:12 +01:00
Robert Löhning
88dda89329 Fuzzing: Add fuzzer for QJsonDocument::fromJson
Task-number: QTBUG-99799
Change-Id: If997b661da2fce04b84f94b9e66de19c9946a914
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-01-17 09:46:40 +01:00
Pino Toscano
5558eb4edb QStorageInfo: limit Linux-only code with Q_OS_LINUX
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>
2022-01-16 11:59:39 +00:00
Thiago Macieira
b387fbd122 QVersionNumber: change int to qsizetype for index and length
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>
2022-01-16 11:59:39 +00:00
Giuseppe D'Angelo
3976449c0e QTextStream: code tidies
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>
2022-01-16 11:59:39 +00:00