Commit Graph

44483 Commits

Author SHA1 Message Date
Marc Mutz
bd84e8d63e QHash/QMap: don't return const from value(), key()
... it breaks move semantics.

We can change these, since they're templates and a short survey shows
that no-one in Qt was crazy enough to inherit an exported class from
QHash or QMap.

Otherwise this would be BiC on MSVC, which encodes the return type.

There's also no safety benefit here, as none of the overloads returns
by reference, so users cannot expect map.value(key).mutate() to have
an effect on the element in the container.

In this, key() and value() differ from op[], which also returns const,
but whose overload returns a reference. op[] is therefore not proposed
here.

[ChangeLog][QtCore][QHash/QMultiHash/QMap/QMultiMap] The value() and
key() member functions now return T (was: const T), enabling move
semantics on their return values.

Change-Id: I0e5f53f9834caad458e3bde27f1daacbb4bac71b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-05 13:24:32 +01:00
Sona Kurazyan
dfaca09e85 Add support for attaching continuations to QFuture
Added QFuture::then() methods to allow chaining multiple asynchronous
computations.

Continuations can use the following execution policies:

* QtFuture::Launch::Sync - the continuation will be launched in the same
thread in which the parent has been executing.

* QtFuture::Launch::Async - the continuation will be launched in a new
thread.

* QtFuture::Launch::Inherit - the continuation will inherit the launch
policy of the parent, or its thread pool (if it was using a custom one).

* Additionally then() also accepts a custom QThreadPool* instance.

Note, that if the parent future gets canceled, its continuation(s) will
be also canceled.

If the parent throws an exception, it will be propagated to the
continuation's future, unless it is caught inside the continuation
(if it has a QFuture arg).

Some example usages:

 QFuture<int> future = ...;
 future.then([](int res1){ ... }).then([](int res2){ ... })...

 QFuture<int> future = ...;
 future.then([](QFuture<int> fut1){ /* do something with fut1 */ })...

In the examples above all continuations will run in the same thread as
future.

 QFuture<int> future = ...;
 future.then(QtFuture::Launch::Async, [](int res1){ ... })
       .then([](int res2){ ... })..

In this example the continuations will run in a new thread (but on the
same one).

 QThreadPool pool;
 QFuture<int> future = ...;
 future.then(&pool, [](int res1){ ... })
       .then([](int res2){ ... })..

In this example the continuations will run in the given thread pool.

[ChangeLog][QtCore] Added support for attaching continuations to QFuture.

Task-number: QTBUG-81587
Change-Id: I5b2e176694f7ae8ce00404aca725e9a170818955
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-05 13:24:32 +01:00
Joerg Bornemann
1057d568bb configurejson2cmake: Fix non-inline compile tests
If there's no test dir set, use "config.tests" as default value, and
perform the check for the existence of CMakeLists.txt in
configurejson2cmake, not the configure.cmake file.

Change-Id: I8d3be8f2b68767c7592665c374022353c2dc6c57
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-05 07:48:20 +01:00
Joerg Bornemann
343865201a configurejson2cmake: Fix compile tests without a "test" entry
Set the default value of the "test" entry to the test's name like the
qmake-based configure does.

Change-Id: Ic1027c54c6312c47dca241dd7e3dc65b3e35d36f
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-05 07:48:16 +01:00
Joerg Bornemann
b99321b78b CMake: Port the 'force_debug_info' feature
This feature is read-only and is ON if CMAKE_BUILD_TYPE is RelWithDebInfo
or if that value is in CMAKE_CONFIGURATION_TYPES.
It mainly exists for the qmake support.

Change-Id: I25cb57e832dcfcab100834a104b1a3d34f01086b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-05 07:48:11 +01:00
Joerg Bornemann
46a2366d12 CMake: Port the 'debug_and_release' feature
This feature is read-only. It's controlled by the multi-config feature
of CMake. It mainly exists for the qmake support.

Change-Id: I322459598fe92568eda4d42319ded444537e95d4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-05 07:48:06 +01:00
Joerg Bornemann
20410cdc11 CMake: Port the 'shared' feature
This feature is read-only and supposed to be set by BUILD_SHARED_LIBS.
It mainly exists for the qmake support.

Change-Id: I722b0de53211d0aab1924e45a77120c890f31f50
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-05 07:48:01 +01:00
Joerg Bornemann
becbd07f55 CMake: Port the 'debug' feature
This feature is read-only and supposed to be set by variables like
CMAKE_BUILD_TYPE. It mainly exists for the qmake support.

Change-Id: Ic7e32cbda0f3c2d92dd446b07a3bf1a8d85ec3b9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-05 07:47:56 +01:00
Lars Knoll
a0ffdf765e Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-03-04 19:10:37 +00:00
Mårten Nordheim
d57adfe5f3 QtConcurrent: filter- and map-reduce with initial value
It takes any type which is implictly covertible to the result type
and then converts it in the outer-layers. Then it passes it into the
deeper layers and initiales the result value.

One drive-by fix with a missing letter in the documentation.

[ChangeLog][QtConcurrent] QtConcurrent::mappedReduce and
QtConcurrent::filteredReduced, as well as their blocking variants,
now optionally take an initial value.

Fixes: QTBUG-73240
Change-Id: I7a80d96693cfa3374847c75c75b3167664609c1a
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-04 17:40:45 +01:00
Alexandru Croitor
d50b22e75d CMake: Remove incorrect hardcoded harfbuzz condition
The non-system harfbuzz feature doesn't actually have a condition
in the json file.

Change-Id: I4b74915f28da97d6ef8f89690e91306d243913ee
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-03-04 16:16:27 +00:00
Alexandru Croitor
aa5e43d491 CMake: Adapt to latest upstream Ninja Multi-Config changes
Most of the NMC-specific variables were renamed to be more general.

Change-Id: I8ee2874fecb9e57480ce51db9183c6cf3dd100af
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-03-04 17:16:24 +01:00
Fabian Kosmale
aa6c560a74 Revert "Remove flagBits from QMatrix4x4"
This reverts commit 5ebb03c476.

Reason for revert: Removing flagBits breaks the batchrenderer in declarative, which accesses them via QMatrix4x4_Accessor. If flagBits are still going to be removed, we need to first find a solution for the renderer.

Change-Id: Ib0a3fc7a327926f2245058c0e2ed30e8789aa75d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-03-04 15:54:38 +00:00
Friedemann Kleint
09f3272814 QTypeRevision: Fix warnings about max macro from windows.h
Similar to def272750c, put parentheses
around std::numeric_limits<Integer>::max, fixing:

qversionnumber.h(339): warning C4003: not enough arguments for function-like macro invocation 'max'

Change-Id: Id574f3a08973cf1408e015f155c8e658b04bd170
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-03-04 16:31:13 +01:00
Friedemann Kleint
649d7abcd2 Update uic's class lib map to reflect QtOpenGLWidgets
Task-number: QTBUG-74409
Change-Id: I5de957156c3120422f5c8f2e702e198f9f6cc43d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-03-04 15:31:13 +00:00
Lars Schmertmann
5ee1dac8d6 Finally remove splash.xml to fix a lint warning
Unused resources
----------------
src/android/java/res/layout/splash.xml:2:
The resource R.layout.splash appears to be unused

Fixes: QTBUG-72976
Change-Id: I8f23438503d21f3279e0577a9caac745810fffc3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-03-04 16:31:13 +01:00
Joerg Bornemann
1a30a82830 CMake: Fix stack-protector-strong test and feature
And in order to do this we must teach qt_config_compile_test a
COMPILE_OPTIONS argument.

Change-Id: I66fa45142b544e3a2fc599af1c1a4c69b442b318
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-04 16:31:13 +01:00
Lars Knoll
2a4b957789 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I99ee6f8b4bdc372437ee60d1feab931487fe55c4
2020-03-04 14:39:18 +00:00
Eskil Abrahamsen Blomfeldt
fb2f42b604 Update to Harfbuzz 2.6.4
Quite a big change since it has been several years since
the last update. This drops the Harfbuzz source on top
of the existing code in Qt, and does the following
additional changes:

1. Deletes old source files that have been removed upstream
(everything named foo-private.hh is now renamed to just
foo.hh for instance).

2. Added a header guard to config.h because it may be
double-included.

3. Implement a memory barrier needed by hb-atomic.hh.

4. Changed the signature of hb_atomic_int_impl_add()
to take a pointer to match new upstream.

5. Updated .pro file to include new files and removed
old.

6. Updated qt_attribution.json

7. No longer disable deprecated APIs since
hb_ot_tags_from_script() is now deprecated and is used
from Qt code.

8. Updated and applied the patch in patches/ for CoreText.

9. Updated tst_qtextscriptengine::thaiWithZWJ() according to
changes in Harfbuzz and disabled it for system-harfbuzz,
since this may be an older version of harfbuzz depending on
the system.

Fixes: QTBUG-79606
Change-Id: I3f057a43ff44ee416628b75ef12fb1a221f31910
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-04 08:28:04 +01:00
Eskil Abrahamsen Blomfeldt
4724dfff62 Remove references to QTextDocumentPrivate from public API
The private object of QTextDocument has been exposed through
public APIs marked internal, which we should avoid as much as
possible, since it clutters the headers.

For accessing private data without adding friends, we have
a nice pattern of adding a static get() function to the
private class itself.

Fixes: QTBUG-55059
Change-Id: I03e949a677e03487e95f24e3608a06aa0a3511ab
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-04 08:28:04 +01:00
Eskil Abrahamsen Blomfeldt
5f1afeacf6 Android: Increase minimum API level to Android-23 / Android 6
There are certain APIs we need which cannot be used without this,
and in general it simplifies some code.

[ChangeLog][Android] Minimum Android version is now Android 6.0,
API level 23.

Change-Id: I72ca3b429bf48969e16e2bc6b99d9c4af993ea77
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-03-04 08:28:04 +01:00
Tor Arne Vestbø
048f0a00fa macOS: Don't create QMacCGContext when printing
We adopt the context of the print session, so the code is not needed,
and would just produce a warning since QMacCGContext didn't know what
to do about the printer paint device.

Change-Id: I9ac079f5cb5d98022045632592d0e375710eecc3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-04 01:30:11 +01:00
Tor Arne Vestbø
5d9d3ff326 macOS: Reduce save dialog extension filters to their last component
NSSavePanel does not deal well with multi-part extensions, to the point
where it will fail to open if that's the only acceptable extension.

We follow Chromium's lead here and reduce the extension to its last
component, which enables selecting and saving files such as 'foo.tar.gz'.

To improve the user experience we always show file extensions when we
detect a multi-part extension. This makes it clearer what the final
extension will be, and avoids confusing macOS about the intention of
the user when choosing a file that without the final extension also
matches another known extension.

Fixes: QTBUG-38303
Fixes: QTBUG-44227
Change-Id: Id0cee84f758c2cd59fcf1b339caa30f7da07dd1e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-04 00:29:54 +00:00
Thiago Macieira
1edf586ed7 QMimeXMLProvider: fix another issue with -no-mimetype-database
The compiler must emit the destructor for the members of a class in an
inline constructor, in case the constructor throws. This won't work in
Qt 5.15 due to QList requiring knowing whether QMimeMagicRuleMatcher is
trivial or not. Another solution would be to use QVector.

Fixes: QTBUG-82547
Change-Id: Ia8b65350cd5d49debca9fffd15f79db872ed7c0c
Reviewed-by: David Faure <david.faure@kdab.com>
2020-03-03 11:44:27 -08:00
Ivan Čukić
14420b359b Add operator-> to the key-value iterator for QHash and QMap
This patch adds the arrow operator to the stl-like key-value
iterator (QKeyValueIterator) for QMap and QHash.

This allows using normal member access syntax it->first and it->second
instead of having to use (*it).first and (*it).second.

[ChangeLog][QtCore][Containers] Added operator-> to the key-value
iterator for QHash/QMap.

Change-Id: I9cfa6480784ebce147fcfbf37fec5ad0080e2899
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-03-03 20:25:19 +01:00
Joerg Bornemann
065ace2bca Generate separate debug info for Qt tools too
If Qt was configured with -separate-debug-info, Qt's tools should be
separated from their debug information too.

Fixes: QTBUG-56482
Change-Id: Ief0130db1787b767496d0052716183fe773460bf
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-03-03 20:08:56 +01:00
Volker Hilsheimer
b4669b9190 QMenu: hide when a QWidgetAction fires the trigged signal
QMenu hides regularly when the user interacts with it, and manages
the firing of signals based on that. It ignores if a QAction that is
added to it fires the triggered() signal programmatically.

With QWidgetActions added to the menu, the menu usually doesn't get
interacted with directly, as the widget gets the input events.
Since the action can be added to multiple menus, neither widget nor
action can interact with the menus programmatically. Instead, the
menu needs to hide when the widget action triggers.

Test included that covers the case where a QWidgetAction is added
to multiple menus that are visible. Documentation updated, and
removed a redudant paragraph as a drive-by change.

[ChangeLog][QtWidgets][QMenu] a popup menu hides when a QWidgetAction
added to it fires the triggered signal.

Change-Id: I69f378426a45c2e46cebdaa5e6f1b21c8fb03633
Fixes: QTBUG-10427
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-03-03 18:52:11 +01:00
Alex Trotsenko
23785face5 QEventDispatcherWin32: unregister event notifiers on close
When QEventDispatcherWin32::closingDown() is called,
threadData->eventDispatcher is already nullptr and the application
will no longer process the events.

Thus, just as it works for socket notifiers and timers, it makes sense
to disable all active event notifiers at this point. Otherwise, it
seems possible that an object in signalled state can provoke a data
race in the notifier's callback on 'edp' pointer, if
QWin32EventDispatcher destructor is running simultaneously.

Task-number: QTBUG-64152
Task-number: QTBUG-70214
Change-Id: I6e77f3eeca1b0ea639021e73b86798cba0200ebf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-03 19:44:01 +02:00
Assam Boudjelthia
b711ee2555 Examples: add scrollbar to allow viewing all options on Android
This fix is most relevant for Android for affine and gradients examples.
Currently, if the screen size is small the settings will show cramped
and not usable. Thus, adding a scrollbar to fix that.

Task-number: QTBUG-80717
Change-Id: Ic25460e5ce37a5c53bbcae48e11b6b787c45e999
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-03-03 19:35:46 +02:00
Assam Boudjelthia
8a6e1de87c Examples: update examples list for Android
Explicitly set the list of examples that works on Android,
as many have issues with layout or other issues.

Task-number: QTBUG-80716
Change-Id: If71efc45a48c6236f8775e21e4cab6dc0129f024
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-03-03 19:35:34 +02:00
Edward Welbourne
f03202b560 Fix missing return-type in doc of qfloat16::copySign()
Change-Id: I617081fe3335a85191be7882578644621d5ffede
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-03-03 18:35:21 +01:00
Assam Boudjelthia
e5f4e14059 Examples: enable HighDPI scaling for examples on Android
These examples show very tiny UI elements on Android devices,
thus enabling HighDPI.

Task-number: QTBUG-80717
Change-Id: I813801d5249dc1fcfc6f61a8d146f60dd19901f6
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-03-03 19:35:11 +02:00
Edward Welbourne
466d32160a Suppress warnings where QString and its tests use SplitBehavior
This is a follow-up to commit 895939c7f9
to fix deprecation warnings it added.

Change-Id: I3d86655ec2c84c1bdcac9c70436075fc78f2f781
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-03 17:34:16 +00:00
Mårten Nordheim
8f8eb99991 QNetworkReply: Deprecate 'error' signal, use 'errorOccurred' instead
[ChangeLog][Deprecation Notice] QNetworkReply::error() (the signal) is deprecated; superseded by errorOccurred()

Change-Id: I4f1ef410fd22d34ddf87e89cc5709cc60703af95
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-03 18:25:57 +01:00
Laszlo Agocs
dd0a197be4 QVulkanWindow: Remove queueCreateInfoModifier getter
This is inconsistent with the other similar functions in QVulkanWindow,
we do not provide getters for those either.

Change-Id: If764b49f4b26ff14a2fa908b8d5b37429047250c
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-03-03 18:25:57 +01:00
Laszlo Agocs
bbc52a043d rhi: Add a way to communicate back the native image layout for a QRhiTexture
Relevant when doing custom rendering combined with QRhi, and only for
APIs like Vulkan, where image layouts are a thing.

As shown by demo apps, it is not currently possible to implement a
correct application that renders or raytraces into a QRhiTexture's backing
VkImage, and then uses that QRhiTexture in a QRhi-based render pass.
This is because QRhi has no knowledge of the image layout if it changes
due to commands recorded by direct Vulkan calls, and not via QRhi
itself. So, except for certain simple cases, one will end up with
incorrect image layout transitions in the barriers. (at minimum this
will be caught by the validation layer)

To remedy this, add a simple function taking the layout as int (we already
do the opposite in nativeTexture()).

Task-number: QTBUG-82435
Change-Id: Ic9e9c1b820b018f3b236742f99fe99fa6de63d36
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-03-03 18:25:57 +01:00
Laszlo Agocs
eff6f77c1a Add since 5.15 to new QVulkanInstance function
Change-Id: Ib1fb6186a8c76d6848d5eda1756e7749383dae40
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-03-03 18:25:57 +01:00
Laszlo Agocs
0378332bc1 rhi: Use versioning in QShaderDescription serialization as well
This is the first time that we add something to QShaderDescription
after migrating to the non-JSON based serialization system. This now
involves checking the "qsb version" when deserializing.

Task-number: QTBUG-82624
Change-Id: I2bd875ef21e461559b878dccc5537cdfa43feaa2
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-03-03 18:25:57 +01:00
Laszlo Agocs
4cff6e102d rhi: Include an arrayDims vector in InOutVariable too
We use the this struct to describe combined image samplers and storage
images as well. Especially with the former, it is not unlikely that we
will need arrays, so e.g. layout(binding = 1) uniform samplerCube
shadowCubes[8]. In this case the '8' is something that must be reported in
to the reflection information.

The new arrayDims member is expected to work exactly like the similarly
named member in BlockVariable.

Task-number: QTBUG-82624
Change-Id: I1fb8b0318906ff4c116c1a7ec23a399c6545c730
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-03-03 18:25:57 +01:00
Laszlo Agocs
bd2b77120e rhi: vulkan: Sanitize device extension handling
Instead of

qputenv("QT_VULKAN_DEVICE_EXTENSIONS", "VK_KHR_get_memory_requirements2;VK_NV_ray_tracing");

one can now do

params.deviceExtensions = { "VK_KHR_get_memory_requirements2", "VK_NV_ray_tracing" };

on the QRhiVulkanInitParams passed to QRhi::create().

The environment variable stays important for Qt Quick applications, which provide no
configurability for the QRhi construction (yet). On the other hand, applications using
QRhi directly can now also use the new approach to specify the list of device extensions
to enable.

In addition, take QVulkanInfoVector<QVulkanExtension> into use. There is no reason not to
rely on the infrastructure provided by QVulkanInstance. This also implies showing an
informative warning for unsupported extensions, instead of merely failing the device
creation. (applications will likely not be able to recover of course, but at least the
reason for failing is made obvious this way)

Task-number: QTBUG-82435
Change-Id: Ib47fd1a10c02be5ceef2c973e61e896c34f92fa3
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-03-03 18:25:57 +01:00
Laszlo Agocs
5bbc9986f9 rhi: d3d: Use native resource binding mapping table when present
Newer versions of QShaderBaker will now use distinct, zero-based b, t+s,
and u register spaces in the generated HLSL source. If this is the case,
the native resource binding map (which so far we only used with Metal)
contains the SPIR-V binding -> HLSL register binding mappings.

This way we won't end up with invalid resource binding attempts (consider
that e.g. D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT is only 16), just
because, for example, a combined image sampler had a binding of 18
which then got blindly mapped to s18 and t18 in HLSL.

Task-number: QTBUG-82472
Change-Id: I8bdcb5378634cf159f6367424582f9e9e5821c8e
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-03-03 18:25:56 +01:00
Laszlo Agocs
753e4d82be rhi: Execute pending host writes on nativeBuffer() query
Otherwise it is impossible to write an application that pulls out the
VkBuffer for a Dynamic QRhiBuffer, and then uses it with custom Vulkan
operations that read from the buffer. More precisely, the problem arises
only if the buffer in question is not used in combination with any QRhi
operations, because in that case there is nothing that would trigger
doing the host writes queued up by a resource batch's updateDynamicBuffer().

Task-number: QTBUG-82435
Change-Id: Ieb54422f1493921bc6d4d029be56130cd3a1362a
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-03-03 18:25:56 +01:00
Laszlo Agocs
7b8616859a Do not constantly create new surfaces with MoltenVK on macOS
Querying the VkSurfaceKHR for a window is expected to create the surface once
and then return the same value afterwards.

Task-number: QTBUG-82600
Change-Id: Ib3e99dfca4d940de1a14348eb1909d372a7dde04
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-03-03 18:25:56 +01:00
Laszlo Agocs
23fd7bdf01 macOS: MoltenVK: Pass in the layer instead of the view
Surface creation may be triggered on a thread other than the main thread.
To enable this, MoltenVK also accepts the CAMetalLayer instead of the NSView.
See https://github.com/KhronosGroup/MoltenVK/pull/258

Task-number: QTBUG-82600
Change-Id: I7b925210d05235baf04441682760f09fe58d8144
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-03-03 18:25:56 +01:00
Rolf Eike Beer
b4e17a4864 QImageIOPlugin: fix typo in class documentation
Change-Id: Ic459ddc861a33501940e5aea5d5455455af5c584
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-03-03 14:14:09 +01:00
Mårten Nordheim
e65345afb1 MSVC: Suppress warning C4910 for exported extern templates
Warnings like the following started showing up in dev after
3c0cd7566c. Not a problem in CI but it is
treated as an error in develop-builds, suppress them for now since
it still manages to build.

warning C4910: 'QtPrivate::QMetaTypeForType<bool>':
'__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation

Amends 3c0cd7566c

Task-number: QTBUG-82403
Change-Id: I1ee6731afafd4636102a49555d4d892f39a21bc7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-03-03 14:14:06 +01:00
Fabian Kosmale
cf000d080c QMetaType: support manual unregistration
QtDeclarative registers types in plugins, and supports un- and reloading
those plugins. Those types would leave pointers to unmapped memory in
the type registry on macOs, which would later cause crashes.
We therefore add private API to manually remove the types from the
registry, which can then be used in declarative.
Lastly, as a precaution for re-registering the types, we reset
QMetaTypeInterface::typeId to 0, as the memory is most likely not reset
to 0 when reloading the plugin.

Change-Id: Ic3fc08759f3d4481dca44a91b33baf3ea9e7198e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-03 14:14:00 +01:00
Qt Forward Merge Bot
2f2d870fdd Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-03-03 14:13:53 +01:00
Qt Forward Merge Bot
63312fe2ec Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: If36d96c0fef3de5ab6503977501c55c62a2ecc97
2020-03-03 14:13:02 +01:00
Mårten Nordheim
b30b3248ca QMap: undeprecate QMap::count(Key)
For compatibility with std::map

Change-Id: Icba536244aadcad97c59dfd4bb22a7fdea881a7b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-03 11:41:42 +01:00