Commit Graph

34034 Commits

Author SHA1 Message Date
Lars Knoll
4d90725e77 Disable float-equal warnings in QGenericMatrix
Those warnings can cause compile errors if someone instantiates the
equality operator.

Pick-to: 5.15
Change-Id: I95fab87a424b2d359a8f3e22134f9d3ff6219703
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-17 22:05:15 +02:00
Robert Loehning
2242887e5c Use dedicated function for chopping QByteArray
Change-Id: I03f5e782a3d5d63540db9a5fdd1d432e71b5eec5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-17 19:29:10 +02:00
Friedemann Kleint
a1f3ab1cad QtGui: Update CMakeLists.txt after adding QInputDevice
Run pro2cmake.py again, amending
6589f2ed0c.

Change-Id: I27178f412bcf9d3731fbd06b4099ca4faec07a5c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-06-17 18:05:56 +02:00
Giuseppe D'Angelo
a97cda8b8b QMath: make the math-related functions templates
This way we can take and return more datatypes than qreal,
just piggy-backing on the std:: functions (which take any
integral and any fp datatype).

This makes these functions pure ADL enablers (like qSwap).
A type (hi, QAngle!) that wants to have math related functions
simply needs those defined in its own namespace using the
"standard" names (sin, cos, etc.); and we'll find them
using the q-prefixed function.

qCeil and qFloor signatures however still return int
to avoid too much breakage.

The FP-related functions (qIsInf, etc.) have been left
alone. Those are "special"; a lot of care is in qnumeric
because some implementations define them as macros, which
blocks any possibility of user-defined overloads found via
ADL.

[ChangeLog][QtCore][QtMath] The math-related functions
(such as qSin, qCos, qPow and so on) can now take an
arbitrary parameter rather than just qreal. They will do
a ADL-enabled call to the respective free function, using
the functions in namespace std as a fallback. Moreover,
they will now return whatever datatype is returned by the
free function (e.g. long double if the call is placed on
a long double).

Change-Id: I111084eda52556663802e65a85e082187c2a6861
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-06-17 17:56:48 +02:00
Shawn Rutledge
4e145de8a6 Make QInputDevice::devices() return a QList
There was a decision to use QList consistently in public API, now that
it's supposed to perform as well as QVector. Amends
6589f2ed0c

Task-number: QTBUG-46412
Task-number: QTBUG-72167
Change-Id: I30004792667ee0581a433409ac2e20ffc645e952
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-06-17 09:12:03 +02:00
Shawn Rutledge
6589f2ed0c Introduce QInputDevice hierarchy; replace QTouchDevice
We have seen during the Qt 5 series that QMouseEvent::source() does
not provide enough information: if it is synthesized, it could have
come from any device for which mouse events are synthesized, not only
from a touchscreen. By providing in every QInputEvent as complete
information about the actual source device as possible, we will enable
very fine-tuned behavior in the object that handles each event.

Further, we would like to support multiple keyboards, pointing devices,
and named groups of devices that are known as "seats" in Wayland.

In Qt 5, QPA plugins registered each touchscreen as it was discovered.
Now we extend this pattern to all input devices.  This new requirement
can be implemented gradually; for now, if a QTWSI input event is
received wtihout a device pointer, a default "core" device will be
created on-the-fly, and a warning emitted.

In Qt 5, QTouchEvent::TouchPoint::id() was forced to be unique even when
multiple devices were in use simultaneously. Now that each event
identifies the device it came from, this hack is no longer needed.

A stub of the new QPointerEvent is added; it will be developed further
in subsequent patches.

[ChangeLog][QtGui][QInputEvent] Every QInputEvent now carries a pointer
to an instance of QInputDevice, or the subclass QPointingDevice in case
of mouse, touch and tablet events. Each platform plugin is expected to
create the device instances, register them, and provide valid pointers
with all input events. If this is not done, warnings are emitted and
default devices are created as necessary. When the device has accurate
information, it provides the opportunity to fine-tune behavior depending
on device type and capabilities: for example if a QMouseEvent is
synthesized from a touchscreen, the recipient can see which touchscreen
it came from. Each device also has a seatName to distinguish users on
multi-user windowing systems. Touchpoint IDs are no longer unique on
their own, but the combination of ID and device is.

Fixes: QTBUG-46412
Fixes: QTBUG-72167
Task-number: QTBUG-69433
Task-number: QTBUG-52430
Change-Id: I933fb2b86182efa722037b7a33e404c5daf5292a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-06-16 22:06:56 +02:00
Shawn Rutledge
0a2e3ce85c Always show a submenu on its parent menu's screen
QWidget::screen() was added in b455a863a1
and this is another good use for it (in 5.15 and newer).

Amends c068edcecf

Pick-to: 5.15
Fixes: QTCREATORBUG-24195
Task-number: QTBUG-76162
Change-Id: Ifaafe9b45fafaae220da54bbf3bc7a568e7953f9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-06-16 20:54:14 +02:00
Joerg Bornemann
4ab5432081 CMake: Write object libs of Qt resources to .prl files
Since commit e343affd63 we're creating object libraries for Qt
resources in static libraries. Those must be reflected in the
generated .prl files for static builds of Qt.

In qt_add_resource, we now calculate the install locations of the
object files of rcc-generated C++ files and save them in the target
property QT_RCC_OBJECTS. This property is then passed to
QtFinishPrlFile to write the object file paths to the .prl file.

Change-Id: Ic383892d723d02fc91f712bc2dbcbc90babad074
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-16 17:56:35 +02:00
Joerg Bornemann
e817ac3d68 Document that Q_INIT_RESOURCE is not necessary for CMake-based projects
Since commit e343affd63 we're creating object libraries for Qt
resources in static libraries when building Qt or a Qt-based project
with CMake. The purpose of this is to remove the need for calling
Q_INIT_RESOURCE in static libraries.

Add a note to the documentation and a changelog entry.

[ChangeLog][CMake] Calling Q_INIT_RESOURCE in static libraries is not
strictly necessary anymore for CMake-based projects. There, for each
resource, an object library is created which is linked into consuming
projects. This ensures that the linker does not discard the resource's
object file, and its initializer is called automatically.

Change-Id: I70de439f964dc7257a2255683eda4d434fa451d0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-16 17:56:09 +02:00
Paul Olav Tvete
3110cbad6f Fix build with -no-opengl on Windows
Change-Id: Ib29012361a2b7f2f0b0da53a7736bb3f3384ae38
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-16 17:31:34 +02:00
Timur Pocheptsov
2d2c18effc QSslSocket: delete deprecated cipher settings API
Change-Id: I439ea567b9a4add3eb205335420810d88b580b20
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-16 17:13:50 +02:00
Sona Kurazyan
08699a8273 Use qsizetype instead of int in QByteArray's helper methods
This is needed as a preperation for introducing QByteArrayView, which
will use qsizetype instead of int for size. Since these methods will be
reused by QByteArrayView, they need to use qsizetype.

Change-Id: Ia2d94ec70742d4f9326de9548fd7534d56d3a5ac
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-16 17:10:44 +02:00
Lars Knoll
30ad4cf558 Warn about constructing QMetaTypes/QVariants with invalid type ids
Warn about using an invalid type id in all cases. So far, only some
constructors of QVariant would warn. Move the warning over to
the place where we map a typeid to a QMetaTypeInterface to catch all
cases.

Change-Id: I4cd48a2b5d6c597dbf2afbeae9b811cd0819b768
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-06-16 13:49:45 +02:00
Lars Knoll
87bc5f7a7c Make the default constructor of QMetaType constexpr
And inline the copy constructor forwarding to another one.

Change-Id: I3c4f76f7b14edd84f512ef0687416b20940e333a
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2020-06-16 13:49:39 +02:00
Andy Shaw
68387e485c Android: Add support for proxies
Pick-to: 5.15
Fixes: QTBUG-78812
Change-Id: Id1f35a5e4ca3d8841edae378df69b65ef599c1ca
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-16 11:06:42 +02:00
Jan Grulich
d979f0a8c8 Make sure we correctly construct underlying base platform theme
When the base platform theme is not set to a null pointer, then we might
assume it has been already constructed and later on try to access an
invalid address which will cause a crash.

Pick-to: 5.15
Change-Id: I6187336bca527e1feeb0902bcfb16f2fbec86d24
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-16 07:52:41 +02:00
Friedemann Kleint
b89d8c406b Windows font databases: Enable DirectWrite for cmake
- Remove the DirectWrite1,2 features. Windows 10
  should have them, only MinGW is missing directwrite3.
  The feature directwrite now implies DirectWrite2.
- Remove the custom defines.
- Port over the configure tests from configure.json
  and add missing ones for DirectWrite(2), DirectWrite3
  and Direct2D and Direct2D 1.1, fix the conditions
  and report them in the summary.

Task-number: QTBUG-83255
Fixes: QTBUG-83931
Change-Id: I1fc68997adc715bd5c6d7ec457f58c46e1f81c6a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-15 20:58:35 +02:00
Robert Loehning
9e51974d9b QFontDatabase: Guard against Null-dereference READ
Fixes: oss-fuzz-23112
Pick-to: 5.15
Change-Id: I06818d8642067cd510a513838e7851eb8b322aef
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-06-15 20:50:32 +02:00
Lars Knoll
29ad4f8c09 Port platform plugins to QStringView
Task-number: QTBUG-84319
Change-Id: If409ba1c99f30c7ab32c7cc826c7f303ccf18c1d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-15 15:36:13 +02:00
Laszlo Agocs
ed231455cc Relax tst_qvulkan::vulkanVersionRequest to make it compatible with 1.1
The Vulkan spec changed the behavior for VkApplicationInfo::apiVersion
in 1.1, conveniently breaking compatibility with all existing 1.0 logic.

We can no longer assume that the 1.0 behavior, which was failing instance
creation with VK_ERROR_INCOMPATIBLE_DRIVER for an unsupported version,
is always in place. So do not rely on this in the test, and add a
reminder in QVulkanInstance docs as well.

Fixes: QTBUG-85040
Change-Id: I8f5c7a7830877b72d106c444aebfaea191083ee0
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-06-15 15:33:46 +02:00
Laszlo Agocs
6a8eb26bba rhi: Add a feature flag for readback format support
Indicate that doing a QRhiResourceUpdateBatch::readBackTexture() for
texture formats other than RGBA/BGRA is not necessarily supported at
run time.

Change-Id: Ie9ca9546a3af9bff142b875f1ecf26bf26bcc442
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-06-15 15:33:39 +02:00
Mårten Nordheim
a0bfa4e1f8 QNAM: Remove network connectivity pre-check
The connectivity pre-check has been around for a long time, and it has
caused various issues in that time. Certain scenarios, like using
certain VPN configurations, might confuse the OS into thinking you don't
have and network connectivity at all and abort the connection.
Especially noticeable/frustrating when the connection was going to a
host inside the local network.

The negative impact of this change would at worst be that we might try
to connect and it will wait some amount of time before the OS tells us
the connection failed in situations where it would previously have been
aborted before it started. But the false-negatives are not really an OK
sacrifice in that case.

Fixes: QTBUG-84907
Change-Id: I37fc69051e39df3c1a1fecb56ef54521a4d3d0c3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-15 12:29:19 +02:00
Friedemann Kleint
6be9830d86 Move Unix font databases into QtGui
Task-number: QTBUG-83255
Change-Id: Id85a1e0f3de371951783fe97485158c4a02e1f15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-15 11:34:26 +02:00
Assam Boudjelthia
9ba88a2689 Android: fix qmlimportscanner not correctly assigned
Change-Id: I6c1212085211e060dda0a84a8660b653bcd30817
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-06-15 11:54:52 +03:00
Jan Arve Sæther
59836c9680 a11y: Implement accessibilityHelp on macOS
Note for manual testing: You can read it manually with vo+shift+h

Fixes: QTBUG-84864
Pick-to: 5.15
Change-Id: I5686e40642396db2fde685cf07b758acd29c6ee0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-06-15 08:45:15 +00:00
Lars Knoll
6bbfae9457 Port dbus from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: Ifdfad6b7ac8b61ead71382e5ae3cb22b50b2504c
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2020-06-15 10:44:10 +02:00
Lars Knoll
2393432cd0 Port androiddeployqt and uic from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: I7f30a4d73dd98ee1977645d7274816cd71307506
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-15 10:44:04 +02:00
Lars Knoll
31828b3d6b Port platformsupport to QStringView
Task-number: QTBUG-84319
Change-Id: I8032382904bc8481fe0a147ca38f3de9cfb1890f
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2020-06-15 10:43:51 +02:00
Thiago Macieira
bd793d3c46 Suppress warning of unused function on macOS
This function is only used on FreeBSD and Linux.

forkfd.c:243:12: warning: unused function 'convertForkfdWaitFlagsToWaitFlags' [-Wunused-function]

Pick-To: 5.15
Change-Id: I99ab0f318b1c43b89888fffd160bf81f01960f2f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-12 21:52:40 -07:00
Alexandru Croitor
a08bf7f00a CMake: Fix usage of gc_binaries feature
The qt_internal_apply_gc_binaries function should apply both compile
and link flags, not just link flags.

The flags should be applied publically to all consumers of Bootstrap
regardless if the gc_binaries feature is enabled.

The flags should be applied publically to Core only in case if the
feature is enabled (aka for static builds only).

Change-Id: Id42af0d9b527004d74c04eff2c9e3c2be1e76aac
Fixes: QTBUG-84461
Task-number: QTBUG-83929
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-12 22:34:12 +02:00
Mårten Nordheim
306ebe03ea Http: Fix POST-to-GET redirects still uploading or transmitting CL
CL = Content-Length

The uploadByteDevice was kept after a redirect which caused the
internals to assume that we had to upload the data. Even if this was
not the case we still transmitted the Content-Length header from the
first request which was now stored in two places.

Fixes: QTBUG-84162
Pick-to: 5.15
Change-Id: Ic86b1ef0766ffcc50beeed96c1c915b721d40209
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-12 16:11:55 +02:00
Mårten Nordheim
76228da096 QtNetwork: Remove leftover deprecation macros
These are no longer used

Change-Id: I05a6e34975ee3fc6a704c074ebadacba34edf4aa
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-12 16:08:34 +02:00
Mårten Nordheim
0abbae240e QNAM: docs cleanup from NetworkAccessible
It was removed but some documentation bits were still there, apologies

Change-Id: I1888b34fe04e6566349d35a27391d0bd14d622d4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-12 16:08:30 +02:00
Lars Knoll
413a9f9bde Port remaining usages of QStringRef in QtCore to QStringView
Task-number: QTBUG-84319
Change-Id: If77bc94c18e8d522b4577050091cd7d7aa941311
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-12 15:51:11 +02:00
Lars Knoll
d6b7476134 Port qdatetime away from QStringRef
Task-number: QTBUG-84319
Change-Id: Ieeb25933a8062bdf0d2835f4d78e86daac1e8720
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-12 15:50:36 +02:00
Lars Knoll
4d31ddf573 Port QDir, QFile from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: I7feb5c12eb5a8504c34292e0da75332b5ba9ef20
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-06-12 15:50:17 +02:00
Lars Knoll
5caf7ef3b1 Remove deprecated methods
Those aren't part of Qt 6 anymore.

Change-Id: I9ea7de07d89156e8d0fb6ae9deeb24e0de5fa429
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-12 15:50:08 +02:00
Giuseppe D'Angelo
a769ca1d91 Assume static_assert is available everywhere in C++
I'm not adding a static_assert(Q_COMPILER_STATIC_ASSERT),
as ironic as that might be; we have enough
static_asserts around already which will surely cause
errors, in case of a broken compiler.

The detection itself has to stay around for C support.

Change-Id: Id32f5c8e0ab2e461fba7b0525da5eeaaea77c68d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-12 14:30:37 +02:00
Friedemann Kleint
1053e1f4a3 Fix Windows Font database code to use configure features
Use QT_CONFIG, QT_REQUIRE_CONFIG instead of custom macros.

Task-number: QTBUG-83255
Task-number: QTBUG-83931
Change-Id: Id067448dd59f4810a6bc8042d3fbe4244d5cc88a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-12 14:25:27 +02:00
Mårten Nordheim
a114b133f5 QByteDataBuffer: Remove the ctor and dtor
Remove the ctor as it was not doing anything special and the implicitly
generated one will do what we need anyway. And calling clear before
destructing wasn't useful, so just remove the dtor in general.

Change-Id: I9ed722d4db3ea220d32082d4cb38c10a9af34d5e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-12 14:05:24 +02:00
Sona Kurazyan
838025bd73 Include qpromise.h in corelib/CMakeLists.txt
Change-Id: I2a854ae5774c0b98387782af685d903818475173
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-12 14:00:03 +02:00
Laszlo Agocs
9d0a15b7a3 rhi: gl: Support reading back 1 byte texture formats
The GL texture readback is limited due to the underspecified glReadPixels,
especially on GLES. To preserve our sanity, we just do a GL_RGBA
readback always. This only worked for 4 byte formats, but now we extend
it to handle the 1 byte (R8 and RED_OR_ALPHA8) formats.

Note that this relies on the fact that the GL implementation is able to
do a GL_RGBA readback for a GL_R8 or GL_ALPHA texture.

Change-Id: I8286dca42964f0cbc6645355e105bbd81ec685ca
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-06-12 14:00:02 +02:00
Thiago Macieira
03dfd4199d QMimeDatabase/zstd: use -T1 instead of --single-thread
Some older versions of the command-line tool don't have --single-thread
but do have -T1. They're slightly different according to the
documentation, but it's not important to us. What we want is to make
sure we consume a single CPU during build.

Fixes: QTBUG-84792
Pick-to: 5.15
Change-Id: Ied637aece2a7427b8a2dfffd16129fe88a0466ee
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-12 07:26:58 +00:00
Eskil Abrahamsen Blomfeldt
eb72d788fe Add RHI feature check for screen space derivatives
Fragment shader functions like fwidth() are useful for antialiasing
distance field text in the case of perspective projections. In order
to enable this as an alternative code path, we need to detect support.

- OpenGL: Supported with GL_OES_standard_derivatives or GLES3 and up
- Direct 3D: Supported for ps_2_x, so always supported on Direct3D 11
- Vulkan/Metal: Always supported

Task-number: QTBUG-84695
Change-Id: I5e3fa8014c808a9a2d639305c5e90ec25d44655c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-12 09:26:15 +02:00
Marc Mutz
3f6142f5a1 Rename new slice() method sliced()
The recently-added slice() method has the problem that it's a noun
as well as a verb in the imperative. Like std::vector::empty, which
is both an adjective and a verb in the imperative, this may cause
confusion as to what the function does. Using the passive voice form
of slice(), sliced(), removes the confusion. While it can be read as
an adjective, too, that doesn't change the meaning compared to the
verb form.

Change-Id: If0aa01acb6cf5dd5eafa8226e3ea7f7a0c9da4f1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-11 19:14:03 +00:00
Lars Knoll
03107d0ccd Add some support to flag alias properties
This is required if we want to be able to get rid of the property
cache.

Also reserve a flag for var properties, in case it turns out that we
need to keep the distinction between var and QVariant properties in QML.

Change-Id: I55c2191adcc2d94bd8f148216e26423defaa900f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-11 19:39:57 +02:00
Lars Knoll
d0689ec867 Get rid of the obsolete isEditable flag for properties
Change-Id: I54411bd8e223671523c9c8fad5c80bfa6b5b7097
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-06-11 19:39:56 +02:00
Fabian Kosmale
9b383f3d5c Further metaobject cleanups
Remove QMetaProperty index member. Instead, add a function to compute it
on demand from the QMetaObject.
Also remove the remains of the signature function.

Original-patch-by: Lars Knoll <lars.knoll@qt.io>
Change-Id: I5b16d444e7474216a535e3e93a118825cd0e6090
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-11 19:39:55 +02:00
Lars Knoll
f5e8f9c814 Cleanup QMetaClassInfo
Change-Id: I0b4fa4568f8479106053e0fae72fc802fca74a65
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-11 19:39:55 +02:00
Fabian Kosmale
630c7b4811 Cleanups in QMetaProperty
This changes the layout of the meta object data, so
also bump the meta object revision.

Original-patch-by: Lars Knoll <lars.knoll@qt.io>
Change-Id: I176fb16c207e8ebe59e358e69554be813406232f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-11 19:39:54 +02:00
Lars Knoll
5603be705e Qt6: remove support for property flags being functions
Property flags should be compile time booleans, not something to
be determined at runtime.

We've been using this to dynamically disable some properties in QWidget
based classes dependent on the state of a different property, but this
should better get implemented on top of our widgets.

Change-Id: I6296e8761303ecdf24d9e842142e8596304c015d
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-06-11 19:39:53 +02:00
Lars Knoll
679492ecc6 Clean up QMetaEnum code
Change-Id: I9c1fcfd72890fb3d69d2d9caed7f3cff931c3ff6
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-11 19:39:53 +02:00
Lars Knoll
ee709e3236 QMetaMethod: clean up offset handling
Centralize the offset handling in one place and avoid lots of magic
numbers in various places. Expose the number of ints per method in
QMetaObjectPrivate as a constant, so that code in other places can
access it via private API.

Change-Id: I59790287a17ea47e6160ec65d9c8d0aaee748947
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-11 19:39:52 +02:00
Friedemann Kleint
b3e0732740 Move windows font databases into QtGui
Requires adapting a few config checks since cmake currently
does not detect directwrite.

Task-number: QTBUG-83255
Task-number: QTBUG-83931
Change-Id: I521f1924f701260b41dccbcecf87b19f08df5ccc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-11 19:38:09 +02:00
Lars Knoll
39e229fe13 Remove more QStringRef overloads that aren't required
The QStringView versions will do the job just fine :)

Task-number: QTBUG-84319
Change-Id: I376b310deb27683fd98bbcc55e0f56014cacecc3
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-06-11 15:52:25 +02:00
Lars Knoll
8ea11e0cf7 Remove most overloads taking a QStringRef from the QString API
Add QStringView overloads where they were missing. This keeps things
almost 100% source compatible.

Task-number: QTBUG-84319
Change-Id: Ica8ee773b2ce655e9597097786117959e34b236e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-11 15:52:25 +02:00
Marc Mutz
bf5629af44 QString: remove remnants of old multiArg()
Change-Id: I3bc5bab491ce74daa37f320ea5d4324f9827e870
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-11 15:52:25 +02:00
Volker Hilsheimer
f9940b15f7 Fix breakage of QPushButton on macOS when a style sheet was set
Amends comment 6e1d70ae12, which
introduced SE_PushButtonBevel so that QPushButton could ignore clicks
outside of the button's bevel.

In the macOS style, make sure that the framerect we pass to
NSButton::alignmentRectForFrame is the rect we receive from QPushButton
in the style options. The frame property of the shared NSButton* object
might not be initialized.

In the style sheet style, handle SE_PushButtonBevel the same ways as
Contents and FocusRect, as it is not a separately styleable property.

Change-Id: I12eb1b046c864a02b34d276e6352e2e16d44231e
Fixes: QTBUG-84852
Fixes: QTBUG-84879
Task-number: QTBUG-81452
Pick-to: 5.15
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-06-11 15:52:25 +02:00
Assam Boudjelthia
cde86464df Android: fix behovior of right click to not interfere with other clicks
To allow treating long press as right click on Android, set
the environment variable QT_ANDROID_ENABLE_RIGHT_MOUSE_FROM_LONG_PRESS
to 1.

Pick-to: 5.15
Fixes: QTBUG-73416
Task-number: QTBUG-84179
Change-Id: Ibe1d6af6ab9965112f1418638a088717798b554c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-06-11 08:30:10 +00:00
José Dapena Paz
6d323c0b22 Add more LTTNG tracing points
* QImage and QPixmap copy and transform operations.
* OpenGL paint engine texture cache texture upload
* OpenGL paint engine draw texture

Task-number: QTBUG-83347
Pick-to: 5.15
Change-Id: I03150d6ff80cbbcd787133d75854715cb81b5571
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-06-11 09:14:32 +02:00
Elvis Lee
ab6fd84c62 Make it possible to avoid loading comments from JPEG and PNG files
Skip reading JPEG and PNG comments information from the header to save
the memory.

This can now be configured through the feature system.

Change-Id: I3744312f69aa3201d5188776cbd99fe690b75d32
Task-number: QTBUG-83123
Pick-to: 5.15
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-06-11 09:10:01 +02:00
Friedemann Kleint
dee140a79a Windows: Fix registry string read failures
On Windows 7, it has been observed that the time zone registry key
is a string of size 256 padded with 0. Use QString::fromWCharArray(),
relying on 0-termination to cope with it.

Pick-to: 5.15
Fixes: QTBUG-84455
Change-Id: I5d242e2de73c1ea09344aee8de8eea941bc52bab
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-11 07:19:00 +02:00
Lars Knoll
60f83a7675 Port QtPrintSupport to QStringView
Task-number: QTBUG-84319
Change-Id: I4a2407dcf1c2979cd109e7cb3dd7d6395c56b927
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-11 06:52:54 +02:00
Lars Knoll
5c4f470132 Port testlib from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: I780945c8923c0a03e9c0a32d039da0c793f650fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-11 06:52:13 +02:00
Lars Knoll
4895ae10c6 Port QtSql from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: Icc9b955dae1aa13b16c01e26192cb82f828903b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-11 06:52:03 +02:00
Lars Knoll
d984adac68 Port QtGui from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: I1761096fbcc9421a013cf73f831a2a2ba0c18006
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-06-11 02:51:03 +02:00
Lars Knoll
82a0f4a193 Port mimetypes away from QStringRef
Task-number: QTBUG-84319
Change-Id: I2bed1149df7f11495fd9dc3577828c0790b17dab
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-06-11 02:50:49 +02:00
Lars Knoll
ecacb3c62f Port QLocale::quoteString from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: I29726ebfda7a5f51a0a6ee29e905b0b904256c8d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-11 02:50:16 +02:00
Lorn Potter
ce8c33e710 wasm: fix network POST data corruption
Emscripten does not like when the post data gets deleted in the local
scope.

Fixes: QTBUG-84685
Pick-to: 5.15
Change-Id: I17f9d5cc3253c26b42253daa68e2fbaccc48eaf6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-06-11 09:24:45 +10:00
Friedemann Kleint
ad532ce118 Fix QToolButton menus showing on primary screens in multiscreen setups
Calculate an initial position based on the current size hint
and pass it to QMenuPrivate::exec(), which does screen checks
based on it.

Amends a78d667431.

Pick-to: 5.15
Fixes: QTBUG-84462
Task-number: QTBUG-78966
Change-Id: Icae8d2bc0fb50c4c853cfebaa2b2250fc06542e3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-10 19:59:12 +02:00
Volker Hilsheimer
fa5ae76356 Merge QToolTip::showText overloads as per ### Qt 6 comments
Change-Id: Ic156fed27bd535daf828e5d95049591833614307
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-06-10 19:59:05 +02:00
Volker Hilsheimer
ea09e2f466 Clean up special functions for QTextFrame::iterator
Member initialization syntax allows declaring now inline default
constructor as default. Remove copy/move/assignment operators, which
had already been disabled.

Change-Id: Ie407e65aa39c72f5e6436a6beaf9323663f78cfc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-06-10 19:58:57 +02:00
Shawn Rutledge
84e76c37a5 Restore default role names in QStandardItemModel::roleNames()
Amends 32b586864e, which added an override
of QStandardItemModel::roleNames().  It's good for it to have its own
QHash so that roles can be added, and because
QStandardItemModel::setItemRoleNames() remains un-deprecated; but before
that change, they were the roles that QAbstractItemModel had initialized
from QAbstractItemModelPrivate::defaultRoleNames().  In particular, we
need "display" to map to Qt::DisplayRole by default; several tests in
qtdeclarative depend on that.

Change-Id: I58b2d6aa6b6c78b1d618335ddc4ecb834af57274
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-10 19:58:48 +02:00
Friedemann Kleint
7ec12b2902 Move the UNIX event dispatchers into QtGui
Task-number: QTBUG-83255
Change-Id: I7d32eb1ec01784c9ed6bf5fc4913ffc5b3a34a49
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-10 19:58:19 +02:00
Kai Koehne
732c670590 Doc: Improve documentation for QLocale::FormatType
LongFormat and ShortFormat are not limited to day and month names.
Different locales might also use numbers for months instead of strings,
so the example is a bit misleading.

Instead of extending the enum description even more there's now
examples in the dateFormat(), timeFormat(), dateTimeFormat()
functions.

Task-number: QTBUG-83841
Pick-to: 5.15
Change-Id: Icea2cbce7e9505d706a2171e7d1f4486abdb20be
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-06-10 14:49:18 +00:00
Giuseppe D'Angelo
8e98a161e9 Long live std::pair!
Make QPair an alias for std::pair, and qMakePair just a forwarder
towards std::make_pair.

Why? Fundamentally to ditch a bunch of NIH code; gain for free
structured bindings, std::tuple and std::reference_wrapper
compatibility, and so on.

Breakages:

* Some that code manually forward declares QPair.
We don't care about it (<QContainerFwd> is the proper way).

* Some code that overloads on std::pair and QPair. Luckily
it's mostly centralized: debug, metatypes, testing macros.
Just remove the QPair overload.

* Usages of qMakePair forcing the template type parameters.
There are a handful of these in qtbase, but only one was actually
broken.

* std::pair is NOT (and will never likely be) trivially copiable.
This is agreed to be a mistake done by practically all implementations
in C++11, can can't be fixed without breaking ABI.
Some code using QPair assuming it's trivially copiable may break;
exactly one occurrence was in qtbase.

* QMetaType logic extracts the type names in two different ways,
one by looking at the source code string (e.g. extracted by moc)
and one via some ad-hoc reflection in C++. We need to make
"QPair" (as spelled in the source code) be the same as "std::pair"
(gathered via reflection, which will see through the alias)
when compared. The way it's already done e.g. for QList is
by actually replacing the moc-extracted name with the name
of the actual type used in C++; do the same here.
On libc++, std::pair is actually in an inline namespace --
i.e. std::__1::pair; the reflection will extract and store
"std::__1::pair" so we need an ad-hoc fix to QMetaType.

[ChangeLog][QtCore][QPair] QPair is now an alias to std::pair,
and does not exist as a class in Qt any more. This may break
code such as functions overloaded for both QPair and std::pair.
Usually, the overload taking a QPair can be safely discarded,
leaving only the one taking a std::pair. QPair API has not changed,
and qMakePair is still available for compatibility (although
new code is encouraged to use std::pair and std::make_pair
directly instead).

Change-Id: I7725c751bf23946cde577b1406e86a336c0a3dcf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-10 16:49:08 +02:00
Marc Mutz
ce5931aaf2 QLatin1String: add toString()
For symmetry with other views.

[ChangeLog][QtCore][QLatin1String] Added toString().

Change-Id: I4a0677e2dbd009e8da097f4cb0dbb27a6baf5469
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-10 16:48:43 +02:00
Eirik Aavitsland
56f40cdca6 Remove the openglextensions module
[ChangeLog][General] The QtOpenglExtensions module has been
discontinued. It provided only convenience functionality for certain
direct OpenGL usage. With the new RHI graphics API abstraction, that
is no longer a primary use case. Applications that still need to
access that API have a number of alternative options, including
QOpenGLExtraFunctions.

Fixes: QTBUG-84085
Change-Id: I272af61c69ebcec207b576d67d08b59623d485ec
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-10 09:35:04 +02:00
Lars Knoll
122d66f69f Port QtNetwork from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: I0f4e83c282b58ab4cc5e397b21981978f79d92cf
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-10 09:09:36 +02:00
Lars Knoll
4ab3089a2c Port QUrl away from QStringRef
Task-number: QTBUG-84319
Change-Id: I6167599ac86f17d37fbb6ea90d302641969b0f72
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-10 09:09:29 +02:00
Lars Knoll
957b999683 Port QMetaObject away from QStringRef
Task-number: QTBUG-84319
Change-Id: I905c2e1780a2ec42b1d189494bd5399e124df354
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-10 09:09:22 +02:00
Lars Knoll
7b05e5df18 Port QLibraryInfo from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: I500e43e1918b22d636f11c915967e75223be9ef2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-10 09:09:15 +02:00
Lars Knoll
6c108ee0c4 Port QtWidgets from QStringRef to QStringView
Change-Id: Ibe348e7aea838ab8c2d628bb43709c867a506637
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-10 07:08:57 +00:00
Mårten Nordheim
be61790a9e Remove accidental leftover debug printout
Change-Id: I1de2f1dfd8ba4a19049ef96d85cf15206510410d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-10 08:35:15 +02:00
Paul Wicking
f3c402a6df Doc snippets: Use nullptr instead of 0 literal
Also mark constructors explicit, where applicable.

Pick-to: 5.15
Fixes: QTBUG-84859
Change-Id: I145d366d854fd6b4373bcc23d0b880d6361d9014
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-10 07:47:37 +02:00
Giuseppe D'Angelo
c208b648f9 qGetPtrHelper: make it work with null d-pointers
operator-> comes with the precondition that the smart pointer
is not null. Having null d-pointers is a valid use case, so
enable it by using get() instead of operator->().

Change-Id: I78d77ca8c44e92a65ca98b15d0620bc3a1917ad2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-10 02:46:42 +02:00
Giuseppe D'Angelo
d7c75ee005 Q(E)SDP: add get()
[ChangeLog][QtCore][QSharedDataPointer] Added get() for
STL compatibility.
[ChangeLog][QtCore][QExplicitlySharedDataPointer] Added get() for
STL compatibility.

Change-Id: I1acb3b4f4bd70842ed53f6437be10404b67d9909
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-10 00:08:12 +02:00
Joerg Bornemann
2a767ab4bb CMake: Fix libraries in qt_lib_XXX_private.pri files for NMC
qmake_use.prf understands the _DEBUG and _RELEASE suffixes for
QMAKE_LIBS_XXX entries. The CMake configuration "Debug" is considered
for the _DEBUG entries, "Release" and "RelWithDebInfo" for _RELEASE.

The qt_lib_XXX_private.pri files are now generated in multiple steps:
1. The QT_LIBS_XXX information is generated per $<CONFIG> and written to
   .cmake files.
2. A preliminary qt_lib_XXX_private.pri file is generated, containing
   only configuration-independent data.
3. A custom command runs the QtGenerateLibPri.cmake script that combines
   the files from step 1 and 2 into the final qt_lib_XXX_private.pri
   file.

The same is done for mkspecs/qmodule.pri.

To be able to trigger custom commands from header modules, which are
interface libraries, we introduce one XXX_timestamp ALL target per
header module that creates a timestamp file. To that XXX_timestamp
target we add the pri file generation target as dependency.

Fixes: QTBUG-84348
Change-Id: I610f279e37feeb7eceb9ef20b3ddfecff8cfbf81
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-09 21:04:26 +02:00
Lars Knoll
d2833a3ce5 Ensure left/right/mid behave in a compatible way
QString and QStringRef did bounds checking for left/right/mid, whereas
QStringView was asserting on out of bounds.

Relax the behavior for QStringView and do bounds checking on pos/n
as well. This removes a source of potentially hidden errors when porting
from QStringRef (or QString) to QStringView.

Unfortunately, one difference remains, where QByteArray::left/right()
behaves differently (and somewhat more sane) than QString and
QStringRef. We're keeping the difference here, as it has been around
for many years.

Mark left/right/mid as obsolete and to be replaced with the new
first/last/slice methods.

Change-Id: I18c203799ba78c928a4610a6038089f27696c22e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-09 16:51:16 +02:00
Volker Hilsheimer
fd856532d7 Make QLayout::spacing/setSpacing virtual, remove qobject_cast hack
Change-Id: If256609a1f561b957378010d88120f5aaf94a45e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-06-09 16:31:54 +02:00
Andrei Golubev
385f0732d9 Add QPromise implementation
QPromise and QFuture created from it share the same internal state
(namely, QFutureInterface object). QPromise provides high-level
management of the shared resource, ensuring thread-safe behavior
on construction and destruction (also taking into account
QFuture::waitForFinished() semantics).

QFuture acts as a primary controller of QPromise via action
initiating methods such as suspend() or cancel(). QPromise is
equipped with methods to check the status, but the actual
handling of QFuture action "requests" is user-defined.

[ChangeLog][QtCore][QPromise] Added QPromise class to accompany
QFuture. It allows one to communicate computation results and
progress to the QFuture via a shared state.

Task-number: QTBUG-81586
Change-Id: Ibab9681d35fe63754bf394ad0e7923e2683e2457
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-06-09 17:21:38 +03:00
Albert Astals Cid
20ba86262f Add since markers for the Qt::endl, etc.
The Qt namespace was introduced in 461e89ee1a which is only since 5.14

Also remove QTextStreamFunctions:: from the documentation of the
deprecated functions since the QTextStreamFunctions namespace is a syntaxic workaround.

Pick-to: 5.15
Change-Id: I9c15bcc49984bf5f5099c2f7df6b8adb3d2c61fb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-06-09 15:26:00 +02:00
Volker Hilsheimer
d26a6e4a92 Pass QVariant by reference, address ### Qt 6 comment
Change-Id: I0a3fab84e699c73299e2c72a6739ecf4ed856177
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-06-09 14:22:51 +02:00
Fabian Kosmale
4c32443bc9 metatype: Do not try analyze T in Q*Pointer<T> if T is incomplete
Change-Id: I41737ce470f6d2b071ad5e85f8cad1da3869241c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-09 14:20:31 +02:00
Friedemann Kleint
bc84b7d046 Move the Windows Event Dispatcher into QtGui
Task-number: QTBUG-83255
Change-Id: Ida86f27d7f52b9be48fbea909979320866ff8dae
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-06-09 13:20:06 +02:00
Tor Arne Vestbø
15456efa20 macOS: Add a few more local autorelease pools to QCocoaGLContext
Prevents buildup of autoreleased NSViews (drawables) in the outer pool
of the main runloop, which may not drain as often as we wish.

Change-Id: Ifcf7317c50ec243e0d957bf4a19aab8bf34d5dd6
Fixes: QTBUG-84762
Pick-to: 5.15 5.12
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-09 13:17:49 +02:00
Volker Hilsheimer
8cccf0a76b Remove deprecated methods and address some ### Qt 6 comments in gui/text
Change-Id: If1ed58ecbb13df88bdb1d72caccfd01c14d42eac
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-06-09 09:34:18 +02:00
Giuseppe D'Angelo
85c1009dbb QPointer: add get()
[ChangeLog][QtCore][QPointer] Added get() for STL
compatibility.

Change-Id: I84bf9d58cd92e1bc74f731c3e9002031045f8f5c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-09 04:44:22 +02:00
Giuseppe D'Angelo
c55f45e875 QArrayData: stop using std::is_literal_type
The trait is deprecated in C++17 and removed in C++20. Enforce
the same meaning by using a constexpr variable instead.

Change-Id: Ief13afc3f889af09094391e626037778d879c4f5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-09 00:41:30 +02:00
Eirik Aavitsland
8edf11d510 Gif decoder: Harden handling of corrupt files
Fix potential UB for corrupt files.

Pick-to: 5.15 5.12
Change-Id: If5d1b859a03b09e3479a6a7adaaf3432958126b4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-09 00:35:38 +02:00
Volker Hilsheimer
bb4402af2b Add deprecation warnings to QGuiApplication::fontChanged/paletteChanged
And silence those warnings in code that emits those signals.

Change-Id: Ic9013648060c9b84b59c44bb5a8c77e48f82d24f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-08 23:37:07 +02:00
Volker Hilsheimer
2a864a4f85 Merge QWindow::parent overloads
Change-Id: Ibec0f41de16694c38cf24fcdd4eeba74df62a1dd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-08 23:24:32 +02:00
Volker Hilsheimer
ed51280630 Unexport private classes that are no longer used outside QtWidgets
Address ### Qt 6 comments for QFramePrivate,
QAbstractScrollAreaPrivate, and QGraphicsTransformPrivate.

Change-Id: I9407c03247c7ea41decce6f9c289c16ad8bf0c3f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-08 20:44:34 +02:00
Volker Hilsheimer
44fb925f50 Phase 2 of removing QDesktopWidget
Remove QDestopWidget public header, simplify the implementation that
maintains a Qt::Desktop type QWidget for each QScreen, and turn
QWidget's initial target screen into a QScreen pointer.

QApplication::desktop() now takes an optional QScreen pointer, and
returns a QWidget pointer, so that applications and widgets can get
access to the root widget for a specific screen without having to
resort to private APIs.

QDesktopWidgetPrivate implementations to look up a screen for an index,
widget, or point are now all inline functions that thinly wrap
QGuiApplication::screens/screenAt calls. We should consider adding those
as convenience APIs to QScreen instead.

Note that QWidget::screen is assumed to return a valid pointer; there is
code that handles the case that it returns nullptr (but also code that
trusts that it never is nullptr), so this needs to be defined, verified
with tests, and asserted. We can then simplify the code further.

Change-Id: Ifc89be65a0dce265b6729feaf54121c35137cb94
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-06-08 20:29:49 +02:00
Shawn Rutledge
a061a64642 Replace calls to deprecated QEvent accessor functions
Many of these were generated by clazy using the new qevent-accessors check.

Change-Id: Ie17af17f50fdc9f47d7859d267c14568cc350fd0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-08 19:11:51 +02:00
Shawn Rutledge
24e52c10de Prepare to harmonize pointer event accessor names
...by deprecating everything that doesn't conform to the naming scheme,
and providing replacements.  Continues what was started with QWheelEvent
in 7d29807296.  However QMouseEvent::pos()
is left un-deprecated because it's so widely used.

Also quit returning QPointF by const-ref from accessors.  It's plenty
small enough to return by value; we were never consistent about it anyway;
and it's good to avoid some problems with returning a reference to a
temporary in case the value is calculated in the accessor.

[ChangeLog][QtGui][QPointerEvent] Mouse, touch and tablet events now
have a standard set of QPointF accessors: position(), scenePosition()
and globalPosition(). Existing accessors that return integer QPoints,
and those with non-standard names, have been deprecated. You can use the
clazy qevent-accessors check to update your code accordingly.

Task-number: QTBUG-20885
Task-number: QTBUG-84775
Change-Id: I8e6f587da76d6d0bca6e965ce8ebc7e67b868011
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-08 19:11:39 +02:00
Marc Mutz
f19522a1b3 QNetworkInterface (Unix): port two local tracker (QSet/QLVA) to QDuplicateTracker
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.

Change-Id: I025504c7d22fb7a8c943e3968e4613d45c08d0b3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-08 19:01:51 +02:00
hjk
b12f82018d QResource: Use some qUtf16Printable() instead of toLocal8Bit().data()
Change-Id: Ia255052ea33e7d7fccb0627accd20315bbe5d393
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-08 18:20:42 +02:00
Eskil Abrahamsen Blomfeldt
078c3b7d68 Remove deprecated text-related enums
Fixes: QTBUG-82367
Change-Id: Iff2645759657f8e350754e90e791dbd583017671
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-08 15:04:19 +02:00
Morten Johan Sørvig
974f239338 Check for valid Navigator.permissions before use
Safari on iOS now supports the Navigator.clipboard
API, but not the Navigator.permissions API.

Looks like we have not encountered this combination
Before. Add undefined check for permissions as well.

Fixes: QTBUG-84658
Pick-to: 5.15
Change-Id: I99ab08fd34bbb29a82661e24bf400c927f3604f6
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2020-06-08 14:06:56 +02:00
Volker Hilsheimer
ac419a66fd Fix deprecation warning, use char16_t instead of quint16/ushort
Change-Id: I4021abb901260c3e27cefd81b3acd5ac198941c8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-08 14:01:41 +02:00
Martin Jansa
a85c7342ad Make the QFontCache size configurable
It can be configured using the QFONTCACHE_MIN_COST
define when configuring Qt.

Change-Id: I41fb781099c4c0f03c378f10c8db4ea06ef4e9ff
Task-number: QTBUG-83127
Reviewed-by: Risto Avila <risto.avila@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-06-08 13:23:21 +02:00
Lars Knoll
38096a3d70 Implement first/last/from and slice() for string-like classes
These methods are scheduled as a replacement for left/right/mid()
in Qt 6 with a consistent, narrow contract that does not allow
out of bounds indices, and therefore does permit faster
implementations.

Change-Id: Iabf22e8d4f3fef3c5e69a17f103e6cddebe420b1
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-08 13:17:32 +02:00
Marc Mutz
6ec41bd550 QSsl: port a local QStringList to QDuplicateTracker
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.

The code is the first user of the collected data, so make that
available by adding QDuplicateTracker::appendTo(Container&) methods.

Change-Id: Ibd8810c0070db7e6b3ead6d6a569facdab88b646
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-08 10:53:20 +00:00
Fabian Kosmale
3f5b5e4859 Use static function instead of lambda to workaround a MSVC compiler bug
The seemingly useless template parameters are needed to avoid a
(distinct) bug in MSVC 2019 < 16.6, and should be removed once we have a
newer version in the CI.

Task-number: QTBUG-82945
Fixes: QTBUG-83600
Change-Id: I5b22a2259aa16ae90eca7d4f3bd2e4fa1116a73b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-08 12:49:01 +02:00
JeongBong Seo
ea86f19319 Add the 'accessiblebridge' as a plugintype of gui module
This patch makes the 'accesiblebridge' plugin configurable.

Change-Id: I99f01fcd434be25bbbe5460bbc8cc1d76aa744b9
Task-number: QTBUG-83126
Pick-to: 5.15
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-06-08 09:34:02 +02:00
Tasuku Suzuki
69795835f3 Fix build without features.menubar
Change-Id: If7ad6f4c50936d2abf8b88859cb3a8a6189df152
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-08 10:30:44 +09:00
Marc Mutz
bd465695c3 QWindowsFontDatabase: replace a QPair with a dedicated struct
Pairs are easy to use, but they have no semantics attached: Two
QPair<QString, QString> compare equal, e.g., even though one is used
as a FontAndStyle and the other as, say, a type/subtype. It also
carries no information for the reader of the code.

So, write a minimal struct with equality and qHash() instead.

Change-Id: I9514c9b7d6c2cc6a4831f9ca83ca2ee466d91553
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-07 22:43:37 +02:00
Christian Ehrlicher
e0fc998e87 ItemModels: remove deprecated functions
Change-Id: Id3430493a62b11977f64e146f7668ca30935b959
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-07 19:02:47 +02:00
Samuel Gaist
50ccd35fbd Doc: add missing PatternSyntax documentation to QSslCertificate
This patch adds the missing documentation for the new QSslCertificate
PatternSyntax enum which replaces the one from QRegExp.

Fixes: QTBUG-84464
Pick-to: 5.15
Change-Id: Icf092f42ad4dff9207ca51dfd8b4fb8ed6443ff2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-07 16:23:41 +02:00
Christian Ehrlicher
32b586864e QAbstractItemModel: remove deprecated setRoleNames()
Remove setRoleNames() and all its now unneeded helper functions.

Change-Id: I0a83751aace35700655d4cc7c79278325994cbdd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-07 10:01:48 +02:00
Oliver Wolff
45b0f1be68 Remove winrt
Macros and the await helper function from qfunctions_winrt(_p).h are
needed in other Qt modules which use UWP APIs on desktop windows.

Task-number: QTBUG-84434
Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-06 20:25:49 +02:00
Lars Knoll
aa81b90738 Remove unused argument from method
Task-number: QTBUG-84635
Change-Id: I9a1789e0481977e9fa26a915ff3bc776d0a37e75
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-06-06 17:19:02 +02:00
Lars Knoll
3615a5813a Remove unused function pointers in QVariant::Handler
Task-number: QTBUG-84635
Change-Id: Icfbd1aae26b0453426d93e0af64d84d6403b8e3b
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-06-06 17:19:02 +02:00
Marc Mutz
ccbf6ae0bb QDir: port from QStringRef/split() to QStringView/tokenize()
Port away from random-access of the returned sequences. That's
neither necessary nor does it make the code more readable than
the alternative single-pass implementation used here.

As a drive-by, make applying NRVO more likely by re-using the
`result` variable for all returns after its declaration.

Change-Id: I2c3bbaefa6b6f08ebf0b90fb7be62e3c6243f19d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-06-06 13:43:04 +02:00
Giuseppe D'Angelo
1f80d1a5eb QVariant: use std::addressof instead of operator&
Change-Id: If7172e9e0e213d99f0c54b387dde8f9e163109d0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-06 13:30:34 +02:00
Giuseppe D'Angelo
725c37ffe0 QVariant: move and swap in the move assignment operator
And not pure swap. As per policy, QVariant must leave the rhs empty.

Change-Id: I2d5e0f584c4d4fffd05a0a5bfae27ddcb72430e9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-06 13:29:49 +02:00
Marc Mutz
ee63557112 QString/View: add tokenize() member functions
[ChangeLog][QtCore][QString, QStringView, QLatin1String] Added tokenize().

Change-Id: I5fbeab0ac1809ff2974e565129b61a6bdfb398bc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-06 02:07:28 +00:00
Tasuku Suzuki
832d3b482e Fix build without features.cborstreamwriter
Change-Id: I970d21d7ac97a602a5f374f6c89cd4bfdcd847b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-06 07:46:33 +09:00
Jean-Michaël Celerier
35608c0761 cmake: quote paths to prevent issues when no install prefix is set
Change-Id: Ifa7f1ef70c4893e10cb4ce9a54d8a0806d19be93
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-05 20:57:32 +02:00
Allan Sandfeld Jensen
999c79863c Remove QThreadPool::cancel()
Deprecated in 5.9

Change-Id: Ib6e2a5da1e7ee2664fb6fa496bdc880fab870901
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-05 20:57:32 +02:00
Volker Hilsheimer
458d49861f Fix check for malformed input when decoding translations
Any integer modulo 1 can never be anything else but 0, so the statement
could never be true. The intention is to abort in case of an odd number
of bytes, as this would indicate malformed input that can't be decoded
into a QString.

Note that QTranslator will then silently continue to search for valid
translations, and not print any error message at runtime, or otherwise
inform the user or developer that an input message file contains
malformed content.

Change-Id: I957b337ee035f3aca013e0859f8ee70553d9a97b
Coverity-Id: 11014
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-06-05 18:57:31 +00:00
Edward Welbourne
5ba44d1427 Clean up docs of qbytearray.cpp's C-string functions
Details of MSVC version became irrelevant some time ago; the code now
just tests for MSVC. In any case, the reader doesn't need to know how
the function is implemented, as long as it does what it claims to do.

We do not, in fact, use a random number source when generating the
return value for comparisons involving only one nullptr; we quite
consistently treat the nullptr as less than the other string. Make
explicit that this is true even if the other is empty.

Change-Id: Ifd9b00fdf8e814fcf933a05821201670fecfd646
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-06-05 13:58:30 +02:00
Marc Mutz
94ad8518e0 Include qstringtokenizer.h from qstring.h
It's a bit annoying that you have to include <QStringTokenizer> to use
the tokenize() methods. The separation is a historic artefact, just fix it.

Change-Id: Ied4cc0c8dd2bb6735bf29fbb26fdbf47d07db264
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-05 13:21:45 +02:00
Marc Mutz
1f3cf206f4 QFactoryLoader: port a local QStringList to QDuplicateTracker
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.

Change-Id: I0a0d1e31fd35d483e0036045847a3759b593c71c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-05 13:19:35 +02:00
Tor Arne Vestbø
1cd7cbf617 macOS: Respect window type when determining main window status
Fixes: QTBUG-84405
Pick-to: 5.15 5.12
Change-Id: I3fc6b15b07a81e7e7e417a5767c2853083c13516
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-05 11:00:16 +00:00
Alex Trotsenko
ad117c5444 QProcess/Win: Fix build in debug mode
Suppress a compile warning:

io\qprocess_win.cpp: 623:101: error: format '%d' expects argument of ...

Pick-to: 5.15
Change-Id: I9ea94ddfc21afea5d1a78e264507a36435cce063
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-06-05 13:22:49 +03:00
Edward Welbourne
8a95404905 Clean out string/character mentions from QByteArray docs
In some places QByteArray does interpret bytes as characters and a
sequence of them as a text string; everywhere else, however, it now
refers to them as bytes.

Add a section to the class doc explaining how char* pointers are
interpreted; the handling of '\0'-termination is surely familiar to
most readers, but making it explicit provides contrast for the
explanation of there being no such special treatment of '\0' bytes
when a stard address and length are given.

Also mention in the class doc that interaction with QString is done
via UTF-8 encoding and can be avoided by defining a macro. Shorten, in
light of that, the description of that encoding where it appears in
affected methods.

In the process, clean up lots of phrasings.

Change-Id: Ic97dce4a20752e277eeab35a06737322b2074692
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-05 12:13:29 +02:00
Edward Welbourne
c5f22d1c14 Fix references to section in QByteArray class doc after title change
This amends commit 9dd8e655cd to fix the
various references to section {8-bit Character Conversions}, which is
now renamed {Character Case}.

Change-Id: I1f777ab359c616a1b12f05a12b1cd7397f3ccb18
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-05 12:13:17 +02:00
Edward Welbourne
262ab9944a Prune two un-needed #include files from qbytearray.cpp
The QByteArray code doesn't use QLocale or QString.

Change-Id: I60966ecad35fdaaef9930ba2746bf732fa9f3cd7
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-05 12:12:51 +02:00
Edward Welbourne
c7420d9cb8 Create QLocale's default store if missing when setDefault() is called
A check to prevent crash-on-exit if QLocale::setDefault() was called
after the default store was torn down had the side-effect of causing
setDefault() to not record data if it was called before the first
access to the default store caused it to come into being.

Change the check to test that the default store has been destroyed
and, if not, create it if it doesn't exist yet.  This refines commit
4d6572aac0 (as modified by commit
11c5c078c7).

Fixes: QTBUG-83016
Fixes: QTBUG-83415
Pick-to: 5.15
Change-Id: Icbce9bd9c75d0258d403e2f90957561b5a18bdf3
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-05 12:12:36 +02:00
Jarek Kobus
79fd1cb2c6 Reuse the non blocking implementation for blocking one
Replace the implementation of blockingMappedReduced():
after calling non-blocking version of mappedReduced() we are getting
the future object, so we may call in sequence result(), which
will block and return the result when the all tasks are done.

The same is done with blockigMapped(), which calls blockingMappedReduced()
with a custom reduce function.

Looks like with this pattern we can reuse the non-blocking version
for implementing blocking version of mapped / filtered methods.

Task-number: QTBUG-83918
Change-Id: I7f240cfbd04834d551ff79d717b72194a26996d7
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-06-05 12:09:59 +02:00
Lars Knoll
690abaac0e Port QSettings from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: If2b5d8eb78ab5ca78d365f137d9680b1f0646c6b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-05 07:07:13 +00:00
Teemu Holappa
0c2508efb2 Add possibility to set QNX Screen pipeline value
The pipeline value is set by window property _q_platform_qnxPipeline.

Task-number: QSR-263
Change-Id: I13536936b2335a97a6eeb5a94c4e0f552308d15e
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2020-06-05 07:07:13 +00:00
Tasuku Suzuki
758ee12a99 Fix build without features.shortcut
Change-Id: I5b0d3b169c7adb3ee340df7b593f84167f1ccc0c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-05 10:23:48 +09:00
Tor Arne Vestbø
df2e029a06 macOS: Clean up headers
The headers are now C++ clean and can be used outside of Objective-C
code. All includes of Objective-C frameworks have been moved to the
implementation files.

Header guards have been added in the few places they were missing.

All includes are now done via #include, instead of sometimes using
the #import variant.

Change-Id: Ibb0a9c0bcfefbda4347737212e40e300a3184982
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-05 00:03:51 +02:00
Tasuku Suzuki
c7d80486de Fix build without features.completer
Change-Id: Icaed1963d6306e36653d01ad9d05b68cb50717e5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-05 07:02:28 +09:00
Andy Shaw
542e7da817 Update the qt_attribution.json for SQLite
This got forgotten when SQLite was upgraded to v3.32.1, so this amends
e10e989ce83027f2f620bb6948be4948f3c91e76

Change-Id: I75799b6c55bc39c4cc050b5eb18a99d9f197410c
Pick-to: 5.15 5.12.9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-04 23:20:20 +02:00
Giuseppe D'Angelo
34ae919f23 Enforce two's complement integers
C++20 will make this true for everyone, but as far as Qt goes,
this has to apply to all platforms even before that.
Just add another couple of checks to the list.

Change-Id: I0251ce431d4584380cfd3fc3e4b36f1dbdbf9df2
Pick-to: 5.15
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-04 22:34:20 +02:00
Sona Kurazyan
37cfc3c6d2 Deprecate the pause-related APIs of QFuture* classes
Deprecated the pause-related APIs of QFuture* classes and
added alternatives having "suspend" in the name instead.

With 2f15927f01 new
isSuspended()/suspended() APIs have been added to QFuture* classes for
checking if pause/suspension is still in progress or it already took
effect. To keep the naming more consistent, renamed:

 - setPaused() -> setSuspended()
 - pause() -> suspend()
 - togglePaused() -> toggleSuspended()
 - QFutureWatcher::paused() -> QFutureWatcher::suspending()

Note that QFuture*::isPaused() now corresponds to (isSuspending() ||
isSuspended()).

[ChangeLog][Deprecation Notice] Deprecated pause-related APIs of
QFuture and QFutureWatcher. Added alternatives having "suspend" in
the name instead.

Change-Id: Ibeb75017a118401d64d18b72fb95d78e28c4661c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-06-04 22:32:43 +02:00