Commit Graph

48558 Commits

Author SHA1 Message Date
Andrei Golubev
7332d3937d Rename QPromise starting and finishing methods to start and finish
Proposed during API review

Change-Id: I9c43e1915c50803ab69bfe07a91c05d2224b86c4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-10-16 09:48:10 +02:00
Andrei Golubev
3ca600bd2d Make QPromise::addResult() return boolean status of operation
Changed QPromise::addResult() to return bool value. True is returned
when result is added and false is returned when e.g. promise is in final
state (canceled or finished) or when addResult() is called twice with
the same index as argument (in which case new value is rejected)

Updated QFutureInterface::reportFinished() that accepts optional result
as argument to align with other result adding methods. This function
is "internal" only (as of now), so no documentation update is needed

Change-Id: I2d63069246e5e5c8cf04529c22bb296faaaae53d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-10-16 09:48:10 +02:00
Laszlo Agocs
696d94b132 Guard vulkan.h inclusion with __has_include
...and provide our dummy typedefs when vulkan.h is not available.

Originally this was there for qdoc, but from the qtdeclarative API
review it becomes clear that we need this also when an application
- that includes Qt Quick headers which in turn want to use VkImage
and co. for type safety - is built on a system without vulkan.h
against a Vulkan-enabled Qt build.

Also fix some of the typedefs which were technically incorrect. (not
that it matters much since the dummy typedefs still do not allow
calling exported Qt functions that use the real Vk* types since the
function signatures like won't match in some cases (would need to
replicate too much hocus pocus from vulkan.h for that), but that's fine
since our goal here is to keep application compilation going when it
encounters a Vk* type in a Qt header, not about enabling actually
calling those functions)

Task-number: QTBUG-87450
Change-Id: I855b4478c8707587b28db2408e282145129a0194
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-16 09:48:09 +02:00
Allan Sandfeld Jensen
ada6e4fbe9 Fix some bad uses of QSharedPointerData::operator T*
Avoid detaching where possible

Change-Id: I438d3e66689aeef05951af86a48af2a6910da7c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-10-16 09:48:09 +02:00
Lars Knoll
b002c48cc7 Disallow promotion of bool and char in qMin and friends
Feedback on the API review. Make sure, qMin<true, 'a'> and similar
constructs don't compile.

Change-Id: I59a66348a4168fe306159ddaf2595838d4ed66d1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-16 09:48:09 +02:00
Lars Knoll
4097653215 Fix signature of QDebug::toString()
We don't need two overloads here.

Change-Id: Ia6a3bcd93491843e07b0295fefe8da42ae9d6519
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-16 09:48:09 +02:00
Laszlo Agocs
0461c535fc rhi: Further reduce copying in the command buffer
Change-Id: I2e2ff5f4b8aa91d0accb01108a5199b98c371455
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-10-16 09:48:09 +02:00
Laszlo Agocs
802d98d318 rhi: Unroll the res.binding factory functions
Trading typing in a few lines of straightforward code for a full
sizeof(QRhiShaderResourceBinding::Data) copy (with less fortunate
compilers that do not manage to optimize it away) is a bad deal.

Change-Id: If227320f8a9598508c1fe02c4f56e6d75f0a787b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-16 09:48:09 +02:00
Timur Pocheptsov
aa6b865899 QSslCertificate (generic) fill the extension's variant map
When parsing subjectAltName extension to make it more like OpenSSL
counterpart.

Fixes: QTBUG-86830
Change-Id: If1a4e72ee0b19f2cf40aa53632f9ec1468178c3b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-10-16 05:21:49 +02:00
Timur Pocheptsov
1ccd99187c Remove misleading comment
NSSegmentedControl is not of much use for us, due to different problems
it shows when rendered.

Change-Id: I57be237b33c226d0a84d18c76a4bffb92cea5274
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-16 05:21:43 +02:00
Timur Pocheptsov
10893c984b QSslSocket (autotest) - defuse a time bomb
Interesting, it only exploded now - initially we were too fast (faster than
500 ms) so never noticed. Now that more tests with the similar event loop
handling were introduced, the last one was catching a single-shot timer
signal, accessing long dead object).

Fixes: QTBUG-87612
Change-Id: I52446fa7b08ef90a4742af3662da7837a8602941
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-10-16 05:21:34 +02:00
Volker Hilsheimer
4de8eefa80 Remove default parameter from QUnifiedTimer::updateAnimationTimers
After adjustments in Qt Declarative, this parameter is no longer needed.

Change-Id: I4b398748277aa29edd06ac122cfa8984575abf97
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-10-16 04:46:07 +02:00
Volker Hilsheimer
56332031a5 Document noteworthy change in QProcess
Change-Id: I4d9769901aef8255fc111f33eb141e05398f0ee3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-16 04:44:29 +02:00
Volker Hilsheimer
862bdcd09c Fix warning: helper functions are only used on some platforms
Tag them as [[maybe_unused]] to silence compiler on platforms where they
are not used.

Change-Id: I12243c0409c66863617f073f968e50f913c58a67
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-16 04:44:22 +02:00
Volker Hilsheimer
215594d664 Purge QDesktopWidget
It's no longer used; the only calls to QApplicationPrivate::desktop
pass the default nullptr for QScreen, so all we need is a Qt::Desktop
type toplevel widget.

Include changes documentation about both the class and QApplication::desktop
being gone in Qt 6.

Change-Id: I22d6e93cabc6aaaefffe5e96942886a2ef4e0609
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-16 04:44:13 +02:00
Giuseppe D'Angelo
ef1905aebc QMultiHash: fix operator==
An empty QMultiHash can still have an allocated dpointer, so we
can't desume that two hashes are different because one has a
dpointer and the other doesn't. Compares the sizes first, and
infer that equal size, and non-zero size, mean both have a dpointer.

Fixes: QTBUG-87575
Change-Id: I2e206bd071c02fb8970a4e77f8b0d29ad7e58bbe
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-16 01:08:00 +02:00
Giuseppe D'Angelo
9f1e1eb552 QHash: code tidies
Apply std::exchange. Remove a wrong comment about MultiNode
-- the compiler isn't generating any move operations, the
move constructor is user-provided and there isn't a move
assignment operator...

Change-Id: Idd69458c69cc93e4575c119daba564e0046452c1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-16 01:07:57 +02:00
Giuseppe D'Angelo
9fa848dcaf QOverload helpers: further cleanups
constexpr inline means we can remove [[maybe_unused]].

Change-Id: I034b6e742ef750dc1ebeca1d9cc7a2463f8c7b70
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-16 01:07:55 +02:00
Giuseppe D'Angelo
1261f391cc Floating point function helpers: code tidies
Change-Id: Id87390734f4ccb28fb83d25788ca600747c2e2a8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-16 01:07:53 +02:00
Giuseppe D'Angelo
b652f5a703 QtPrivate::Deprecated_t: code tidies
Change-Id: I08ae749b32aa9a302937691c76b7910175c8a71a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-16 01:07:50 +02:00
Giuseppe D'Angelo
bc4bd3c1bc QESDP::take(): document that it doesn't deref
Change-Id: Iba6c1caf4a7681815559db7c06691d02108ae855
Pick-to: 5.15
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-10-16 01:07:48 +02:00
Giuseppe D'Angelo
56475926e6 Port QColorTransform to QESDP
Remove the hand-rolled refcount management code, and
cleanup the existing constructors.

Change-Id: I1b91dbf888feff25d67310637d42dcdc3acaac13
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-10-16 01:07:45 +02:00
Giuseppe D'Angelo
35c565e965 Port some more /*implicit*/-like comments to Q_IMPLICIT
Change-Id: Ib70ad3f29365153af647deea54fc45467c413cb9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-10-16 01:07:31 +02:00
Giuseppe D'Angelo
2ded340d55 QTimeZone: drop an implicit conversion comment
The constructor isn't selected for conversions anyhow (it has
more than one argument), and in Qt we don't mark such constructors
as implicit (or explicit) anyways.

Change-Id: I4203b946b9c6934aef9eead2db96154f9851ab9a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-16 01:07:23 +02:00
Fabian Kosmale
86d2f7f365 QVariant::compare: handle numerical values and pointers as documented
[ChangeLog][QtCore][QVariant] Comparing two QVariants containing
floating point numbers for equality no longer uses fuzzy comparisons.

Change-Id: Iaba40a66d8fa566a432547fa1a30d5ea191c7fc0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-15 21:58:03 +02:00
Alex Trotsenko
53b4556332 QLocalSocket/Win: prevent writing to broken pipe
When a peer closes the connection, the device remains opened for reading
purposes. However, we should disable writing on disconnected socket.
Otherwise, if the user issues a write() call, a new pipe writer object
will be created and the write call occurs with invalid handle value.

Pick-to: 5.15
Change-Id: Id136798c7663df1fce7ed0aa4e3c6f5c65218a11
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-10-15 22:56:35 +03:00
Friedemann Kleint
a8b687b101 Manual tablet test: Add a window showing the devices
Task-number: QTBUG-46412
Change-Id: I9cb9bb3493728186e1e6b140308c292ca9662e55
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-10-15 21:55:03 +02:00
Assam Boudjelthia
3d8447de59 Android: fix path issue with backslashes on Windows
The androiddeployqt tool wasn't handling dependencies with backslashes
properly, some dependencies like libplugins_platforms_qtforandroid was
written into libs.xml as
plugins\platforms\libplugins_platforms_qtforandroid_armeabi, the the app
won't be looking for the correct path of the lib to load.

Task-number: QTBUG-87574
Change-Id: Iad8c74d30d090adf69a17f2dafb455dff50b3d99
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-10-15 18:37:25 +03:00
Giuseppe D'Angelo
871392790e QOverload helpers: code tidies
Remove pre-C++14 code paths; and mark as `inline` the qOverload
helper objects (constexpr variables at namespace scope aren't
automatically inline).

Change-Id: Ieb2a9f06e39720d0c7215a3d1273c3a5996d0bc7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-15 02:35:55 +02:00
Karsten Heimrich
79889a91a1 Doc: Migration Guide for QString related changes
Task-number: QTBUG-87097
Change-Id: Idcdeaea5a65e91b99a08c2af03c7e76bbe5913bb
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-10-15 00:57:50 +02:00
Volker Hilsheimer
2cc8d801aa Unwrap private QPalette data member
Following 556511f9f3, there is only one
data member in addition to the shared QPalettePrivate, so we don't need
a data struct anymore.

Change-Id: I8d7f33ed042e47464eb5f60a048956f8bf70e0b9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-14 23:43:38 +02:00
Laszlo Agocs
63790184c7 rhi: Fix up vertex inputs with matrices
In order to prevent too much voodoo in backends like D3D11, the input
layout is expected to specify the slice index for vecX that are part of
an unrolled matrix.

Also deoptimize the instancing manual test to exercise a matrix too
instead of just vectors.

Change-Id: If2dcbcbc483645ce2420b2f87dda765b95da6e80
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-14 22:35:19 +02:00
Doris Verria
61dee37d66 Return false from canFetchMore for uninitialized QFileSystem models
Task-number: QTBUG-87273
Pick-to: 5.15
Change-Id: I1787e3dd26ec10cf161d8fa4e329972b6dd4aa6c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-14 21:43:49 +02:00
Doris Verria
b84852670d Fix infinite loop triggered when displaying model with QTreeView
For some models like the QFileSystemModel canFetchMore() returns true even though fetchMore() doesn't return anything if setRootPath is false. To prevent an infinite loop, add a check to make sure the model's rowCount was updated during the loop.

Fixes: QTBUG-87273
Pick-to: 5.15
Change-Id: I16275fc2765fd77badc1c5d265e8ba5cd250163a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-14 21:43:45 +02:00
Lars Knoll
fa93f1aeb0 Fix compile time type normalization code
Use a simpler constexpr to generate type name on gcc This
works around an ICE on gcc in release mode when compiling
with PCH enabled. As the type we're getting from Q_FUNC_INFO is
already in a somewhat normalized form, this requires significanlty
less processing and esp. not a recursive constexpr method which
I suspect triggers the ICE.

Fix integer type conversions to also properly normalize long long
values (to q(u)longlong. Make sure the mapping also works on
MSVC, where long long types get mapped to __int64. Also, normalize
unsigned short and unsigned char to ushort and uchar, respectively, to
follow the convention set by uint and ulong.

Add some test cases to verify the mappings.

Change-Id: I3dec5764450bf22ab6f066597803c3f46c2cd5ac
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-10-14 21:37:39 +02:00
Sona Kurazyan
0599255fcf Simplify implementations of QtConcurrent::blocking* methods
Call non-blocking methods from the blocking ones.

Change-Id: Icf63637223533254b76826340334de35bca258b2
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2020-10-14 21:24:31 +02:00
Sona Kurazyan
9ded473914 Minor cleanups based on API review
- Be more more consistent when declaring type aliases.
- Re-group include directives

Change-Id: Ic521e9f7692e538cc98871bdeccd9644c9879089
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2020-10-14 21:24:26 +02:00
Fabian Kosmale
e1926e5060 QMetaType: fix warning message
Change-Id: I93c8b0d6b490cfed944a2a6a2b64361258a50141
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-14 21:10:52 +02:00
Allan Sandfeld Jensen
0e85647ccf General cleanup of qshareddata.h
Update the code to something more modern and make the two types more
consistent.

Change-Id: I524d33fea158e2ba7079fe836164eec03c45649b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-10-14 20:58:52 +02:00
Giuseppe D'Angelo
a095a999a3 Long live Q_IMPLICIT!
C++20 will give us explicit(bool). While we can't use it just yet
in its full potential, we can introduce a macro to start marking
our implicit conversions (aka `explicit(false)`), removing the need
for /* implicit */-like comments.

Port a few usages to it.

Change-Id: I336d5e4c8d51d8329627900d1059e59062c5cafd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-14 20:58:51 +02:00
BogDan Vatra
a8dc2a5b6d Fix Qt6 renaming
Fixes sha: 1907599bfd

Change-Id: I20ece75c321835f13a605ae4d56fee1a034ca7c8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-10-14 21:57:11 +03:00
Friedemann Kleint
d55940d7f6 Brush up the basicsortfiltermodel example
- Add a clear button to the line edit
- Indicate invalid regular expressions

Change-Id: I1dbeaa0f9168224ccb9134c0c1fe281da14dcbce
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-10-14 20:35:16 +02:00
Shawn Rutledge
b0cd3bcec4 Use QScroller in the Dir View example
We have never had enough examples that show how easy it is to install
a QScroller.  In this case, one line makes a QTreeView flickable.

Pick-to: 5.15
Task-number: QTBUG-86090
Change-Id: Idb8b4709617befb261f3b78d63ddbdaf5ad18d6b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-10-14 18:29:00 +00:00
Volker Hilsheimer
eed5514eaf Mark QApplication::fontMetrics as obsolete
It returns the QFontMetrics of the desktop widget, so just for the
default screen. Any usage of it is probably wrong, esp since code should
use QFontMetricsF instead.

Change-Id: I0b4b85a74a2c9b6cc023ffda0b2b399f9fc3c1c4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-14 18:10:19 +02:00
Volker Hilsheimer
a8dd18252c Remove QApplication::desktop
It's been replaced with QScreen-based APIs.

There's some internal code left
depending on a QWidget representing a screen, so move the API into
QApplicationPrivate until that's cleaned up as well.

Change-Id: I851e0901832f2747af3bf2c16a9c4d815598bd08
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-14 18:10:16 +02:00
Volker Hilsheimer
5c097f895d Add \since 6.0 to new function
Also fix general style of the documentation.

Task-number: QTBUG-86479
Change-Id: Ia46bb3ec02d6474dd79b8ac733e0c613abc5e0d8
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-10-14 18:10:01 +02:00
Mårten Nordheim
51faa0700d Schannel: TLS1.3 support
It's not possible to connect to microsoft.com with Schannel TLS 1.3 for
some reason (also tested with Internet Explorer), but other sites work
fine. Must be something they have to iron out for later.

In my experience this needs a preview release of Windows. One of my
machines is opted into the dev channel of Windows where they enabled TLS
1.3 by default, and it works well in my tests except for the part above.
On my other machine, after enabling TLS 1.3 through the registry, I fail
to complete the handshake with any site. So around March/April next year
is when this code would activate for most people.

MinGW apparently defines NTDDI_VERSION as the one for Windows Server
2003, so it currently doesn't build the new TLS 1.3 code. In Qt (as a
project) we could consider setting this higher, but that's out of scope
for this patch!

Fixes: QTBUG-81294
Change-Id: If329959c3a30ecbfbb8c0d335cc39ccb6d012890
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-14 15:58:16 +02:00
Liang Qi
844318f54a tests: blacklist two tests on Ubuntu 20.04
tst_QApplication::sendEventsOnProcessEvents() and
tst_QItemDelegate::editorKeyPress()

There is some issue with the glib event dispatcher.

Task-number: QTBUG-87137
Pick-to: 5.15
Change-Id: I79a983192edef3c3560a4296cc9dea2dfc2ee1b0
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2020-10-14 15:58:16 +02:00
Volker Hilsheimer
1c76aa077e Get rid of all usage of QApplication:desktop
Use QScreen APIs instead.

Change-Id: Ie99af94fe4292223dbb165b3f5c1b74e8fe0498b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-10-14 06:38:43 +02:00
Giuseppe D'Angelo
772a10391e Drop qt_is_permutation
It was a workaround until we could depend on C++14's
std::is_permutation overload with 4 args. We now can, and the code
using it is gone anyhow, so drop it.

Change-Id: Ib9af71eeb767c83b1150c482441503288f1987d4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-14 00:59:10 +02:00