Commit Graph

54811 Commits

Author SHA1 Message Date
Allan Sandfeld Jensen
552c4a9655 Read QThreadPool::objectName thread-safe
QThreadPool allows method calls from any thread, but QObject does not
so copy objectName so we may use it locally under our own lock.

Pick-to: 6.3 6.2
Task-number: QTBUG-99775
Change-Id: Ib28910649f5d0f9ce698c7da495069635d608d03
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-01-13 19:47:23 +01:00
Allan Sandfeld Jensen
3f32dcd1dd Allow reading QObject::objectName from other threads again
The new binding system made it impossible to read from non-owning threads,
but we have code that did so with external locking. This patch makes it
safe again, assuming all reads and writes are locked. This is left
intentionally undocumented.

Pick-to: 6.3 6.2
Task-number: QTBUG-99775
Change-Id: I845afa5d545ca0ac762ac369181b1497dac52195
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-13 18:47:23 +00:00
Edward Welbourne
d83dbc3db2 Tidy up macOS collation and add some assertions
Change-Id: I7af21ce38f2f23498d7c8a7e027bfffb149a43e3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-01-13 19:47:22 +01:00
Edward Welbourne
5d228beb52 Fix an assertion failure in massageAdjustedDateTime()
The QDateTimeData &d it's passed is a copy that's about to be
modified; before we do so, we haven't detached so its internals have a
ref-count of two, contradicting an assertion in the non-const
Data::operator->(); so just directly access d.d->m_timezone, since we
know that spec == TimeZone implies !isShort().
Added test that triggered the assertion and now doesn't.

Fixes: QTBUG-99668
Pick-to: 6.3 6.2 6.2.3 5.15
Change-Id: I07321ad91be5adce524be18e4ab82eee7110dc6a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-01-13 19:47:22 +01:00
Janne Juntunen
b84f4a350d tst_QImageWriter: skip writing unsupported image formats
Do not try to test writing of image formats which are not supported on
the platform under testing. This test was failing for .ico files on
webOS.

Fixes: QTQAINFRA-4722
Pick-to: 6.3
Change-Id: Ic7d40d9751e0f921d9721c01492cca28d798e141
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-01-13 20:47:22 +02:00
Edward Welbourne
13d2e13290 Make counts of various types of test result add up correctly
Added tests for repeated skips and failures (from within void lambdas,
to simulate skips and failures from within event handlers). These
exhibit yet more ways to count more than one outcome for a test.  The
new QTest::failOnWarning() can also provoke more than one failure from
a single test, and several existing selftests exhibited various ways
for the Totals line's counts to add up to more than the number of
actual tests run.

Fixed counting so that only the first decisive incident is counted.
Tests can still report later failure or skipping, but only the first
is counted.

Added a currentTestState in qtestlog.cpp, by which it keeps track of
whether the test has resolved to a result, and clearCurrentTestState()
by which other code can reset that at the end of each test. This
brought to light various places where test-end clean-up was not being
handled - due to failure or skipping in a *_data() method or init, or
a skip in cleanup.

Fixes: QTBUG-95661
Change-Id: I5d24a37a53d3db225fa602649d8aad8f5ed6c1ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-01-13 19:47:22 +01:00
Edward Welbourne
95e4996688 Revise the explanation for leaving QTest::qWait() as it is
The recently aborted attempt to act on the comment's recommendation
revealed a major performance regression, so mention that instead of
the now historical compiler problem that used to be our reason for not
simply calling qWaitFor().

Change-Id: I81714b556998217a833c21b4208118b7292b7a96
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-01-13 14:47:46 +00:00
Friedemann Kleint
e376c229e9 uic/Python: Import base class for flag values
Extend the logic extracting enum base classes to flags
to handle things like  QAbstractItemView::EditTriggers.
Exclude the Qt namespace.

Amends de15836dbf.

Fixes: PYSIDE-1773
Task-number: PYSIDE-1404
Pick-to: 6.2 6.2.3 6.3
Change-Id: Ib0cd0836a91f330e5bc3307690062a965abec7eb
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2022-01-13 15:47:46 +01:00
Eirik Aavitsland
7719fcea4b Add a couple of utility functions to the baseline test framework
Adds a function for setting the baseline Project name, which selects
the top level server directory and hence config settings.

Also adds a function that lets the client override the server config
setting for the project image keys (ItemPathKeys). This is the list of
properties that will be used to determine which clients are "the
same", i.e. which baseline to compare against. Overriding that is
handy since it allows experimentation and customization of clients
without involving changes in the project config on the baseline
server.

Pick-to: 6.3 6.2
Change-Id: Id3998356494a9a2cb71c009b43593d3dc1b6963a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2022-01-13 14:56:37 +01:00
Ulf Hermann
657a18c7fa QMetaType: Allow conversion of derived gadget types to their base types
A derived gadget has an is-a relationship with its base type. It
should be convertible. In fact, canConvert() already tells us it is.

Change-Id: I71a5ac9afd78e88adb23b4d0e757f34077f63207
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-01-13 13:56:36 +00:00
Kai Köhne
873a8edff8 Doc: Fix snippet to match actual QFileInfo behavior
The documentation was already updated in abfac029ce,
but the snippet still incorrectly suggested QFileInfo::size would
report the actual size of an .lnk file on Windows.

Pick-to: 5.15 6.2 6.3
Change-Id: I03b96b2efcb713fbc4dd30fc526e1209806bf5cf
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-01-13 14:56:36 +01:00
Janne Juntunen
3535f66e07 tst_QImageReader: move text reading tests behind a flag
Moved tst_QImageReader::readText() and tst_QImageReader::preserveTexts()
behind QT_NO_IMAGEIO_TEXT_LOADING flag. The tests were failing on
webOS.

Fixes: QTBUG-99717
Pick-to: 6.3
Change-Id: Ib23decbaffe8d87c07fd68c41a28a3f7ca969cb1
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-01-13 15:56:36 +02:00
Laszlo Agocs
a325016aa9 rhi: Add the basic infrastructure for tessellation support
...but this will only be supported with Vulkan and OpenGL 4.0+ and
OpenGL ES 3.2+ for the time being.

Taking the Vulkan model as our standard, the situation is the
following:

- Vulkan is ok, qsb secretly accepts .tesc and .tese files as input
  already (plus QShader already has the necessary plumbing when it
  comes to enums and such) To switch the tessellation domain origin to
  bottom left we require Vulkan 1.1 (don't bother with
  VK_KHR_maintenance2 on top of 1.0 at this point since 1.1 or 1.2
  implementations should be common by now). The change is essential to
  allow the same evaluation shader to work with both OpenGL and
  Vulkan: this way we can use the same shader source, declaring the
  tessellation winding order as CCW, with both APIs.

- OpenGL 4.0 and OpenGL ES 3.2 (or ES 3.1 with the Android extension
  pack, but we won't bother with checking that for now) can be made
  working without much complications, though we need to be careful
  when it comes to gathering and setting uniforms so that we do not
  leave the new tessellation stages out. We will stick to the Vulkan
  model in the sense that the inner and outer tessellation levels must
  be specified from the control shader, and cannot be specified from
  the host side, even though OpenGL would allow this. (basically the
  same story as with point size in vertex shaders)

- D3D11 would be no problem API-wise, and we could likely implement
  the support for hull and domain shader stages in the backend, but
  SPIRV-Cross does not support translating tessellation shaders to
  HLSL.  Attempting to feed in a .tesc or .tese file to qsb with
  --hlsl specified will always fail. One issue here is how hull
  shaders are structured, with the patchconstantfunc attribute
  specifying a separate function computing the patch constant
  data. With GLSL there is a single entry point in the tessellation
  control shader, which then performs both the calculations on the
  control points as well as the constant data (such as, the inner and
  outer tessellation factors).  One option here is to inject
  handwritten HLSL shaders in the .qsb files using qsb's replace (-r)
  mode, but this is not exactly a viable universal solution.

- Metal uses a different tessellation pipeline involving compute
  shaders. This needs more investigation but probably not something we
  can prioritize in practice. SPIRV-Cross does support this,
  generating a compute shader for control and a (post-)vertex shader
  for evaluation, presumably in order to enable MoltenVK to function
  when it comes to tessellation, but it is not clear yet how usable
  this is for us.

Change-Id: Ic953c63850bda5bc912c7ac354425041b43157ef
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-01-13 13:44:29 +01:00
Yuhang Zhao
c1f7194b44 QStandardPaths_win: Add mapping for DownloadLocation
Un-special-case for DownloadLocation. I assume the original
code is written like that to be compatible with some really
old versions of Windows.

Change-Id: I643401910bae9a061f2e02c651971b4f2dd46901
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-01-13 20:13:49 +08:00
Marc Mutz
54945d58b3 QApplication: port manual users of QMutableEventPoint
... to new static setter API, which doesn't depend on undefined
behavior.

These users didn't use QMutableEventPoint::from(), but static_cast<>,
so they were only found when the non-static setters were removed,
locally.

Task-number: QTBUG-99615
Pick-to: 6.3
Change-Id: I37faf17b2b180e0f6e8bb4e5f46951a2cc29678d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-01-13 09:19:23 +01:00
Yuhang Zhao
ae7e11e5c6 QStandardPaths: Remove old MinGW workaround
From the comments the workaround is for MinGW
older than v7, now our CI has MinGW v9 trunk,
it should be safe to drop this.

The magic number is replaced by the official function,
although it was introduced in Win8, Qt6's minimum
supported platform is Win10, so it's also safe to do.

As a drive-by, remove two unused includes.

Change-Id: I891fe3883f17d4914932784868d7446299d32c65
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-01-13 13:14:30 +08:00
Yuhang Zhao
6241dcb9a4 QStandardPath: fix typo
Pick-to: 6.3 6.2
Change-Id: I12837ce614ea91a8a72191092dc8c835f74107cc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-01-13 10:10:50 +08:00
Marc Mutz
5beb842b98 QWindowSystemInterface: port to QMutableEventPoint static setter API
This code was actually ok (no UB), but it's in the way of making
QMutableEventPoint a befriendable namespace, so port from using
QMutableEventPoint to QEventPoint instances + QMutableEventPoint
static setters.

Task-number: QTBUG-99615
Pick-to: 6.3
Change-Id: I1f123837d62a2200e36faf89f6912ee59be2f915
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-01-13 02:27:36 +01:00
Thiago Macieira
214df31916 Add a few explicit conversions back from int
Suppresses GCC's -Wconversion, which is not enabled by default.

error: conversion from ‘int’ to ‘quint8’ {aka ‘unsigned char’} may change value [-Werror=conversion]

Change-Id: I0e5f6bec596a4a78bd3bfffd16c998102bd51f7c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-01-12 16:36:54 -08:00
Thiago Macieira
ed753eb5fb QString::compare: fix comparing a 4GB string to 1 QChar
If the size() was larger than INT_MAX, the result would be wrong (and
UB).

Pick-to: 6.2 6.3
Change-Id: I0e5f6bec596a4a78bd3bfffd16c99763e66c2013
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-01-12 16:36:54 -08:00
Marc Mutz
0c3a56b621 tst_QString/tst_QByteArray: add checks for null-ness
We want to preserve nullness where possible. Test that various ctors
do the right thing when presented with null input.

Pick-to: 6.3
Change-Id: Ia1a1d4fb3c919b4fed2d9b87827815a1b5072c54
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-01-13 01:09:08 +01:00
Alex Trotsenko
a93f07e977 tst_qeventdispatcher: fix UB in single-shot timers activation
Any of these timers must be stopped before the corresponding test
function completes. Otherwise, functors will operate on dangling
pointers, which can lead to failures or unreliability of other tests.

Fix this by setting a correct context in the QTimer::singleShot()
call.

Pick-to: 6.2 6.3
Change-Id: Icd23f6d9a2c6e7f33495d6badc4080a1b10c19f8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2022-01-13 02:09:08 +02:00
Robert Löhning
0bc7f94bd8 Q*Parser: Replace "data" with "contents" in strings
...to be clearer and avoid confusion with "data section".

Change-Id: I13319be0e3e12aecf1e0e86c256007dfe6cb98c6
Pick-to: 6.3
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-01-12 23:10:01 +01:00
Robert Löhning
90f0d522bf Fuzzing: Don't explicitly restrict sizes before loading images
Since Qt 6.0, QImageIOHandlers by default take care of this themselves
by not allocating more than 128 MiB for an image.

This change will not significantly reduce code coverage of the fuzzer
because QImage::loadFromData() calls QImageReader::read() which does
everything QImageReader::size() does except for returning the read size
in the end. On the other hand, it will speed up the execution because
the same image will not be read twice by different QImageReaders anymore.

Change-Id: Iab63d9e5ec02fbe5765fbf7ccb0b82896ec37692
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-01-12 22:10:01 +00:00
Ivan Tkachenko
2baa7eb260 QRollEffect: Remove assignments that have no effect
Value of the member variable `done` will be overwritten after the end of
each `if` block.

Pointed out by PVS-Studio static analysis tool:
https://habr.com/ru/company/pvs-studio/blog/542760

Change-Id: Icaf965aaebfa8a238dd3569689e1496a30d4b6d1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-01-13 01:10:01 +03:00
Thiago Macieira
6099e96d9e QJsonObject: use the UTF-8 string comparator in sorting
No change, the two functions are identical for case-sensitive
comparison. But this allows us to remove the comment that explained why
we were abusing the Latin1 comparator.

Change-Id: I0e5f6bec596a4a78bd3bfffd16c98bbcac6c9dc9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-01-12 13:49:03 -08:00
Tatiana Borisova
2cb5e4bd43 Fix tst_qcollator run time issue on INTEGRITY device
By GHS the only C locale is supported.

Task-number: QTBUG-99123
Pick-to: 6.2 6.3
Change-Id: I3d89f1b2d9eb7f77b75e13a5ca65cebc24538890
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-01-12 21:49:02 +00:00
Thiago Macieira
8623e8ed08 QByteArray: remove left-over Q_NEVER_INLINE after we removed the tables
The comment made a reference to the case tables that used to exist in
qbytearray.cpp prior to commit 9dd8e655cd
("Limit QByteArray's 8-bit support to ASCII"). Now that the parameter is
a function pointer, not a table, inlining is actually beneficial: we
definitely don't want the compiler to emit function calls via the
function pointer.

At least GCC 11 was already doing constant-propagation of the parameter:
While it didn't inline the function, it cloned it and propagated the
constant in each of the two clones. There were 4 copies of this
function: const and non-const, upper and lower.

Change-Id: I0e5f6bec596a4a78bd3bfffd16c912a16602e20a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-01-12 21:47:07 +00:00
Timur Pocheptsov
cd446a7e25 QMacStyle: fix a regression introduced by a button type change
Since we (re)use NSButton to render tab items, the 'momentary push in'
button type breaks the tab. Temporary restore the old 'push on/push off'
type if rendering a tab.

Pick-to: 6.2 6.3 5.15
Fixes: QTBUG-99743
Change-Id: I54b11c1a35373292ecf0bcd5cf7b4ea4203cc031
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-01-12 22:27:21 +01:00
Timur Pocheptsov
c30af31f99 QSslSocket (SecureTransport) add TLS 1.3 ciphersuites
At some point we decided to support a custom set of ciphersuites specified
by QSslConfiguration (which if you ask me was never a good idea). The law
of unforseen consequiences bit us again: since we now give a set of ciphesuites
to QSslConfiguration and set ciphesuites from the configuration a socket has,
we are limited by the ciphersuites we know about at the moment of 'coding'.
Meaning if an SDK was updated and CipherSuite.h later adds more ciphersuites,
we miss them and 'don't support them', while we ... actually do.

This patch tries to add some more ciphersuites introduced in TLS 1.3 (interesting,
SecureTransport does not support TLS 1.3, but TLS 1.3 suites can be used in TLS
1.2 session).

Pick-to: 6.2 6.3 5.15
Task-number: QTBUG-99368
Change-Id: I439b63845c4893e5621cffaf3bcaf62e2b643c74
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-01-12 22:27:21 +01:00
Thiago Macieira
eabb3fd2f0 QVariant: fix incorrect warning about duplicated alias where there isn't
We were always matching a type name to itself because we forgot to
advance the iterator after we did match. The issue was introduced in
commit 46dc8e453a.

Fixes: QTBUG-99620
Task-number: QTBUG-96916
Pick-to: 6.3 6.2
Change-Id: Ib42b3adc93bf4d43bd55fffd16c8a5df6306e404
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Jonas Kvinge <jonas@jkvinge.net>
2022-01-12 11:37:32 -08:00
Kai Köhne
623200643c Doc: Replace "C:\Documents and Settings" paths
"C:\Documents and Settings" isn't a real path anymore since Windows Vista.
Replace it by C:\Users, or - in the snippet for QDesktopServices that
is for demoing a path with space - with C:\Program Files.

Pick-to: 6.2 6.3 5.15
Change-Id: I1bef97b6482180a6467fffcd1d62d6c168bcb389
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-01-12 20:37:21 +01:00
Kai Köhne
23ffc22072 QStyle docs: Use since enum attribute
Use the explicit [since ...] instead of plain text to mark
when new enums were introduced.

Pick-to: 6.3
Change-Id: I13655931c91a509fa64cd545b49c517e975d4cc7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-01-12 19:37:21 +00:00
Marc Mutz
11becbe910 QTzTimeZonePrivate: fix UB (data race on m_icu)
The fallback m_icu QIcuTimeZonePrivate is lazily constructed, which
means that two threads each with their own copy of a QTimeZone with a
shared QTzTimeZonePrivate will race over who gets to set m_icu,
e.g. when concurrently calling QTimeZone::displayName().

Fix by protecting m_icu with a mutex. For simplicity, use a static
mutex, not a per-instance one (which would delete the
QTzTimeZonePrivate copy constructor, which clone() relies on). This is
sufficient for 5.15. For Qt 6, going forward, we could make this
lock-less, too.

[ChangeLog][QtCore][QTimeZone] Fixed a data race on Unix platforms when
implicitly-shared copies of QTimeZone objects were used in certain ways
(e.g. calling displayName()) from different threads and Qt was
configured with ICU support.

Pick-to: 6.3 6.2 5.15
Change-Id: I7e57aef3dd44a90289ad86d0578ece1e54920730
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-01-12 19:37:21 +00:00
Laszlo Agocs
bfc713530a rhi: Add queries for vertex input/output limits
Mainly because we do have legacy code in the Qt 5 graphical effects that
tries to dynamically determine the max number of varyings. Make it
easier to port such code.

Change-Id: I846cab2c2fe7b4cd473b5ced0146ca36f1c8169b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2022-01-12 20:37:20 +01:00
Joerg Bornemann
9d15854138 Fix wrong QT_HOST_* values when qt.conf is present
When a qt.conf was present, QT_HOST_* variables got a wrong default
value.  For example, QT_HOST_BINS would end with /bin/bin.

We must not provide the defaults via QSettings::value(_, defaultValue).
The assignment of the default value is done in
QMakeLibraryInfo::rawLocation() separately after retrieving the value.

This amends commit 04ec14105e.

Pick-to: 6.3
Fixes: QTBUG-99656
Change-Id: I43431664e93ab40417a5432b03e7eb38ae21bad8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-01-12 18:28:24 +01:00
Allan Sandfeld Jensen
96269ecc77 Draw extended RGB solid colors
Pass extended RGB colors through the paint engine.

Change-Id: I2e212cd4c76aaa65439746352c0da2b9db4a506d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-01-12 18:28:24 +01:00
Tor Arne Vestbø
996061a1c0 macOS: Implement QCALayerBackingStore::scroll for improved performance
The CALayer backingstore never had a scroll implementation because we
were relying on the QRasterBackingStore implementation, but as it turned
out that implementation was not applicable for the CALayer backingstore.

We now implement scroll() by determining which part of the back buffer
can be scrolled directly in-place, and then scrolling the rest by
copying from the front buffer. We have to handle both cases, as clients
may scroll multiple times before flushing, and the scrolled area may
overlap both valid back-buffer content and content that needs to be
pulled from the front-buffer.

Pick-to: 6.3 6.2
Change-Id: Icc09c9488386925116779c9024669a4329b38247
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-01-12 18:13:52 +01:00
Tor Arne Vestbø
588f956f78 Expand tst_QBackingStore auto test
Pick-to: 6.3 6.2
Change-Id: Ife6a175867cfc97c2c112d7c1bac606bc6798e98
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-01-12 18:13:51 +01:00
Volker Hilsheimer
999d856bc8 Adapt SQL drivers to Qt 6 change of QVariant::isNull
In Qt 5, QVariant::isNull returned true if either the variant didn't
contain a value, or if the value was of a nullable type where the type's
isNull member function returned true.

In Qt 6, QVariant::isNull only returns true for variants that don't
contain a value; if the value contained is e.g. a null-QString or
QDateTime, then QVariant::isNull  returns false.

This change requires a follow up in the SQL drivers, which must
still treat null-values the same as null-variants, lest they write data
into the data base.

Add a static helper to QSqlResultPrivate that implements isNull-checking
of variants that contain a nullable type relevant for Sql, and add a
test case to the QSqlQuery test that exercises that code.

Pick-to: 6.2 6.3
Fixes: QTBUG-99408
Fixes: QTBUG-98471
Change-Id: I08b74a33aa3235c37d974f182da1f2bdcfd8217e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-01-12 17:41:07 +01:00
Andrey Mozzhuhin
66f0149693 QHttpNetworkConnection: Always set proxy settings to all channels
Proxy settings should always be set to all channels because after switching
from HTTP/2 to HTTP/1.1 they may all be used.

Problem was made in commit 8b9d246225. It is
introduce the QHttpNetworkConnectionPrivate::activeChannel field, which value
is 1 got HTTP/2 by default, but can later be changed to 6 if the remote host
doesn't support HTTP/2.

Pick-to: 6.3 6.2 5.15
Change-Id: Idcdeb22ec806520965f30a22045f99aa009a7362
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-01-12 16:41:07 +00:00
Dimitrios Apostolou
3acfd39653 qt-testrunner: disable JUnit XML test logs
It causes crashes because of interleaved execution of Quick tests.

Task-number: QTBUG-98350
Change-Id: I61e26f5da5617e06810db8eb7991f17eecdd3acb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-01-12 16:14:18 +01:00
Marc Mutz
716c916c40 QSinglePointEvent: port away from QMutableEventPoint::from()
Use the new static QMutableEventPoint setters, which do not depend on
undefined behavior.

Made it a separate commit, because, while straight-forward, it's a lot
of changes compared to other users.

Task-number: QTBUG-99615
Pick-to: 6.3
Change-Id: I580b6b225421a1e908f04c8e30adcdef6540ea52
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-01-12 15:14:18 +00:00
Marc Mutz
b17c4d0e2e QFlatMap: re-implement insert() via insert_or_assign()
Avoids code duplication.

Pick-to: 6.3 6.2
Change-Id: Ic69e46108baf97a0dc9215866d6c707136ee40b2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2022-01-12 16:14:18 +01:00
Marc Mutz
6891e10f97 QFlatMap: add insert_or_assign
This does exactly what insert() on Qt associative containers does, but
allows to express the intent of using the STL-incompatible Qt insert()
semantics, in an STL-compatible way, instead of leaving the reader of
the code wondering what semantics are expected.

This is part of a very-long-term goal of fixing Qt associative
container's insert() behavior, in which QFlatMap, being an affected,
but private-API type, is used for proof-of-concept purposes.

Task-number: QTBUG-99651
Pick-to: 6.3 6.2
Change-Id: I69010285438259918aef659d3235180c1b5be696
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2022-01-12 16:14:18 +01:00
Axel Spoerl
9f32fc97aa Remove unused testdata directory from QPushButton unit test
Pick-to: 6.3
Change-Id: I3682dad0e5024f171ac4137b32ae30bc0693aa8f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-12 14:27:59 +00:00
Mårten Nordheim
8c5e31536a QCache: fix potential crash in trim()
We use raw pointers to the Nodes in the QHash which is
inherently fine, but we are then subject to invalidation when
nodes are moved around during deletion.

In trim() we don't actually need to iterate the linked-list
since the node we are interested in is always chain.prev

Pick-to: 6.3 6.2 6.2.3
Fixes: QTBUG-99710
Task-number: QTBUG-99224
Task-number: QTBUG-99240
Change-Id: I9c2ed69b29e3cadca013113a3553deb44d7382fc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-01-12 14:27:59 +00:00
Axel Spoerl
5cc5ba8aac Remove unused legacy testdata directory from QWidget kernel unit test
Pick-to: 6.3
Change-Id: Id857c12321b72a7f35e9e7a157dc39f7fb95ecde
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-12 14:27:59 +00:00
Yuhang Zhao
831b3506fc QOperatingSystemVersion: Make implementation consistent on all platforms
Only Windows is using lambda function, change to static member
function to be consistent with other platforms.

QOperatingSystemVersionBase::current()'s implementation is exactly
the same on all platforms, so move it to the common source file
instead of implementing it three times on each platform.

Change-Id: I4099235b3b041a9a374e21d537649047ee03e62b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-01-12 21:00:45 +08:00
Volker Hilsheimer
4a4240f1bd Don't access QObject::objectName during QThread start
This is a data race, as the thread accesses QObject::objectName on the
QThread instance while the thread owning the QThread might modify the
objectName.

Instead, make a copy in the QThreadPrivate that can be accessed safely.

Task-number: QTBUG-96718
Pick-to: 6.3 6.2 5.15
Change-Id: I10701551d498993ca5055daf161636bfb648840c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-01-12 12:44:38 +01:00