If the file extension already matches uniquely, we do not need to do any
actual file operation.
Pick-to: 6.3
Change-Id: Ide8b82eefbcd13348b78b28b66230a91e1e3c5d8
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The extra "V" accidentally enabled AVX2 code in the aeshash128()
function.
Fixes: QTBUG-101082
Change-Id: Ibf4acec0f166495998f7fffd16d63e220dbe02d0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Both INITIAL_MEMORY and PTHREAD_POOL_SIZE are settings users can
change, they are not interface settings.
Fixes: QTBUG-100693
Pick-to: 6.3 6.2
Change-Id: Ie1547c7f52c9fe109a313260616705728024b6b8
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
Just as a minor debugging helper: when warning that an invalid
regular expression object is being used to match, also print
the used regular expression pattern.
Change-Id: I0f99bcf4ca87ec67d04ed91d9dc315814f56d392
Fixes: QTBUG-76670
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... using the usual pattern, which, being idiomatic, doesn't need a
comment explaining it.
Pick-to: 6.3
Change-Id: Id6b12450495a18f89e1f83f2018b6218b03ff6a7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Base class dtors should either be public and virtual or else
non-virtual and protected. We don't need polymorphy, so make them
protected.
Because ~QStringConverter is now user-declared, the move special
member functions are suppressed. Re-add them using = default.
[ChangeLog][QtCore][Potentially Source-Incompatible Changes]
[QStringEncoder/Decoder] The destructors of the base classes of
QStringEncoder and QStringDecoder are now protected, to prevent
slicing.
Change-Id: I72cc5b98af1a6533a46080b537e1900808e1f130
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Convert paths in the QT_ANDROID_EXTRA_PLUGINS and QT_ANDROID_EXTRA_LIBS
target properties to a JSON compatible, when generating deployment
settings using finalizers in user projects.
Pick-to: 6.3
Change-Id: I8878435d69688c21e44b22339dc84495b9cea5eb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Make the implementations of these methods free functions in the
QtPrivate namespace, so that they can be called also from
QByteArrayView's corresponding inline methods.
These methods were added in 6.3, so we can still make them inline
without breaking BC.
Fixes: QTBUG-101077
Pick-to: 6.3
Change-Id: Id50c6d4df5471127ae787a544a5651ced9aece99
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When we add the WS_THICKFRAME/WS_CAPTION window flags to a
frameless window the return value of AdjustWindowRectEx is no
longer 0. This works fine when creating the window since the version
of QWindowsGeometryHint::frame used during creation checks the
FramelessWindowHint, however later when the window changes
screen, the screen change code checks the fullFrameMargins which
uses a version of QWindowsGeometryHint::frame that does not
early out, causing a missmatch in the geometries of the backing
store and platform window.
This fixes aero snapping shortcuts for frameless windows on multi
monitor setups.
Fixes: QTBUG-84466
Pick-to: 6.2 6.3
Change-Id: I2357ea32669e4676645549996a3ac6073f3df15c
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Add the possibility to install a Qt app into a directory different from
${INSTALL_BINDIR}.
If INSTALL_DIR is not specified, qt_internal_add_app still installs to
${INSTALL_BINDIR}.
Pick-to: 6.2 6.3
Task-number: QTBUG-99295
Task-number: QTBUG-100047
Change-Id: I52371aa0f770d80c32bb0b3442ce3c463916be63
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The interesting part is what cannot be noexcept:
- nameForEncoding() and ctor from Encoding: because they don't handle
all valid values of type Encoding, so have a narrow contract
- encodingForHtml(): because it allocates memory (→ QTBUG-101046)
Change-Id: I30cdc19a32537be047e43955e3337e4d6ccc363f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
When building Qt itself or Qt standalone tests (but not user projects),
qt6_android_add_apk_target and qt6_android_generate_deployment_setting
can now be called at any time after the Android executable target is
created.
Note: Because we're now using genexes when we build Qt as described
above, Qt developers are required to use Unix-style paths for the
following target properties:
QT_QML_IMPORT_PATH
QT_QML_ROOT_PATH
QT_ANDROID_PACKAGE_SOURCE_DIR
Pick-to: 6.3
Fixes: QTBUG-100796
Change-Id: Ida788f0d58bc0c028a89eed9d115babe27144325
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The view.resize() command has no effect if the requested
size is smaller than the screen. So the view has space for
the whole model. It then won't scroll, so scrolling cannot
be tested.
This patch enlarges the model so that scrolling is always
necessary and thus possible.
Task-number: QTBUG-87407
Pick-to: 6.2 6.3
Change-Id: Ibff512158d9c16be120a69c7328b6d0ae2c3b551
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Some tests were blacklisted, but the problems cannot be reproduced
any more. This patch activates them.
Fixes: QTBUG-87404
Pick-to: 6.2 6.3
Change-Id: I5944c750a5717daaf43a22d6d1fa51ae54fc3da2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
tst_qopenglwidget was disabled because it crashed.
It does not any more.
Task-number: QTBUG-87671
Pick-to: 6.2 6.3
Change-Id: I7ea55f262f362c098b52e1b1a319b26c31a7e067
Reviewed-by: Pekka Gehör <pekka.gehor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
tst_qdom was disabled because it crashed. It does not any more.
Task-number: QTBUG-87671
Pick-to: 6.2 6.3
Change-Id: I41117938fe9d93b510c4a60beb4c2f5b20991434
Reviewed-by: Pekka Gehör <pekka.gehor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
QGuiApplicationPrivate::lastCursorPosition is initialized with qInf();
so before Qt has seen a mouse move event, attempting to convert to
QPoint is an error. It's best to have one place where we do the qIsInf()
check rather than several (and otherwise prefer using the QPointF as-is
rather than converting to QPoint at all).
Introduce a helper class that contains a QPointF, and provides a safe
conversion to QPoint, as well as simple accessors for clients using
QPointF.
Fixes: QTBUG-52472
Task-number: QTBUG-45045
Change-Id: I83fad1bfb658e03fa876344552f1d5bb751d9f81
Pick-to: 6.2 6.3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
qt_windows takes care of setting NOMINMAX, which prevents native headers
from defining `min` and `max` as macros, breaking the build. So include
that header always as the first header.
Pick-to: 6.3
Change-Id: I82cd8b21d263102000e6e66f135465bc2c126db4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
As a drive-by, remove the GCC 7 constexpr work-around.
[ChangeLog][Potentially Source-Incompatible Changes]
All QStringEncoder/Decoder constructors are now explicit.
Change-Id: I0972e2736115993d44a48e73dbf4b08a1c94bef2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Port the test to use the QWindow* based overloads of QTest::mouseMove()
and move the cursor away.
Pick-to: 6.3
Task-number: QTBUG-98489
Change-Id: Id1ac0ef176c6f9bf179f989ddd5775877525fc0d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
By copying 'd' instead of the (larger, on 32-bit platforms),
state_data variadic member, we may corrupt the state (by copying only
half the state).
Fix by copying state_data instead, which is guaranteed to be the
larger of the two.
The move-assignment operator must be self-assignment-safe in the
moved-from state (Hinnant Criterion), so we need to use memmove(), not
memcpy().
[ChangeLog][QtCore][QStringEncoder/Decoder] Fixed a potential data
corruption in the move constructor and move-assignment operator on
32-bit platforms.
Pick-to: 6.3 6.2
Change-Id: I7bbc475a6eecec618a011b23814cada35ce61d10
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In Qt 5, QVariant::isNull() was true when the contained object had an
isNull() that was true; this is no longer true in Qt 6, so we now have
QSqlResultPrivate::isVariantNull() to test is-or-contains
null. However, for date-times, QSqlDriver::formatValue() treats
invalid QDateTime as NULL, since it needs its toString(Qt::ISODate),
which will be empty if invalid. As QDateTime's isValid() is more
stringent than its !isNull(), this can lead to one that's neither
valid nor null, such as QDateTime(QDate(), QTime(0, 0)), producing an
invalid entry in a database.
Do the same for QTime, as its isValid() is more stringent than
!isNull(), and its toString() likewise returns empty on invalid
(although it's not clear it's possible to construct one that's neither
valid nor null). For QDate valid and null are simply complementary.
[ChangeLog][QSql] Handling of QDateTime and QTime values passed to SQL
now consistently treats invalid as null. Some values of these types
are neither valid nor null, which could lead to invalid data being
given to the SQL database. Invalid values are now treated as null to
prevent this.
Task-number: QTBUG-98471
Pick-to: 6.3
Change-Id: I145411280d6bcc53dc0dc5f4a1cb938d995fd6bc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
unused parameters in cmake tests cause the tests to fail when the
project is configured with `-Werror,-Wunused-parameter`
Change-Id: If3065d008753a7718282dfc6ba0d79d46576cb34
Pick-to: 6.2 6.3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Zlib headers includes also configuration header, this should be also
installed.
This commit amends be2745e478
Fixes: QTBUG-101065
Change-Id: Ide8a59258469fa793966f636ee54f18211ed8fd6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The old patch is removed but another was needed to fix a warning from
MSVC about truncation which is taken from
e634f265db5d296bd7a780f9813d6b8573f5bd90 in the master branch.
Since there is no other changes to the double-conversion directory
between 3.2.0 and that change we are essentially using that commit
directly.
Pick-to: 6.3
Fixes: QTBUG-100988
Change-Id: Ia69f39f61ef989907fdf097f897bece0b3af7194
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Ensure both versioned and versionless functions
are available.
Document that the first argument should be an absolute path
and check that in the code.
Move the low-level warning to the top, after the TP message.
Use a few more options in the doc snippet.
Mention what the default values are.
Pick-to: 6.3
Fixes: QTBUG-100922
Change-Id: I0d852733e51750f4c8f15721b707cb1d27dfee9a
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Mention in the docs that qt_generate_deploy_app_script does not
currently support cross-build scenarios.
Use the value of QT_DEPLOY_BIN_DIR instead of CMAKE_INSTALL_PREFIX
in the qt_deploy_runtime_dependencies call done by
qt6_generate_deploy_app_script. This matches what we say to do in the
documentation of qt_deploy_runtime_dependencies.
Pick-to: 6.3
Task-number: QTBUG-98545
Fixes: QTBUG-100921
Change-Id: Ie9bfddeaf503d3efe7a73b2e4148bbf0601d693e
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Set QMAKE_REPONSEFILE_THRESHOLD to 1 in the WebAssembly mkspec to
enforce the usage of linker response files. This fixes "The command
line is too long." errors when linking user projects that depend on many
libraries, for example projects using QtQuickControls2.
Pick-to: 6.2 6.3
Fixes: QTBUG-100559
Change-Id: I2f03f0756c9f171bc7382940fa0f8079bdb75a00
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Linker response files for the MinGW and Unix makefile generators are
controlled by the variable QMAKE_LINK_OBJECT_MAX. This variable holds a
number. If the number of object files passed to the linker exceeds this
number, a linker response file containing object file paths is created.
This heuristic is extremely imprecise. It doesn't take into account the
length of object file names nor the length of $$OBJECTS_DIR.
Also, when using a static Qt, a big part of the linker command line are
libraries. A relatively small example can fail to link with "The
command line is too long" on Windows, even with the object files being
in a response file.
The MinGW makefile generator already reads the variable
QMAKE_RESPONSEFILE_THRESHOLD for compiler response files. Re-use this
variable for the linker response file of the Unix and MinGW makefile
generators.
If QMAKE_RESPONSEFILE_THRESHOLD is set, use it to determine whether to
create a response file. QMAKE_LINK_OBJECT_MAX is then ignored. The
response file contains objects and libraries.
If QMAKE_RESPONSEFILE_THRESHOLD is not set, use QMAKE_LINK_OBJECT_MAX to
determine whether to create a response file. The response file contains
only object files.
QMAKE_LINK_OBJECT_SCRIPT is used in both cases to specify a common base
name of all linker response files.
Pick-to: 6.2 6.3
Task-number: QTBUG-100559
Change-Id: I3c78354fa5ebb1a86438ec804679e0ee776c3f49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Makes it easier to interpret the output from the test, because of
embedded newlines.
Pick-to: 6.3
Change-Id: Ic15405335d804bdea761fffd16d4f141e09537f4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Simplifies the code. And removes the unnecessary quote around the
pattern that was there, for some reason.
Pick-to: 6.3
Change-Id: Ic15405335d804bdea761fffd16d4f135edf6993b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Instead of performing decisions inside the single aeshash() function, we
have three implementations instead. Those decisions are permanent for
each CPU, so the branch predictor should be pretty good, but hashing is
somewhat performance-sensitive.
We're only adding three of the four possible combinations of AVX512VL
and VAES. Excluded from the implementation are the CPUs that support
AVX512 but not VAES, which are the Skylake-based ones. Those are mostly
found in server CPUs (Intel Xeon Scalable line) as well as top-end
workstations (Intel Core i9), but never made into general desktop and
laptop parts. For those, the performance will remain what it was in Qt
6.3.
VAES is supported in Intel architectures codenamed Sunny Cove and
Gracemont and their successors. That means it's supported in both the E
and P cores of the Intel Alder Lake (12th Generation Core), as well as
future Atom lines. But neither Atoms nor hybrid CPUS have AVX512 (at
least when the E cores are active).
AVX512+VAES is supported for Ice Lake (10th Generation Core), Tiger Lake
(11th) as well as later generation with AVX512 support enabled. Like in
qstring.cpp, we restricted ourselves to 256-bit operations, which don't
cause performance impact and because the 512-bit VAESENC operates on the
fused Ports 0 and 1, so it has the exact same throughput as two 256-bit
VAESENC.
Change-Id: I6fcda969a9e9427198bffffd16cece9c37dbdbd3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
It's not worth having both cases, since they run at the same time. The
difference is which CPUs they run for: the non-VAES AVX512 code can run
on the Skylake-based AVX512 CPUs, which aren't a usual target for Qt
(servers and workstations), while the AVX512 and VAES case includes the
Ice Lake and Tiger Lake desktop and laptop CPUs.
This is not a good trade-off, but is an stepping stone for the next
commit.
Change-Id: I6fcda969a9e9427198bffffd16cecbe76e03c884
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The strategy is explained in the aeshash() function. I've chosen to
exclude the case of simultaneous VAES and AVX512VL support for len <= 32
case. Instead, the aeshash128_lt32_avx256() does not attempt to use
VAES, because we wouldn't be getting sufficient benefit at the cost of
code expansion (AESENC can dispatch 2 per cycle). See simulation at
https://analysis.godbolt.org/z/8Y54PMWGj.
The code is slightly convoluted with unexpected indentation so most of
the important lines in the algorithm aren't changed by this commit.
Change-Id: I6fcda969a9e9427198bffffd16ceca30f5e924b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The redirect handling for http2 was a little simple. E.g. not handling
relative URLs.
Fix this using the redirect response parsing function which the http1
protocol handler already uses.
Fixes: QTBUG-100651
Pick-to: 6.3 6.2 5.15
Change-Id: Ic0cec4cacc92707e7a7fde1f4665f80995a6057e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The State state data member had non-noexcept move-SMFs, which were
inherited by the move-SMFs of QStringConverter, QStringEncoder and
QStringDecoder.
To fix, because it is called in the move-assignment operator, we need
to mark State::clear() as noexcept, and, since that can perform an
indirect call through clearFn, require the clearFn to be noexcept,
too.
The only users of clearFn were in Qt5Compat; a separate fix should
have been merged there by the time this lands.
Change-Id: Ibe8147970886526b6a479960050e108607b63874
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... of non-trivial type, which needs to be constructed every time the
function is called, no matter whether the user supplies one or not.
Effects on Linux AMD64 O2 C++20 tst_qsettings builds, as an example
heavy-duty QSettings::value() user:
GCC 11.2 libstdc++ (TEXT -= 4.6%):
text data bss dec hex filename
662317 10952 2824 676093 a50fd tst_qsettings-00-baseline
631849 10960 2824 645633 9da01 tst_qsettings-01-qvariant
Clang 10.0.0 libc++ (TEXT -= 2.8%)
text data bss dec hex filename
808448 10616 2832 821896 c8a88 tst_qsettings-00-baseline
785890 10624 2832 799346 c3272 tst_qsettings-01-qvariant
Pick-to: 6.3
Task-number: QTBUG-98117
Change-Id: I7366f063e3ec34c040fd35ffd274e8ed5a722132
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The change is presumably an unintentional side effect of QVariant and
QMetaType system changes in Qt 6, but it arguably is a good change.
Document it in the porting guide, while evaluating whether (and figure
out how) we want to support integer values as well.
Pick-to: 6.3 6.2
Task-number: QTBUG-99642
Change-Id: Id1589c594bcdc2afe5c4fd0e47a158cd5e03e52f
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The existing name lookup code used C's toupper() function for
case-insensitive comparison. However, that function's result depends
on the current locale.
Since the matcher is supposed to match the likes of "iso-8859-1" and
"latin-1", matching may fail in locales, such as Turkish, where
toupper(i) is İ (or i, if the former isn't representable in the current
charset), but toupper(I) remains I, causing a False Negative.
To fix, use the US-ASCII-only QtMiscUtils::toAsciiLower() function,
which has the added advantage that it's inline.
Pick-to: 6.3 6.2
Change-Id: I70613c0167d84e3dc3d282c61c716b5dd0b3e6bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The existing name lookup code used C's toupper() function for
case-insensitive comparison. However, that function's result depends
on the current locale.
Since the matcher is supposed to match the likes of "iso-8859-1" and
"latin-1", matching may fail in locales, such as Turkish, where
toupper(i) is İ (or i, if the former isn't representable in the current
charset), but toupper(I) remains I, causing a False Negative.
To fix, use the US-ASCII-only QtMiscUtils::toAsciiLower() function,
which has the added advantage that it's inline.
Pick-to: 6.3 6.2
Change-Id: I70613c0167d84e3dc3d282c61c716b5dd0b3e6bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The existing name lookup code used C's toupper() function for
case-insensitive comparison. However, that function's result depends
on the current locale.
Since the matcher is supposed to match the likes of "iso-8859-1" and
"latin-1", matching may fail in locales, such as Turkish, where
toupper(i) is İ (or i, if the former isn't representable in the current
charset), but toupper(I) remains I, causing a False Negative.
To fix, use the US-ASCII-only QtMiscUtils::toAsciiLower() function,
which has the added advantage that it's inline.
Pick-to: 6.3 6.2
Change-Id: I70613c0167d84e3dc3d282c61c716b5dd0b3e6bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The existing name lookup code used C's toupper() function for
case-insensitive comparison. However, that function's result depends
on the current locale.
Since the matcher is supposed to match the likes of "iso-8859-1" and
"latin-1", matching may fail in locales, such as Turkish, where
toupper(i) is İ (or i, if the former isn't representable in the current
charset), but toupper(I) remains I, causing a False Negative.
To fix, use the US-ASCII-only QtMiscUtils::toAsciiLower() function,
which has the added advantage that it's inline.
Pick-to: 6.3 6.2
Change-Id: I70613c0167d84e3dc3d282c61c716b5dd0b3e6bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The existing name lookup code used C's toupper() function for
case-insensitive comparison. However, that function's result depends
on the current locale.
Since the matcher is supposed to match the likes of "iso-8859-1" and
"latin-1", matching may fail in locales, such as Turkish, where
toupper(i) is İ (or i, if the former isn't representable in the current
charset), but toupper(I) remains I, causing a False Negative.
To fix, use the US-ASCII-only QtMiscUtils::toAsciiLower() function,
which has the added advantage that it's inline.
Pick-to: 6.3 6.2
Change-Id: I70613c0167d84e3dc3d282c61c716b5dd0b3e6bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>