Commit Graph

48529 Commits

Author SHA1 Message Date
Andrei Golubev
3929fd3c56 Do not use QHash's aeshash() under Clang's sanitizer
aeshash() has a heap-buffer-overflow when the passed in buffer length is
less than 16 bytes (and I expect there's a similar issue when we process
the tail when length is not divisible by 16). Despite being a real issue,
the code has guarding mechanisms to make sure that:
1) no crash happens
2) out-of-range bits are not used in the computation

Disabled the usage of aeshash() under Clang's sanitizer similarly to how
it was done for GCC (apparently it uses its own preprocessor mechanism).
Likely, this will pop up again with MSVC, but I have no clue which
defines it uses

Task-number: QTBUG-87112
Task-number: QTBUG-86051
Change-Id: I614d7b3082e91c9d16e0441649d6a153b222bd2e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-05 09:33:07 +02:00
Samuli Piippo
623e866d5c CMake: set default eglfs device integration plugin
Use QT_QPA_DEFAULT_EGLFS_INTEGRATION for setting the default eglfs
device integration plugin, which can be overwritten at runtime using
QT_QPA_EGLFS_INTEGRATION environment variable.

Change-Id: I1c3ac0c58cdbbb7bb08c2f0ea5abe4d04eb8d61a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-05 10:02:37 +03:00
Samuli Piippo
9692015d92 CMake: enable egl_viv plugins
Add needed define for egl_viv compile test and generate CMakeLists
for the egl_viv plugins.

Task-number: QTBUG-77809
Change-Id: I3b354faee36cbb85adcee895430eb5e8998108e1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-05 10:02:30 +03:00
Christian Heimlich
041868964d Group, cleanup, and consolidate QProgressDialogPrivate member variables
Members grouped and reordered for better alignment, all booleans
initialized in the constructor's member initialization list, and snake
case names changed to camel case for consistency.

Change-Id: Ib59ed770a3d4e307296722270cd991a9a53c72ce
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-05 01:46:28 +00:00
Allan Sandfeld Jensen
c82f73666d Replace Q_DECL_UNUSED with [[maybe_unused]]
Use C++17 attribute directly

Change-Id: Id853e7a5117065e4adb549f81303c1820fe198ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-03 11:58:08 +02:00
Giuseppe D'Angelo
889d40ebe2 Centralize the implementation of move assignment operators
At the moment we have two main strategies for dealing with move
assignment in Qt:

1) move-and-swap, used by "containers" (in the broad sense): containers,
but also smart pointers and similar classes that can hold user-defined
types;

2) pure swap, used by containers that hold only memory (e.g. QString,
QByteArray, ...) as well as most implicitly shared datatypes.

Given the fact that a move assignment operator's code is just
boilerplate (whether it's move-and-swap or pure swap), provide two
_strictly internal_ macros to help write them, and apply the macros
across corelib and gui, porting away from the hand-rolled
implementations.

The rule of thumb when porting to the new macros is:

* Try to stick to the existing code behavior, unless broken

* if changing, then follow this checklist:

  * if the class does not have a move constructor => pure swap
    (but consider ADDING a move constructor, if possible!)

  * if the class does have a move constructor, try to follow the
     criteria above, namely:

    * if the class holds only memory, pure swap;

    * if the class may hold anything else but memory (file handles,
      etc.), then move and swap.

Noteworthy details:

* some operators planned to be removed in Qt 6 were not ported;

* as drive-by, some move constructors were simplified to be using
qExchange(); others were outright broken and got fixed;

* some contained some more interesting code and were not touched.

Change-Id: Idaab3489247dcbabb6df3fa1e5286b69e1d372e9
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-10-03 11:47:17 +02:00
Giuseppe D'Angelo
990e2e4fb8 QAppleLogActivity: add a swap() method
Change-Id: Id698d71fbadf5bd0301a346b3216847d0b2f0b54
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-03 11:47:15 +02:00
Giuseppe D'Angelo
c441e2cc47 QMacKeyValueObserver: code tidies
Fix the constructors and the signature of swap().

Change-Id: Ib294bb2c054510170b166b5c8bd3180d22177efc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-03 11:47:14 +02:00
Edward Welbourne
257d5888e8 QFlags: remove deprecated constructor
Fix remaining places that still exercised it.

Task-number: QTBUG-85700
Change-Id: I84562f53439197141343831c0b9f88983689e6bf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-10-03 10:54:44 +02:00
Assam Boudjelthia
1907599bfd Android: rename Android's package name for Qt 6
Rename Android package name org.qtproject.qt5.android to
org.qtproject.qt.android to avoid inconsistency with Qt 6 name.
Also, we include the major version number in the jar target.

Task-number: QTBUG-86969
Change-Id: Ibb68947289be1079911b34ea157bf089cc52c47f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-03 11:22:35 +03:00
Edward Welbourne
4e675cb85e Handle trailing cruft consistently in Qt::DateFormat parsing
Previously the ISO time format would tolerate trailing cruft at the
end in various cases even though there might be an offset specifier
after the time, which should *not* be separated from it by anything
(not even the spaces we originally planned to still tolerate).

The RFC date format is forgiving about space, as is suitable for
parsing of RFC-822 headers, but the other formats should match the
handling in QDateTimeParser, which rejects any dangling cruft.

At the same time, since this required a re-write of
fromIsoTimeString() in any case, add support for the ISO format that
gives the hour a fractional part and skips minutes and
seconds. Previously we only had support for fractional minutes (with
no seconds). The hour without even a fractional part is also valid.

Reworked the documentation of Qt::DateFormat as it was wrong in
places, inconsistent in its formatting and incomplete. Adjusted some
tests to match the new behavior. A fraction separator with no
following digits should have been recognized as an error previously
and now is.

[ChangeLog][QtCore][QDateTime] The ISODate and ISODateWithMs formats
now reject trailing cruft (including spaces) at the end of a time
string. They also gain support for parsing hour-only formats,
including the hour-with-fractional-part format.

Task-number: QTBUG-86133
Change-Id: I38ad1479ae033407f7df97ffbeb7c4bcd463d04a
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-03 07:09:57 +02:00
Allan Sandfeld Jensen
c3cd760303 Remove compiler test
Outdated test for old buggy compilers

Change-Id: I605a2318a21121bde9a80c046a7beb6edcd2d546
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-02 22:13:18 +00:00
Allan Sandfeld Jensen
93dad2bf91 Switch Q_DECL_DEPRECATED to use C++14 [[deprecated]]
As a C++ attribute it must be on the beginning of the line or after
the function name however. And for friend declarations can only
be on the definition.

Change-Id: I456884428f36e1f1c621089c7b1addee13ada0fe
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-03 00:12:05 +02:00
Friedemann Kleint
b73d5a0511 Remove typedef Q_PID
It is not used in public API any more since
0f8848b7e2.

Replace by an internal Windows-specific Q_PROCESS_INFORMATION typedef.

Change-Id: Ia6dcc83ca667c40ac5d678c00d143c09d650e42a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-02 23:59:03 +02:00
Friedemann Kleint
013b6cf0f1 QProcessPrivate: Use member initialization
Change-Id: I9fb8120a68daaa41c153010a52f7a3e99087153b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-02 23:58:58 +02:00
Giuseppe D'Angelo
f478905068 QAIM docs: use \nullptr instead of 0
Pick-to: 5.15
Change-Id: I30b541f28ba8271eb4234c7f642485a1614808bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-02 23:30:08 +02:00
Edward Welbourne
b1cf188e83 Rework a test, eliminating some needless conversion via strings
The name toSecsSinceEpoch() gave no hint to the fact that the test
was, in fact, *also* testing round-tripping of the ISODateFormat.
Since there are other tests for string conversion, make this a simple
test of toSecsSinceEpoch().

It did the round-tripping via two methods with overly-terse names that
might just as well be local lambdas - now redundant, so removed.

Change-Id: I1e4fb1cc90224312c995596a8f3fe2bc5d9dfa15
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-10-02 23:23:58 +02:00
Steffen Kieß
63bbbdc4b8 Ignore mouse events where globalPos contains NaN
A NaN value in globalPos can cause an endless recursion in
QGuiApplicationPrivate::processMouseEvent() when e->enhancedMouseEvent()
is true and this is not a move event.

When an event contains a NaN in globalPos, print a warning and ignore
the event.

Pick-to: 5.15
Fixes: QTBUG-86207
Change-Id: I8789e465921789569715e52c98193f91945ea982
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-10-02 23:12:07 +02:00
Shawn Rutledge
f51e6552e3 End touch->mouse synthesis when the chosen touchpoint is released
During delivery of a TouchBegin event, if no widget accepts it,
we begin treating the first touchpoint as a synth-mouse, as before.
If a second touchpoint is pressed or released in any order, it's
irrelevant: the fake mouse button is released as soon as the first
touchpoint is released.  This fixes the bug that such a scenario
caused the mouse release not to be sent, so that a widget could get
"stuck" in pressed state.

Done-with: Tang Haixiang <tanghaixiang@uniontech.com>
Fixes: QTBUG-86253
Pick-to: 5.15
Change-Id: I7fbbe120539d8ded8ef5e7cf712a27bd69391e02
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-02 14:17:44 +02:00
Alessandro Portale
c3b0828e3b Android: Make checking a dependency path accept both separator styles
The path of dependencies (.so, .jar, etc.) might use either native or
non-native dir separators. Let's support both cases.

Amends: 4e94465096

Task-number: QTBUG-87066
Change-Id: I8ce3235db5bab8c4c139f841d3a2fe74d3c7c7f2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-10-02 11:55:20 +00:00
Lars Schmertmann
8d057fea98 Add test case for QSslSocket to show the wrong behavior
Task-number: QTBUG-81661
Change-Id: I4ed2ad3a22bd5439751328d915e9984eb89397d1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-02 13:22:38 +02:00
Volker Hilsheimer
e74af68654 QTreeView: fetch as many nested entries as fit into the view
QAbstractItemModel::canFetchMore and fetchMore implementations might only
add a few rows to the model each time they are called. The item views don't
generally expect that, and don't call fetchMore repeatedly, even if there
would be room in the itemview for more data. This problem cannot be
generally solved for all item views, as it would require in repeated expensive
laying out of items.

For nested indexes in a treeview however, we can try to fetch enough child
rows to populate the screen when the item is laid out by repeatedly
calling canFetchMore and fetchMore. To calculate how many items have space,
apply the same heuristics as in the scrollContentsBy implementation to
guess the number of items that can fit into the viewport.

Created test case for the fix.

Done-with: Doris Verria <doris.verria@qt.io>
Fixes: QTBUG-85366
Pick-to: 5.15
Change-Id: I54f95552993873dd4cba80b0f70f4db9d98ddc1d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-10-02 13:16:12 +02:00
Laszlo Agocs
9b35a16c64 rhi: Add a note to generateMips docs
Change-Id: Ib07eef8944367948338075832452fdae6df6078a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-02 13:14:38 +02:00
Laszlo Agocs
0b7aef08dc rhi: vk: Alter command buffer strategy
Reports on the Web have it that there's nothing guaranteeing a
driver does any actual freeing of resources then doing
vkFreeCommandBuffer for a command buffer from a command pool that
does not have VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, thus
leading to continuously growing resource usage with our current
allocate/free pattern. It could be that this is the source of out
of memory problems we are seeing on some Android devices.

Instead of just going straight for said command pool flag and doing
ResetCommandBuffer for the command buffers individually, take one
step further and use per-slot (slot being 0 or 1 if QVK_FRAMES_IN_FLIGHT
is 2) command pools. The current pool is reset in each
beginFrame/beginOffscreenFrame, moving all allocated command buffers
to the initial state (while other command buffers with the other pool
are not affected).

This may be (while impossible to tell from just guessing based on the
spec) our best approach to command buffer allocation since a Vulkan
implementation can likely just use some simple per pool allocator,
knowing that we never want to free or reset individual command buffers,
but we rather only reset the whole pool at once.

The option of importing an existing VkCommandPool when creating the
QRhi instance is now gone, but there was probably no point in offering
that in the first place.

When it comes to VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT it will
not be set unless releaseCachedResources() (in Qt Quick this is hooked
into QQuickWindow::releaseResources()) was called. What this does in
practice is unknown, but have an option to set it now and then if the
application really wants.

While we are at it, rename secondaryCbs to activeSecondaryCbStack to
indicate what it really is. (it's a stack as each call to
beginExternal() pushes a new one, while each endExternal() pops)

Change-Id: I2e5c1fad26d794e1f56c778e38f750998d706d84
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-02 13:14:31 +02:00
Laszlo Agocs
b1101fce30 rhi: gl: Best uniform is no uniform
Artificial tests with tens of thousands of meshes drawn with
the same program (graphics pipeline) and almost the same
uniform values (the difference being in the normal and model
and view matrices) do benefit - strongly depending on the GL
implementation probably - from doing fewer glUniformNf[v] calls.

Building on the fact that uniform location values will typically
be an int value starting at 0 (not guaranteed of course, we just
skip the smartness in that case), we can dedicate a small 16K
block to keep track of float/vec3/vec3/vec4 values in the graphics
and compute pipeline objects.

Change-Id: I217c31ccdeb511b3e8b8286078d7fbde399c8e3b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-02 13:14:27 +02:00
Laszlo Agocs
387a61adfb rhi: gl: Stop flooding with glVertexAttribPointers
Artificial tests like the BechmarkDemo are full of drawing the
exact same mesh multiple times in a row. These do not need
respecifying anything related to vertex or index data.

Also move the buffer binding out from the loop.

Change-Id: I0f27a39fecebc7ca8e1fa635c63819f116867e19
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-02 13:14:23 +02:00
Laszlo Agocs
cbd8dfb8f4 rhi: gl: Skip rebinding the same index buffer in the same pass
Already doing the same for GL_ARRAY_BUFFER, follow suit with
GL_ELEMENT_ARRAY_BUFFER.

Change-Id: I0cf44480abb3a60a44b316af2c09b2235f9f65e7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-02 13:14:18 +02:00
Laszlo Agocs
d92b0e18c1 rhi: Make per-frame flags per-pass where appropriate
ExternalContentsInPass becomes a per-pass flag now. Why is this
beneficial? Because while Qt Quick has no choice for its render
pass, not being able to guess if the application wants to do some
native rendering in there, Quick 3D's render passes, all the ones
that are under Quick3D's control, do not have native rendering
from the application in them, and so using secondary command
buffers with Vulkan is not necessary.

Introduce something similar for compute and OpenGL. By knowing that
none of the resources used in a pass are used with a compute pass
(e.g. because we know that there are no compute passes at all) a small
amount of time can be saved by skipping tracking buffers and textures
because the only purpose of said tracking is to generate barriers that
are relevant only to compute.

Change-Id: I0eceb4774d87803c73a39db527f5707a9f4d75c1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-02 13:14:08 +02:00
Laszlo Agocs
3080194ae4 rhi: gl: Attempt to reduce superfluous texture unit bindings
Change-Id: Iccfbe5fe8688245a5ff3f7d46a173638b362a3c8
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-02 13:14:04 +02:00
Edward Welbourne
c08592816a Modernize implementation in date-time and its parsing
Convert several internal functions to use QStringView.
Use QStringView's toInt(), now that it has one.
Replace QLatinChar('*') with u'*' for each * found.

Fix wrong-way-round separator bounds in one call to appendSeparator().

Change-Id: If5f11d9a82820133f390ae6270b16af72065cb54
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-02 13:11:06 +02:00
Assam Boudjelthia
c0122d9202 Android: unify deployment-settings.json path to unix format
Always use unix path formats for qmake and cmake builds.

Task-number: QTBUG-87066
Change-Id: I9d54c2ca687d28e38542850e3e18b6184513a9af
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-02 11:13:19 +03:00
Nicolas Fella
2d8d8ab8c2 Reference proper SplitBehaviour enum in docs
QString::SkipEmptyParts is Qt::SkipEmptyParts now.

Pick-to: 5.15
Change-Id: Ie351bbe9d2350e771f821a9f0bc9f581be5b0022
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-10-02 08:05:42 +02:00
Edward Welbourne
a1dbdc666f Give some QTime test-cases more informative names
Also drop superfluous trailing 0s from QTime's constructor and add
space after commas.

Change-Id: Ie3ae87fd497456d6447c55e5d2c808ef59c9768d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
2020-10-01 23:14:06 +02:00
Cristian Adam
01d00bbeb2 CMake Build: Add mimetype database compression with CMake
The mimetype database needs to be compressed as gzip / zstd, then
saved as hex byte blob in a cpp file.

Previously this was done with a combination of Perl / PowerShell
script. With CMake 3.18 we can do this only from the CMake script.
With CMake 3.19 we will have the best compression rate set for zlib/zstd.

Change-Id: I059bd90457c5a9da83b2b7c839a36e72e103b7eb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-01 22:43:59 +02:00
Toni Saario
a5b963c638 Set MSVC environment script specifically for MSVC
Current clause is too broad and new compilers do not work with it
properly. E.g. Clang.

Change-Id: I7afadfec07935e76882d27ec7ab408b0e597654b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-01 22:54:22 +03:00
Assam Boudjelthia
4e94465096 Android: account for native separators when checking a dependency path
The path of dependencies (.so, .jar, etc.) might use native dir
separators, but if checks when not accounting for that.

Task-number: QTBUG-87066
Change-Id: I0a09231f2a19f448f1ba520fd738d129d64ff5c7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-10-01 22:23:33 +03:00
Volker Hilsheimer
60eb306efe QAbstractItemView: Don't allow CopyAction for InternalMove views
Otherwise the default action will be Copy, and the (+) cursor will show when
moving items in e.g a QListView/Widget, even though the item will actually
be moved.

The documentation of InternalMove states clearly that "The view accepts
move (not copy) operations only from itself.".

Task-number: QTBUG-87057
Pick-to: 5.15
Change-Id: Idaa9e8f84623ced51b1c51a3730466dc0678d6b3
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-10-01 21:10:05 +02:00
Allan Sandfeld Jensen
ecfda98d1f Remove unnecessary ref-counting of QRunnable
It could never be higher than 1 anyway.

Change-Id: If33c7978a4397a08e9eb091926726725d8bd3ea6
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-10-01 17:23:42 +02:00
Alexandru Croitor
4940f6d04c CMake: Remove old Qt 5 CMake build system files
Remove the stale Qt 5 CMake files.

Disable the generation of CMake files by the qmake build system,
it wouldn't create usable Qt 6 files anyway.

Keep mkspecs/features/create_cmake.prf and
mkspecs/features/cmake_functions.prf for now until we can confirm that
they are safe to remove.

Task-number: QTBUG-86827
Change-Id: Idcf59f4d7d5474171a9bf72904ff19adc8bc74cd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-01 14:57:16 +02:00
Alexandru Croitor
081ec14b25 CMake: Clean up the public API a bit
Add some missing versionless functions.
Rename some functions that are not meant to be public API, and their
usages.

Task-number: QTBUG-86827
Change-Id: Ifb66c04cd7598d83fe80c01a92ab2d269ebaf396
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-01 14:57:12 +02:00
Joerg Bornemann
84485dfad3 CMake: Fix -[no-]warnings-are-errors configure argument
The CMake build uses the WARNINGS_ARE_ERRORS variable, and the feature
warnings_are_errors exists only in the qmake build.

Change-Id: I1e548b30b210b3dd1b2f23041d490a981312f4ba
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-01 14:56:23 +02:00
Joerg Bornemann
077ea0c633 configure: add -qmake argument
This option configures Qt with the qmake-based build system.
Currently, this is the default, so this option is a no-op until the
default switches to CMake.

Task-number: QTBUG-87049
Change-Id: I56f3080a4f1423788ffb743287a7b2e67a8e2cc4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-01 14:34:05 +02:00
Allan Sandfeld Jensen
e750fa8509 Do not assert on invalid ICC curv table
Reject invalid table data, do not assert it.

Pick-to: 5.15
Change-Id: I1fdda4c735bb97bb93ac8f8654ac4cc5fada5389
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-10-01 12:20:39 +02:00
Allan Sandfeld Jensen
fe36d47b37 Fix race condition in QThreadPool::clear
Since we drop the lock while deleting threads, we need to handle
the queue possibly being accessed and changed by the pool threads
while clear() is running.

Pick-to: 5.15
Fixes: QTBUG-87092
Change-Id: I7611edab90520454278502a58621e299f9cd1f6e
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-10-01 12:15:22 +02:00
Lars Knoll
4d943225eb Add a QVariant::compare() method
Add a method that allows comparing two variants. The method returns
a std::optional, as comparing two variants of different type is not
meaningful, or the types could not be comparable.

Change-Id: If4ae838d671e051dda1b474f25a2f9dcf85dc265
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-01 12:15:22 +02:00
Volker Hilsheimer
f518f01be6 Fix qdoc warnings for QMap/QMultiMap
These containers have most of their operators as non-members,
except those declared as hidden friends in the iterator classes,
which will be fixed in qdoc.

QMultiMap doesn't have an operator[] (which might be unintentional).

Deprecate QMultiMap::insert/insertMulti APIs, as the documentation
suggests that those are just compatibility overloads.

Add documentation for the rvalue-overload of QMap/QMultiMap::insert.
Note that this overload does not exist for QHash/QMultiHash. Also,
it seems from the implementation that the moved-from map is not reset
to the empty map if it did share data with another copy.

Not addressed: QMap and QMultiMap have the special 5 implicitly
generated by the compiler, so these functions are not declared
anywhere, which results in qdoc warnings. qdoc could generate the
documentation automatically, if it can know that those members exist.

Change-Id: I0608b57c8c3793fedd304a4c7b10e607a24ad5f6
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-01 12:15:22 +02:00
Allan Sandfeld Jensen
752665cd9c Revert "Reimplement non-antialiased cosmetic pen"
This reverts commit 81008ef4b9.

Reason for revert: Doesn't handle line-caps correctly.

Change-Id: I0c77dbef6671fec326ec27f492ea3214054829ab
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2020-10-01 07:06:32 +00:00
Thorbjørn Lindeijer
77ae1b6b3e QFileInfo: Allow constructing from QFileDevice
Also allow QFileDevice argument to QFileInfo::setFile.

This parameter change allows conveniently constructing a QFileInfo from
a QSaveFile, in addition to QFile.

Change-Id: I71244cb79b1cf92425eaff0e6de13524de562e0f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-01 04:56:31 +02:00
Volker Hilsheimer
0f8848b7e2 Remove deprecated QProcess::pid
Change-Id: I6bce5b374a9e22f0a3d67755dbd0f8e14458ce3b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-01 02:56:05 +00:00
Volker Hilsheimer
3fb8f9e44e Properly deprecate QProcess::pid
Address an old ### Qt 5 comment. The method has been documented as deprecated
and replaced by QProcess::processId since at least Qt 5.9, so we can first
properly flag it as such for 5.15.2, and remove it from Qt 6 in a follow-up
commit.

Change-Id: Ic4e3351740617083b16723db8eef7a341bccfbf6
Pick-to: 5.15
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-01 04:55:47 +02:00