Commit Graph

56067 Commits

Author SHA1 Message Date
Marc Mutz
ba0c2c4b46 tst_qsslsocket: remove tons of deprecation warnings
The TLS v1.0 and v1.1 enums are all deprecated since 6.3. At the same
time, the test requires their use, because none of the peers seeem to
implement TLS v1.2, yet (cf. e.g. QTQAINFRA-4499).

Fix by copying the relevant enum values into global variables and
using those. This is a selective way to deal with the issue. The use
of the enums is so widespread in the test that the alternative would
have been to globally suppress deprecation warnings, which, however,
may suppress warnings we may actually want to fix.

Pick-to: 6.3
Change-Id: I4186be72209527fc404f3ba0a5a15f9719c64698
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-12 00:48:17 +02:00
Giuseppe D'Angelo
b2233f19c9 Annotate QMutex with TSAN annotations
The Q(Basic)Mutex fast paths are entirely inline in the caller, which
means we need to annotate its operations directly or TSAN doesn't know
what's going on. Also annotate QRecursiveMutex.

The tryLock code could be in principle simplified via a QScopeGuard
but I didn't want to make a central class like QMutex depend on it.

[ChangeLog][QtCore][QMutex] QMutex now has annotations for
ThreadSanitizer.

Change-Id: Ibb130404e63a5ec9bcef9675f9addd16a2c38b7f
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-11 23:26:01 +02:00
Giuseppe D'Angelo
e996253774 Add a marker for post-C++17 APIs in exported classes
MSVC will export any function in an exported class, including inline
ones. Conversely: client code calling inline functions in imported
classes will end up simply calling the symbol of the function, even if
the function is fully inline.

This is a problem for adding post-C++17 APIs in Qt. Such APIs are added
as inline functions protected by feature-macro tests, so that both Qt
and client apps can use any C++ version they want (any combination
works).

However, if we add a function using post-C++17 API to an exported class,
then the combination "Qt built in C++17" + "client built in post-C++17"
won't work any more. The client will expect the symbol for that function
to be exported by Qt, but Qt won't have it (built in C++17).

As a workaround, add a marker that turns these functions into "faux
templates", like Q_WEAK_OVERLOAD does.

Change-Id: I2adab81e3129c881c5a8e0772948b176fa4db1b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-11 23:26:00 +02:00
JiDe Zhang
251e9f0bed Use the QSurface for QRhiGles2InitParams::fallbackSurface
There is no need to limit the type to QOffscreenSurface here, QRhi does
not depend on the behavior in QOffscreenSurface. Users can use the
custom offscreen QSurface types if needed.

Task-number: QTBUG-102257
Change-Id: I47a064496f8c5f1986a0e11ec748ea32a03b903e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-04-12 01:23:53 +08:00
Lars Knoll
ed5f33a3f1 Add support for the HDRExtendedSrgbLinear color space on Metal
Request 16 bit floating point backbuffers and set the color space
of the CAMetalLayer to kCGColorSpaceExtendedLinearSRGB if we set
up the swap chain to use extended SRGB.

Unfortunately the required CAMetalLayer.wantsExtendedDynamicRangeContent
property is not yet available on iOS, so for now this is a macOS
only feature.

Change-Id: I28ab12cc0b829eded721061da2679be8e31d6b9d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-04-11 19:23:53 +02:00
Sona Kurazyan
c253e65429 QFileSelectorPrivate: don't pass QChar by const reference
Change-Id: I8aeb31bf7ad7160636379f3248e327e158016526
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-04-11 14:23:30 +02:00
Sona Kurazyan
748e759df8 QtCore: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.

Change-Id: Ibe32a11699f67df2aa80505ba2944f33e5e823e0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-04-11 14:23:26 +02:00
Jarek Kobus
b49f7e064c Ensure that readAllStandardError() doesn't crash on assert
Ensure that it's safe to call readAllStandardError()
when process channel mode is set to MergedChannels.

Pick-to: 6.3 6.3.0
Task-number: QTBUG-102177
Task-number: QTCREATORBUG-27196
Change-Id: I01073255d9347dee4654d602802a12d341372b73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-09 20:31:11 +02:00
Giuseppe D'Angelo
5d8a7652b9 QProxyStyle: reimplement event() handling
There is no use case for QProxyStyle to forward events to its base
style. QApplication does not send events to it; a style using e.g.
timers or so will have them active on *itself*, not on the proxy.

Moreover, forwarding *all* events is broken: QTBUG-96213 has been
triggered by forwarding DeferredDelete events sent to the proxy (thus
accidentally deleting the base style). But one can concoct many other
similarly broken situations; for instance, setting a proxy onto a base
style will make the style a child of the proxy.  That sends a
QChildEvent to the proxy (ChildAdded), and that event is then passed on
the base style, resulting in the base style receiving an event saying
"you have yourself as a child".

Change-Id: I3b92bb168ce3c54a32469c36b6d1da4380ed564f
Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-09 00:15:29 +02:00
Liang Qi
09e9f45933 xcb: get geometry correctly for rotation with RAndR 1.5
xcb_randr_get_crtc_info() returns already rotated size.

Pick-to: 6.3
Change-Id: I33eacf988b44cea77411ad79ae24fef7e8e1564e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-04-08 18:30:17 +00:00
Liang Qi
4609cc8631 xcb: compare with screen name instead of old monitor info
because the old xcb_randr_monitor_info_t was invalid very often
during update.

Pick-to: 6.3
Change-Id: I8c0bda93bde4e816fc98cde1a7205c6369ab39e1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-04-08 20:30:17 +02:00
Ievgenii Meshcheriakov
59860685a1 Update CLDR-derived data to newly-released v41
Fixes: QTBUG-101214
Change-Id: I42f3e76d03b4759d3cda9ab81856d0b6d7506d8e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-04-08 19:55:18 +02:00
Andreas Buhr
f929756578 Fix crash in tst_qmltc_examples on Android
tst_qmltc_examples failed because m_accessibilityContext
could become a dangling pointer if the object in points to gets
deleted. This resulted in a crash.
Amends e0c61193ea.

Task-number: QTBUG-101865
Task-number: QTBUG-95764
Pick-to: 6.3 6.2 5.15
Change-Id: Ie85118429b1afa6e4a41f899ca065f493e166570
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-08 19:55:18 +02:00
Jonas Kvinge
1007aac63a Fix check for pcre2 using cmake
When PCRE2 is compiled using cmake, a pcre2 cmake file is installed
and Qt fails to configure because components isn't specified for
find_package.
In recent PCRE2 releases components needs to be specified for
find_package.

Fixes: QTBUG-102358
Pick-to: 6.2 6.3
Change-Id: Ib842b2c4b1c0bf38aa5da5475eaa2b3c56c6b822
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-04-08 13:03:30 +02:00
Tor Arne Vestbø
9ab06e6185 Guard against QWindow being deleted during close event
The QBoolBlocker would end up using a stale d-pointer if the window
was deleted during delivery of the close event.

Fixes: QTBUG-102327
Pick-to: 6.3 6.2
Change-Id: I8f458581eeabf0d0f27a348ad1f926295caa3a58
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-08 03:51:10 +00:00
Ivan Solovev
c366d57594 Android: minor refactor in QTimeZonePrivate backend
getDisplayName() now returns QString instead of QJniObject. It's more
clear and allows to save some QJniObject::toString() calls in other
parts of code.

Pick-to: 6.3 6.2
Change-Id: I0f2061cf1dff21c09c2272bf1e9126ff1ea0ed3e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-08 00:13:01 +02:00
Ivan Solovev
44f3fe1cf4 Android: use BCP 47 tag to create a correct Locale for QTimeZone::displayName()
Before the patch we tried to create a java Locale object by passing the
human-readable language, territory and variant strings. However, the
Locale constructor accepts ISO-defined codes.

Fix it by using a factory method Locale.forLanguageTag() [0] that
constructs a Java Locale object based on BCP 47 tag.

[0]: https://developer.android.com/reference/java/util/Locale#forLanguageTag(java.lang.String)

Fixes: QTBUG-101460
Pick-to: 6.3 6.2 5.15
Change-Id: If414c66cf0e5b7e8299ffc3a6038b6f9eb79d5ec
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-08 00:13:01 +02:00
Edward Welbourne
9fee35a2ed Fix assertion failure when parsing a doubly-invalid date-time text
When the date-time string falls in a spring-forward (so is invalid)
and one of the fields of the parsed string doesn't match the format
it's meant to (e.g. a single-digit seconds field when format ss was
specified), a check that the current fall-back date-time is between
the minimum and maximum for the parser object failed, triggering an
assertion.

In any case, an invalid default-value wasn't useful to the code that
parsed a single section of the date-time string, so brute-force the
current value to a valid date-time (when possible) using the usual
round-trip via milliseconds since the epoch.

Added the test-case which first revealed the problem, plus a couple
more informed by it, to exercise the same code-paths with fewer things
failing.

Fixes: QTBUG-102199
Pick-to: 6.3 6.2 5.15
Change-Id: I658308614505ef25f4c97d0de6148acb54a65a0f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-07 23:04:04 +02:00
Edward Welbourne
d82301a900 Don't use QSKIP() when merely eliding part of a test
Use of QSKIP() means the whole test is skipped; when all applicable
parts of a test have passed and some part of the test is inapplicable,
merely report that it is skipped, rather than discarding the PASS for
all the parts that do work.

In the process, eliminate a spurious layer of indentation; the earlier
test only needed a scope to contain its declaration, a goal adequately
achieved by the scope of the if constexpr block.

Task-number: QTBUG-99123
Pick-to: 6.2 6.3
Change-Id: Ie4790a24ebf49a7f3035ffad42d78450e1560832
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-04-07 22:04:04 +01:00
Edward Welbourne
681bef22a7 Fix generation of qsimd_x86 files to require no hand-editing
Recent fixes to include the "We mean it" comment in the header also
lead to that comment appearing in the generated .cpp file, which also
lacked the "This is a generated file. DO NOT EDIT." comment. The
generated header also lacked a blank line after the "We mean it"
comment, so include that (and take it out, too, in the .cpp). The
"Please see" line of the "DO NOT EDIT" comment also used the name of
the generator script as seen from the Makefile that drives the
regeneration; replace this with the README.md file that actually
explains how to regenerate the files in corelib/global/.

This amends commit 71af0d7059
and commit b852584556

Change-Id: I4b5b4dbef5954819632bb625d1914a9ec46e15d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-07 23:04:04 +02:00
Timur Pocheptsov
8b446859de tst_QTcpSocket: remove redundant include
... a leftover from the initial patch-set not required in the one that
merged.

Change-Id: I0c5e94d8a0409faf4f7f9a354e98e239f7186da3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-07 22:45:05 +02:00
Sona Kurazyan
80363889fe Replace uses of _qba with _ba
Task-number: QTBUG-101408
Change-Id: I5175428c2be934b09f45bd06b0b47643003e25c7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-04-07 19:30:17 +02:00
Sona Kurazyan
a885f28933 Replace uses of _qs with _s in tests
Task-number: QTBUG-101408
Change-Id: If092a68828a1e8056259cf90d035d9a87989244b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-04-07 19:30:17 +02:00
Eirik Aavitsland
f5174abec3 Fix backingstore fractional DPR glitches for widgets in child windows
For such widgets, QBackingStore::flush() takes both a region and an
offset. Both must to be DPR scaled to the native backingstore
coordinates. When the DPR is fractional, it can happen that the
rounding of both effectively accumulate into an off-by-one error.
Detect and adjust for this situation to avoid painting glitches.

Task-number: QTBUG-96223
Fixes: QTBUG-102366
Pick-to: 6.3 6.2 5.15
Change-Id: I9ccd4ee54660419a1db8c27358f1419de58ae932
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-04-07 18:48:37 +02:00
Pasi Petäjäjärvi
9e0ba8b927 CI: Blacklist failing networks tests for QNX qemu
Most likely related to qemu network configuration which cannot be
modified. Reason is that in QNX there is tool which can be controlled
qemu configuration, and it does not provide options for more finer
grade network configuration.

Pick-to: 6.2 6.3
Task-number: QTBUG-101274
Change-Id: I660466e36252e902a2314fb3f4988c531cda9214
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-07 15:39:22 +03:00
Tor Arne Vestbø
e702b64b34 macOS: Allow duplicate entries in file dialog name filter
Using QFileDialog::setMimeTypeFilters() with a list of mime types may
in some cases result in the same name for two different mime types,
for example both "image/heic" and "image/heif" will result in the
name "HEIF image (*.heic *.heif)".

When the resulting name filter is propagated to the platform layer,
we add entries to a NSPopUpButton, but the convenience API we used,
addItemWithTitle:, does not allow duplicates. As a result, the entries
in the menu didn't match the list of name filters we then looked up
and applied to the actual file name filtering, causing off by one
errors.

Ideally we'd make sure the name filters are unique and well formed
all the way from the QFileDialog to the platform and back, but for
now we work around issue by using the NSMenu API directly, which
does allow for duplicate entires.

Fixes: QTBUG-101361
Pick-to: 6.2 6.3
Change-Id: Iee3db4e6c5adfdbdd7f0094b4efd65aa2ecc0f57
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-04-07 14:05:04 +02:00
Tor Arne Vestbø
0709803416 QFontDatabase: Simplify and standardize emit of fontDatabaseChanged signal
Change-Id: Iabb637b52de225bf8823b1c3089e50db932c0b85
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-04-07 14:05:04 +02:00
Tor Arne Vestbø
a84b96a5bc QFontDatabase: Add internal documentation for QFontDatabasePrivate
Change-Id: I40e770552110fa271c912d18197399a9c5071c56
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-04-07 14:05:04 +02:00
Tor Arne Vestbø
88c0a317ec QFontDatabase: Track empty slots in application font list via file name
This allows us to use the properties of the application font as a way to
distinguish whether the font has been populated or not.

Change-Id: Iccce32b23c1b987f2f75fef955227bddc2495fa3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-04-07 14:05:04 +02:00
Mårten Nordheim
c159546401 Network[doc]: Update Qt6-changes for QNetworkInformation in 6.3
Pick-to: 6.3
Change-Id: Icb6d19fd0b7554a83eec2fdc5843e995c5434ee2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-04-07 14:05:04 +02:00
Mårten Nordheim
188cbc0417 Network[doc]: Update Qt6-changes with QNetworkInformation details
I always meant to remove the note and update it with a link, but forgot.

Qt 6.2 details only so it can be easily cherry-picked there.

Pick-to: 6.3 6.2
Change-Id: I4db3919b71971a997ac8a988951b01c984a8a791
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-04-07 14:05:03 +02:00
Sona Kurazyan
8aa3cf21da Add literal operators for QString/QByteArray to StringLiterals namespace
[ChangeLog][QtCore] Added literal operators for _s and _ba for QString
and QByteArray respectively in the Qt::Literals::StringLiterals
namespace.

Task-number: QTBUG-101408
Change-Id: I5cd4e7f36f614ea805cfecc27b91c5d981cd3794
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-04-07 09:22:28 +02:00
Timur Pocheptsov
a0470ec261 QProxyStyle: do not pass DeferredDelete to baseStyle
Calling deleteLater on an object of type QProxyStyle (or inheriting from
QProxyStyle) results in this object never deleted, since it simply
passes the event to its base style, which in case of deleteLater is
not right. QProxyStyle inherits QCommonStyle which in turn inherits
QStyle (which is QObject's descendent). So for the style to be deleted
we pass DeferredDelete to its base class - QCommonStyle::event (which
means QObject::event, since neither QCommonStyle nor QStyle override
QObject::event()).

Pick-to: 6.3
Fixes: QTBUG-96213
Change-Id: I99b8f413624e2f18ddae3fb331997f767de219d0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-07 05:04:41 +02:00
Tor Arne Vestbø
6cbaf834a7 QFontDatabase: Move registration of platform application fonts into call sites
Makes it more transparent what's going on, rather than the opaquely
named static helper function.

Change-Id: I9a5bd348007e9ed11214f1e55c4b39d4734328dc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-04-07 03:18:57 +02:00
Tor Arne Vestbø
24f242a2f3 QFontDatabase: Make match/bestFoundry/load(Single)Engine part of QFontDatabasePrivate
Makes it clearer where and how they are used, and to set breakpoints on them.

Change-Id: Id2aaeb51ff80676ad3316d29e23661b2cad79478
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-04-07 01:18:57 +00:00
Tor Arne Vestbø
04837c1687 Don't blit individual rects of region when when scrolling backingstore
The QPlatformBackingStore::scroll() API takes a QRegion as input, but
we have no guarantee that the individual source and destination rects
of the region will not overlap each other when applying the scroll offset,
so we can't naively iterate the rects and call qt_scrollRectInImage for
each one.

The reason this didn't cause any issues in practice was that the QWidget
repaint manager was always passing in a single rect as the region.

On the other hand, the client has requested a scroll of the given
region, so it might assume any other part of the backing store is
preserved as is. Scrolling the bounding rect of the region violates
this assumption.

Amends 19ef76b0606621f189d3bc56549d200f2f5ebb25.

Pick-to: 6.2 6.3
Change-Id: I27934dd6685311c0b53ea2adb60fa5997e360f6c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-04-07 03:18:56 +02:00
Tor Arne Vestbø
c1b0b061e1 doc: Warn against using the screen's refresh rate for driving animations
Pick-to: 6.2 6.3
Change-Id: Id26aae76792a4109b2ea6cca3db69ab505495d65
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-04-07 03:18:56 +02:00
Marc Mutz
9c21347863 Rest of QtBase: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERN
It's one of our best tools to improve compile times.

In some places, we can't do the change, yet, because there's no .cpp
file for the header file.

Also mark Q_DECLARE_METATYPE macros that are in the wrong place. We
shouldn't have Q_D_M markup for public classes in .cpp or _p.h files.

Fixes: QTBUG-102206
Change-Id: Iec0a39e4745571b24d07dacc87593321967c10e3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-04-07 01:29:24 +02:00
Eirik Aavitsland
6963190581 Graphicsview: Avoid background clearing glitches under fractional DPR
QGraphicsView enables autoFillBackground on the viewport widget, so
the dirty area is cleared before repaint. Then QGraphicsView fills the
same area with the background color. However, under fractional DPR
scaling, the scaled version of the dirty rect may end up covering only
a fractional part of the pixels on the edges. If antialising is
enabled, such pixels will be only partially filled with the background
color, leaving the clear color partially visible as glitches. This can
be seen in the dragdroprobot example.

Fix by disabling AA during background filling, as it has no purpose
then anyway.

Task-number: QTBUG-96223
Pick-to: 6.3 6.2 5.15
Change-Id: Ica00997141701faa0cf368caced84ae50ba017d0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-04-06 23:30:57 +02:00
Allan Sandfeld Jensen
ca106e261e Make keyClick safer for QWindows going away on presses or during wait
We already have similar logic in the QWidget variant.

Pick-to: 6.3 6.2
Task-number: QTBUG-102253
Change-Id: Idf1e3474f3189909f1cba7d5dedc2cde12f1338e
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
2022-04-06 20:39:33 +02:00
Alexey Edelev
6569a4068b Map the 'verbose' configure option to CMake
Raise the CMake log level to STATUS when the 'verbose' argument is
passed to the configure script.

Change-Id: I736d95ab66b115f8416eec7f9e2ee96d1580c78d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-04-06 16:46:59 +02:00
Iikka Eklund
878984a014 Conan: Resolve the 'qt_host_path' before assigning it to 'QT_HOST_PATH' env
The value of the 'qt_host_path' option needs to be resolved fully
before assigning it to 'QT_HOST_PATH' env.

This icludes expanding ~ constructs, resolving symlinks, expanding vars
and relative paths.

Pick-to: 6.2 6.3 6.3.0
Change-Id: Ia338105ccb4a203796864304f463b222163c5193
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-04-06 17:46:59 +03:00
Ivan Solovev
7c9afa8d00 Q[Multi]Hash: fix squeeze()
When calling QHash::reserve(), or when creating the
internal QHashPrivate::Data structure, the value 0
for the size parameter is reserved for performing
the squeeze operation.

However commit 8a984ab772
broke it, by using the 0 value in QHashPrivate::Data
constructors as a mark that no resizing needs to be done.

This patch reverts the problematic commit (also applying
some later fixes to the code), and adds the missing
tests for Q[Multi]Hash::squeeze().

Pick-to: 6.3 6.2
Change-Id: Id644df7b2beb008e6a37b2c89b709adfbd893e25
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-06 16:46:59 +02:00
Ivan Solovev
d11941db41 Q[Multi]Hash::reserve(): do nothing if desired size is less than current
Calling Q[Multi]Hash::reserve(n) when n is much smaller than the
current amount of elements in the hash, could result in an infinite
loop, because at some point the algorithm could not find a free bucket
for the element.

Fixing it by returning early if the new desired capacity is less than
current.

Fixes: QTBUG-102067
Pick-to: 6.3 6.2
Change-Id: I38ef0b2168c4e2a317eedf91b2155b1fdffb1c27
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-06 16:46:59 +02:00
Xiao YaoBing
87098106d0 Remove unnecessary type conversion
Change-Id: I09e3e4596a8c79b3ece08c694010c76e05d8a22b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-04-06 22:46:58 +08:00
Assam Boudjelthia
bc71496a34 Android: fix androidtestrunner failure parsing
Make sure androidtestrunner reports the following cases as failures:
* XPASS test case
* The test output doesn't have closing block.
* The test result read from output.txt is empty

Pick-to: 6.2 6.3
Fixes: QTBUG-100312
Task-number: QTBUG-100470
Change-Id: Ifbb3c31fa22159df0c39b264e95e2f1ccd16e5ff
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-04-06 14:50:17 +03:00
Eirik Aavitsland
0ff7328f37 Improve surface format request for baseline test of GL painter
Different platforms and drivers hae different defaults, so make sure
to request what we need.

Pick-to: 6.3 6.2
Change-Id: I54ae6e0770fea53fbf59c86d7e55aa5897292b67
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-04-06 12:44:40 +02:00
Marc Mutz
20e6a049fe QtNetwork: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERN [2/2]: private API
It's one of our best tools to improve compile times.

Can't backport to Qt 6.2 because the macros don't exist there.

Pick-to: 6.3
Task-number: QTBUG-102206
Change-Id: Ic8f3870d8eec6211c4be506dc67717cc4e0ff7d6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-04-06 12:44:40 +02:00
Marc Mutz
787d178b19 QBuffer: optimize seek()-past-end-of-buffer
Use new QByteArray::resize(n, ch) method to resize the buffer
directly, instead of first allocating a QByteArray full of NULs and
then using public write() API to append it.

Change-Id: Ibdb082b970de0ba24534a570ecb23304c5f1470c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2022-04-06 12:44:40 +02:00
Marc Mutz
a00a1d8806 QByteArray/QVarLengthArray: add missing resize(n, v) overloads
QList and QString had them, so add them to QByteArray and
QVarLengthArray, too.

In the QVLA case, we need to jump though a hoop or two to avoid having
to duplicate all the reallocation logic. Nothing a few template tricks
cannot solve.

[ChangeLog][QtCore][QByteArray] Added resize(n, ch) overload.

[ChangeLog][QtCore][QVarLengthArray] Added resize(n, v) overload.

Fixes: QTBUG-102270
Change-Id: I0d281ae5b574f440f682e4a62427b434dcf5b687
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-06 10:44:40 +00:00