Commit Graph

47089 Commits

Author SHA1 Message Date
Mårten Nordheim
07b008425a Privately introducing QDecompressHelper for network purposes
To support streaming decompression in QNAM.
Will also be used to refactor existing decompression code in QNAM.

Task-number: QTBUG-83269
Change-Id: Iecf3e359734163f15686c949f75d41fa4794a00e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-05 09:17:11 +02:00
Samuli Piippo
c8db3115a2 Define unix platform interfaces also without opengl
Fix build without opengl.

Change-Id: I691fd4112d69b16690915fcf33f5ae30ca2d7a93
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-05 09:34:58 +03:00
Samuli Piippo
54182e47c3 QNX: adapt to new event APIs
Use the new event APIs and split the single mouse event into
three separate events (move, press, release). QNX events only
give us current state, deduce the pressed and released buttons
by comparing to the previous state.

Change-Id: I9e647922679ddb792b10cb5e6ceee7ede4878444
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2020-08-05 09:34:50 +03:00
Michal Klocek
4886514fc3 Fix compiler issues when qreal is float
Change-Id: Ide3b5a3b0f2d93708409edac8aa999eb25c3ab54
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-05 07:24:14 +02:00
Oliver Wolff
f4093d02ff Fix "rectange" typos in qtbase
Pick-to: 5.15
Change-Id: If064fae5eaaeb2e53e3dd05cb9dc1cdf49ad1f04
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
2020-08-05 05:13:30 +00:00
Thiago Macieira
ed991b7d15 Add an AES-based qHash function, inspired on Go's
Change-Id: I09100678ff4443e6be06fffd1481e94089c47799
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-04 20:56:59 -07:00
Thiago Macieira
f2abfb39d7 QDebug: add operator<<(const char16_t *)
Avoids the conversion from UTF-8 for uses that are not dumping a string.

Mass conversion of Qt sources left for future opportunity.

Fixes: QTBUG-85811
Change-Id: I4ca4a35b687b46c39030fffd1626ae6c3294cacf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-04 15:13:09 -07:00
Giuseppe D'Angelo
31c232d3b7 QList: properly declare operator== for MSVC
The operators were declared as friend function templates (so, free
functions in the Qt namespace). Unfortunately, the template argument
of the operators was also defaulted -- causing MSVC trying to
instantiate those functions at all times, causing interesting
recursive template instantiation errors (C2968). It's extremely
likely that we're facing a MSVC bug, but work around it by not
defaulting the template argument. This in turn requires to move
the function definition outside QList's definition, otherwise
an extern template definition (like the ones we have for QList<QPoint>)
would cause a template redefinition error...

Change-Id: If03477ac1fa0a72aa252bb9e08e2a19c2b517b1b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-04 20:04:54 +02:00
Sona Kurazyan
8003ae79bf Document the changed semantics when passing arrays to QByteArray methods
After adding QByteArrayView overloads of QByteArray methods that used
to take char*, the way of determining the length of passed fixed-sized
array data has changed, due to the QByteArraiyView's optimization to deduce
the length at compile time for arrays. Document the behavior and add a
changelog item.

[ChangeLog][QtCore][QByteArray] When passing fixed size C arrays to
QByteArray methods, the length of the data on which the method will operate
is determined by array size, and not by scanning for the first '\0'
terminator, as it was in Qt 5.

Task-number: QTBUG-85815
Change-Id: I11cba17d428791e06c9bd4c7a727b7bd6b6aec3c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-04 19:52:22 +02:00
Sona Kurazyan
883f2dd81f Avoid possible ambiguities with QByteArrayView's comparison operators
QByteArrayView's comparison operators are declared in the global
namespace, which can collide with the ones declared for other types that
are implicitly convertible to QByteArrayView (see the example attached to
the bugreport). Changing them to be hidden friends will make them visible
only when at least one of the operands is a QByteArrayView, so the
ambiguity will be avoided.

Fixes: QTBUG-85880
Change-Id: Ic3582269d9bda9a2105336ef0f044ea619af37ba
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-08-04 19:52:08 +02:00
Timur Pocheptsov
8a91947423 QSslSocket: remove a redundant forward declaration
Change-Id: I9a3b6ccc022a036fa82d429ad008adeabe46f4ce
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-08-04 19:52:01 +02:00
Timur Pocheptsov
2d2ef81117 QtNetwork: use Q_DISABLE_COPY_MOVE
We have several classes inheriting QObject (directly or not) and disabling
copy (thus non-movable implicitly). Let's make them non-movable explicitly
now.

Change-Id: I509a066e9977480b30842afef26319b8afec6001
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-08-04 19:51:56 +02:00
Alexandru Croitor
0125e48ce0 CMake: Don't generate prl libs for Windows shared libs
Windows shared library prl files should not have a
QMAKE_PRL_LIBS section. Such information is not useful because it's
not used by the linker as per 523c7e3fd5

Amends 46d7abc9172f82756ccd3641a314dcc066353c3f

Task-number: QTBUG-85240
Task-number: QTBUG-85801
Change-Id: Ic40491a568f72c507a16322f6f0c61f98d3a5913
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-04 19:40:51 +02:00
Edward Welbourne
e3e6d58cad Use %zd for size-type formatting in unicode table generator
Qt6 makes sizes qsizetype; and one of these was already sizeof()-sized.
While qsizetype might not be ssize_t, it's at least no bigger, so we
can safely use its format specifier, with a suitable cast.

Change-Id: I433f654f6b139d74b4d5358b804b44ab1f0ada15
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2020-08-04 13:28:34 +02:00
Edward Welbourne
e536fc7975 Fix deprecation warnings (s/hex/Qt::hex/gw) in unicode table generator
Removed three warnings, rather than fixing them, as Konstantin Ritt
tells me they've been redundant since Unicode 6 or so.

Change-Id: I4507e852bceb08a0252c77a8b383aceac212aad9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2020-08-04 13:28:34 +02:00
Edward Welbourne
b69092b13e Fix compilation error in unicode table generator
Don't include a QString::number() in a sum of QByteArray and C strings.

Change-Id: I7544e835fcf5625b1fe1ee2055a48600200daafd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-08-04 13:28:34 +02:00
Fabian Kosmale
652062dde3 QNotifiedProperty: avoid crash
We can end up in a situation where a (soon to be destroyed) observer is
owned by a binding which is about to be deleted. If in that situation
the binding is destroyed first, we end up with a dangling pointer
and ensuing memory corruption. Instead, we now first transfer the
ownership of the observer and only destroy the binding afterwards.

Fixes: QTBUG-85824
Change-Id: I721c0319281ada981ae7896bd2e02e9a0cc901b8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-04 11:28:33 +00:00
Lars Knoll
2b0db55939 Fix compiler warning about qsizetype/int mismatch
Change-Id: I58624d8c5de0734bd0851e6744ed34c1408dfda6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-08-04 13:28:33 +02:00
Tor Arne Vestbø
4e74bb4823 Resolve SDK and deployment target OS from load command
Pick-to: 5.15
Pick-to: 5.12
Change-Id: Icce79186645f173b7f9be8ee6da0abed25cf3da0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-04 13:28:33 +02:00
Giuseppe D'Angelo
c580a5cdd4 Fix -Wshadow warnings
Turns out headersclean doesn't run on this header...

Change-Id: Ice8691dc0b4b46b2bde38467ca398b61b569a769
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-04 07:12:32 +02:00
Michal Klocek
3d89fa97cc Remove InfoFlag from docs
It seem to be a leftover after 4e400369.

Change-Id: I1c12bfa70cb3716d5cd9d1306db23242b58f3096
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-08-04 07:12:32 +02:00
Tor Arne Vestbø
a00ad95137 Remove last remaining bits of QtPlatformHeaders
Task-number: QTBUG-84220
Change-Id: I951e04bfe9358a99951d1d61ff47b675584b7f81
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-08-04 07:12:32 +02:00
Tor Arne Vestbø
4595fb2c1e Remove QWaylandWindowFunctions
The subsurface sync/desync functions were unimplemented on the
qtwayland side, so this is all dead code. We will introduce the
platform interfaces if an actual use-case with an implementation
comes up.

Task-number: QTBUG-84220
Change-Id: I921ee7262e5f0a7171058aaf0ff2102d9e6f438e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-08-04 07:12:32 +02:00
Tor Arne Vestbø
561da776c9 Remove const volatile qualifier on return type in test
Fixes warning by Clang:

   warning: 'const volatile' type qualifiers on return type have no effect
      [-Wignored-qualifiers]
    const volatile unsigned long long * const volatile func_KVPKVull() {...}
                                        ^~~~~~~~~~~~~~~

Change-Id: Ia4aae6521c84f4a18d92ad5035af5b247d283140
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-04 05:12:31 +00:00
Shawn Rutledge
d1d4ea5ddf Add qHash implementations for QRect and QSize
We need them to implement qHash for QQuickPixmapKey.

Change-Id: Ia67de25ec0068b9e1b889bc9c6ee077e24eb71a8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-04 07:12:31 +02:00
Andrei Golubev
b3c1093751 Introduce swap functions for QPromise/QFutureInterface
Made QPromise::swap public, added free standing swap() for
QFutureInterface and QPromise. Updated QPromise special member
functions. Extended tests

Task-number: QTBUG-84977
Change-Id: I5daf6876df306d082441dbcdf5ae4dee3bfc0ead
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-08-03 16:47:31 +02:00
Topi Reinio
fddb0c895f Doc: Document QGradient::Preset enum values
Pick-to: 5.15
Fixes: QTBUG-85749
Change-Id: Ie77145e851ff64d4c88fce7211135d66e9b94a84
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-08-03 16:47:31 +02:00
Andy Shaw
7d4baabdae Android: Install the qmldir files when configuring for a single abi
This amends 0ef46b41d8 to ensure the
new configuration is styled correctly for qmake.

Task-number: QTBUG-80938
Change-Id: Iebfff3ff0570d2e92d01d4eb1178c0d6261468f9
Pick-to: 5.15
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-03 16:47:31 +02:00
Laszlo Agocs
3f2251994d Fix doc signature in QOpenGLContext
Just T makes qdoc's clang parsing fail, it needs template<typename T>.

Also, the return type is T*, not T.

Change-Id: I210676aff3122b432888c3d79d9967e249ac88e1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-03 09:41:33 +02:00
Laszlo Agocs
f0c5802a5c Add more doc fixes for Vulkan types
Add dummy typedefs just for qdoc, this way the types show up in
the generated docs.

Change-Id: I408eeb5c4c1cbbb8cd7df8ca3c9c6b7c64b0ca88
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-08-03 09:41:22 +02:00
Laszlo Agocs
61bd046b58 eglfs_kms: Do not skip the initial SetCrtc
Trying to be clever seems to cause issues on some systems, for example
AMD (RADV) on Ubuntu 20.04 gives totally garbled output by default.

Remove the undocumented ALWAYS_SET_MODE env.var. as well, it won't have
much of a purpose since we'll in effect hit the SetCrtc path always now
once on startup.

Change-Id: Ibaa463ff913eb0c1251d6d3435aa4799fe5c8a29
Fixes: QTBUG-85797
Pick-to: 5.15
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-08-03 09:41:14 +02:00
Laszlo Agocs
a0db31ee52 eglfs: Prevent printing a warning in every widget-based app
Attempting to reflect reality with the value of AA_ShareOpenGLContexts
was a valiant attempt, but it is not possible to do setAttribute without
getting a warning now once QGuiApplication is constructed. So just leave
the attribute as is, changing its value is not strictly required.

Fixes: QTBUG-85796
Pick-to: 5.15
Change-Id: I0f0f981bb4883856b216b2a9aad3b5bf2d7da01a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-08-03 09:41:10 +02:00
Mårten Nordheim
246e712548 Move-enable QByteDataBuffer::{append,prepend}
Change-Id: I2fd342465475e3a694c8459a54957149f8b418a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-01 10:51:21 +02:00
Mårten Nordheim
5d7be66fd7 QList: Add a append(QList &&) overload
We already had append(const QList &) and now there's an overload
taking an rvalue reference.

Change-Id: Id2fbc6c57badebebeee7b80d15bb333270fa4e19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-01 00:01:52 +02:00
Allan Sandfeld Jensen
0c53f8ba98 Fix undefined use of memcpy and memcmp
Don't call them on a nullptr, even with a length of 0.

Change-Id: I7fee23303562e5771697a16365cae12e3e87af6f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-31 20:08:50 +02:00
Thiago Macieira
797e18118b Remove no-longer-applicable -Wno-error for GCC
We don't appear to have implicit fallthroughs in our code anymore. The
last deprecated copies and redundant moves are also gone.

The other warning never had an explanation and doesn't show up when
building full Qt anyway.

Change-Id: Iad959315ad374ef288f5fffd15d683599a1a11b9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-07-31 09:58:05 -08:00
Thiago Macieira
e3a6ede895 Try again to fix Clang's -Wconstant-logical-operand warning
Commit daaa557259 changed the enum to
bool, but the warning is still happening.

Pick-To: 5.15
Change-Id: Ibdc95e9af7bd456a94ecfffd1603f332a356c788
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-31 10:44:52 -07:00
Thiago Macieira
95afe6b244 QSharedPointer: do allow calling deleters on null pointers
I don't know why std::shared_ptr allows this, but why not.

[ChangeLog][Important Behavior Changes] QSharedPointer objects will now
call custom deleters even when the pointer being tracked was null. This
behavior is the same as std::shared_ptr.

Fixes: QTBUG-85285
Pick-to: 5.15
Change-Id: I24006db8360041f598c5fffd161c260df0313b55
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-07-31 10:40:25 -07:00
Thiago Macieira
fe9e6b2ceb QString::vasprintf: fix 't' modifier for integers on 64-bit
‘t’
     Specifies that the argument is a ‘ptrdiff_t’.
     This modifier was introduced in ISO C99.

We use qsizetype, which is the same width as ptrdiff_t, so it makes no
difference in va_arg().

Change-Id: Iea47e0f8fc8b40378df7fffd16255730109413a5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-31 10:36:33 -07:00
Edward Welbourne
a6b3a1e459 Remove deprecated binary json feature
Deprecated in 5.15 in favor of CBOR.

Fixes: QTBUG-81239
Change-Id: I711d4bd7dd1247f58e77ac9fa53304cbe5028918
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-31 17:12:48 +02:00
Mitch Curtis
13c90a0a75 Document that keys() and values() run in linear time
keys() and values() can be slower for large containers.
I ran into this recently when profiling, and was surprised that keys()
had to build the list of keys (by appending in a loop).

Pick-to: 5.15 5.12
Change-Id: I73215f5a917790236704ad7ef78cefc4a049cd89
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-31 16:54:23 +02:00
Mitch Curtis
46ec92dad0 Fix build with MSVC2019
The error was:

src\virtualkeyboard\qvirtualkeyboardinputcontext_p.cpp(305): error C2678:
binary '!=': no operator found which takes a left-hand operand of type
'QList<QInputMethodEvent::Attribute>' (or there is no acceptable conversion)

This patch fixes the issue by manually defining an operator== for
QInputMethodEvent::Attribute.

Change-Id: Idb283cf7b6ff4388a38ea7780c3d5c1c5f77038d
Fixes: QTBUG-85789
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-31 16:54:10 +02:00
Allan Sandfeld Jensen
0792188440 Add float->qfloat16 rounding and fix the tests
Our hardware optimized conversions of float to qfloat16 rounds to even
where our table based conversion truncated to zero.

The rounding is not in this patch exactly round to even like the
hardware implementation but much closer.

Change-Id: I4c5e72c15fef9079d3660680b2727ff7ba4e768a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-31 16:50:30 +02:00
Paul Lemire
c95fc0f662 rhi: QRhiGLes2::gatherUniforms fix gathering in struct
In the case we don't have an array of structs, structPrefix needs to be
suffixed with a dot to get the proper uniform names.

Change-Id: I50ed54c2f7c3cc4556ed1854419bc4fe3a2989f7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-07-31 15:43:20 +02:00
Linus Jahn
c19bafc60c QtCore: Use system-wide libb2 if present
This adds the option to build Qt with libb2, which is especially
recommended, if you care about the performance of the BLAKE2 hashing
algorithms. The bundled version is the pure reference C implementation
of BLAKE2, while libb2 has many additional hardware optimizations.
However, the API of both is the same, so no changes to the code were
necessary here.

Change-Id: I3563982f4e07be300291fe103c38b16a404b3ebb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-31 15:05:24 +02:00
Linus Jahn
5d69aa3ee1 QCryptographicHash: Add BLAKE2b and BLAKE2s hashing algorithms
BLAKE2 does not specify requirements about specific hash sizes and
since QCryptographicHash does not support dynamic hash sizes, only the
most common hash sizes could be covered by this.

The supported hash sizes were chosen to match the ones supported by the
Linux kernel.

The new hashing algorithms for QCryptographicHash are:
 * BLAKE2b (160 bit, 256 bit, 384 bit, 512 bit)
 * BLAKE2s (128 bit, 160 bit, 224 bit, 256 bit)

[ChangeLog][QtCore][QCryptographicHash] Added BLAKE2b and BLAKE2s
hashing algorithms.

Fixes: QTBUG-78198
Change-Id: Id9e0180a974093982fdf1cdd6180988a2e5e9f4f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-31 15:05:18 +02:00
Linus Jahn
06f7a24574 3rdparty: Add reference C implementation of BLAKE2
This is required for adding support of the BLAKE2 hashing algorithms in
QCryptographicHash.

Change-Id: Icc981c3a99a2713fdd1c18766b05619254650622
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-31 15:05:08 +02:00
Thorbjørn Lund Martsum
24d60cb64d Make initStyleOption virtual for various classes
Often a simple change in the styleoptions is needed in e.g a paintEvent,
but it was impossible without copying the whole paint-function which
is not always trivial and also wouldn't be kept up-to-date if it was
changed in Qt.
The initStyleOption is similar to viewOptions in QAbstractTableView
and it is handy that this function is virtual. Furthermore
QStyledItemDelegate::initStyleOption is already virtual.

This change only makes initStyleOption virtual for public classes.

[ChangeLog][QtWidgets] InitStyleOption has been made virtual in
public Qt classes to make override of stylebehavior more simple.

Change-Id: I38974c6d4dd0793ca5976ecf3aa28892215a1579
Task-number: QTBUG-77642
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2020-07-31 14:58:54 +02:00
Alexandru Croitor
9c0f448f5a CMake: Fix generated content of prl files (again)
Apply the same kind of transformations to the contents of the prl
files as we do for pri files. Mainly, transform system library paths
that are absolute, into link flags to make them relocatable across
systems.

Also change the Qt frameworks to be linked via the -framework flags
instead of via absolute paths.

Implementation notes

Move the common required functions for both QtFinishPrlFile and
QtGenerateLibPri into a common QtGenerateLibHelpers.cmake file.

Make sure it's listed as a dependency for the custom commands.
Also make sure to pass the necessary input values like possible
library prefixes and suffixes, as well as the link flag.

Task-number: QTBUG-85240
Task-number: QTBUG-85801
Change-Id: I36f24207f92a1d2ed3ed2d81bb96e4e62d927b6e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-07-31 14:29:45 +02:00
Volker Hilsheimer
26c742c1e1 QFileSystemModel: make sure files are stat'ed in the worker thread
QFileInfoGatherer creates QFileInfo objects in the worker thread to
offload the work from the UI thread, but it never calls any methods on
the QFileInfo objects that would trigger a stat'ing of the files. For
large directories on remote file system, that easily results in the
UI thread being blocked for a very long time.

Add a private 'stat' method to QFileInfo which allows forcing it to
stat all attributes from the worker thread, and make
QFileInfoGatherer a friend so that it can call the function from the
worker thread. This way, QFileSystemModel can access the cached data
for each QFileInfo object, without having to touch the file system
from the UI thread.

Also reduce the amount of signal emissions for drive information,
batch all drives (which can safely be assumed to be at most a two
digit figure) into a single emission instead.

Change-Id: Ifdcae150406187db9984d0fec9add93597b5f85b
Fixes: QTBUG-41373
Pick-to: 5.15
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-07-31 10:59:58 +00:00