Commit Graph

44505 Commits

Author SHA1 Message Date
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
Mårten Nordheim
bac89e2f49 QMap/QHash: Use versioned deprecation macro
Because then it can be configured

Change-Id: Ib4c20dd64bedfe2ebadf13283698c50d4c0bc527
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-03 11:41:38 +01:00
Mårten Nordheim
f4fca8697f Undeprecate QHash::count(Key)
For compatibility with std::unordered_map. Spotted in the API review.

Change-Id: Ic34600d55baebcbbf115c1090cd555984037c44c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-03 11:41:34 +01:00
Lars Knoll
c3fc9a24d8 Avoid UB in QList::removeAt()
Always keep the out of bounds check for backwards compatibility,
but warn about it, so that we can remove it in Qt 6.

Amends commit ebf695bc77

Change-Id: I3f1e7e8f9f20feb0b0f06ff9083c26682f1c7d3b
Reviewed-by: Richard Öhlinger <richard.oehlinger@adbsafegate.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-03-03 11:39:56 +01:00
Qt Forward Merge Bot
dd704d4498 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-03-03 11:39:56 +01:00
Shawn Rutledge
761f46f8b5 Remove overrides of QImageIOHandler::name()
We will remove the virtual base class function in Qt 6.
For now, name() returns format().

Change-Id: I1597e823b859e4db148b3e5ac0f1c15350a582eb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-03-03 11:39:56 +01:00
Assam Boudjelthia
873eba3f8b Examples: use QDialog::showMaximaized() for Android
Examples that use QDialog as main window should be maximized on Android
to avoid a black view on most of the screen.

Task-number: QTBUG-80717
Change-Id: I933c1a01d95d53da009c190c37fa32f27be5af5e
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-03-03 12:39:56 +02:00
Allan Sandfeld Jensen
bbe71efc23 Only declare comparison operators for QVector when comparable
This avoid SFINAE from incorrectly assuming QVectors of
non-comparable types has them.

Change-Id: Ie44eb7873384a0f41a6b8160c340b71ea25839dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-03-03 08:27:21 +01:00
Edward Welbourne
275401f580 Warn about Q(Date|Time)+ switching to C locale in Qt 6
Change-Id: I3a3afc3fb4ddca405a75097feb15aee0e72b3b19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-03-03 07:38:06 +01:00
Edward Welbourne
84382bde5c Rename the localexml module to qlocalexml
It implements interaction with the QLocaleXML file format type, so
rename it to match.

Task-number: QTBUG-81344
Change-Id: I46302d4ac1038cdfc5929e73b554b6d793814c56
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-03 07:38:06 +01:00
Edward Welbourne
54413653d5 Rename the endonym members of the Locale type
All other members had camelCase names, but the endonyms had
prefix_endonym names, requiring munging where they were emitted to
XML. So just do that munging upstream in the attribute name of the
Locale objects. Makes no change to the data output by the scripts, not
even to the intermediate QLocaleXML file.

Task-number: QTBUG-81344
Change-Id: I01c15a822216281dc669b3e7ebda096d18b04f9b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-03-03 07:38:06 +01:00
Qt Forward Merge Bot
60ec012d8d Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I851c0328c3c38ea67b5ad115b205ac6a1262706e
2020-02-29 01:00:44 +01:00
Mårten Nordheim
fbebc93617 Deprecate public bearer classes
The WARNING_PUSH/POP in QNetworkProxy is needed because it triggers
a warning when compiled which means a warning gets printed under
compilation which means tst_bic fails.

[ChangeLog][Deprecation Notice][QtNetwork] QNetworkConfigurationManager,
QNetworkConfiguration and QNetworkSession are deprecated, to be removed
in Qt 6.

Change-Id: Ife87722045ea10adf667388a1bf94c4f9bc8d5f0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-02-29 00:39:27 +01:00
Volker Hilsheimer
a53a52a631 Name method parameters in declaration, even when it's obvious
As pointed out during header review. Makes Qt more IDE friendly.

Change-Id: Icb610dba39e39ffd6674c79d9c6e087294788489
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-02-28 20:37:01 +00:00
Volker Hilsheimer
2090b770da Make QProcess::splitCommand accept QStringView, as per header review
A static function that only parses the string to create the list, so
no need for a QString overload.

Change-Id: I1df297adb795095d6eec94ccfcad52498178a7b1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-02-28 21:36:51 +01:00
Jarek Kobus
5ebb03c476 Remove flagBits from QMatrix4x4
Change-Id: I14a22f3272b4793abd1e1b448351c94d3e07e946
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-02-28 18:08:45 +01:00
Jarek Kobus
543e87c65a Bump the datastream version for Qt 6
We don't support obsoleted QMatrix type anymore.

Change-Id: Id412510aa1ad08d6e89a73da3317152e6dfa8f57
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 18:08:45 +01:00
Andy Shaw
7e5f38aec6 Android: Add support for getting information about content uris
This enables things like size(), exists() to work with Android content
uris with the provided uri given from a filedialog. It is expected that
it is always a full path due to the nature of content uris, so relative
paths will not work.

Change-Id: I9c9ea42833677eb9d937b33e9dd42ee2a7d9c7c5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-02-28 16:37:34 +02:00
Allan Sandfeld Jensen
ca9de96233 Avoid using deprecated QTabletEvent::device() method
It was renamed to QTabletEvent::deviceType() in
882f340f62.

Change-Id: I070404bfc9a04144ae3565bfa3cc3a016040a07d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-28 14:37:12 +00:00
Edward Welbourne
895939c7f9 Deprecate QString::SplitBehavior in favor of Qt::SplitBehavior
This requires changing which of the two families of methods gets to
take a default argument for its behavior.

Task-number: QTBUG-81853
Change-Id: I6759bedd9af364d6e12bb39cd539b5dcba37027e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 15:37:12 +01:00
Edward Welbourne
b47cf3fe2d De-inline Qt::SplitBehavior splitters of QString and QStringRef
Convert the QString::SplitBehavior variants to call them, rather than
the other way round and convert the internal infrastructure to use
Qt::SplitBehavior, ready to deprecate the QString::SplitBehavior
versions without generating intenal warnings.

Task-number: QTBUG-81853
Change-Id: Ia6b78881c3d0e30a7bbd4dfd00cc15a407f448a2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 15:37:11 +01:00
Edward Welbourne
305ddbeb5b Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Change-Id: I399b5ea56e9255e775ca1746632f7421519a6616
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-02-28 15:37:11 +01:00
Edward Welbourne
26b1cf2bba QMake: Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Change-Id: I3f1b836cfb47bba0fdc27f2c3aa7b0576d123dca
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 15:37:11 +01:00
Edward Welbourne
00f0863cbe Core: Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Change-Id: I446f9ddc8f8de4a0b79b09edb44f7c1496fbc33f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-02-28 15:37:11 +01:00
Edward Welbourne
8c613ed74b SQL: Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Change-Id: Ia4c698df60648c85c8e6132641e5ea7bc553129a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-02-28 15:37:11 +01:00
Edward Welbourne
c158f881b3 Docs: Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Applied suitable wrapping round various char and string literals,
since docs are meant to show best practice.

Change-Id: Ie061905fad26f9b4dda3eedba4612704f0a19126
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 15:37:11 +01:00
Jan Arve Sæther
8de66e1f24 Remove a "### Qt 6" that I forgot to remove
amends commit 5e83a2eed2

Change-Id: I792d5d71d8c5a8b034d334de31dcd9bacfc53fa9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-28 15:37:11 +01:00
Volker Hilsheimer
4a1de178c9 Try again to make QDeadlineTimer test robust against context switches
Instead of comparing to absolute values, compare the result from
QDeadlineTimer with the reference clock types from std::chrono. Pass
the test as long as we are within 10% of that reference.

In addition, handle the case where QTest::qSleep sleeps for more than
10% longer or shorter than what is requested, and if so, abort the
test.

Change-Id: If8b77aea55a8c5c53e96427b2fff2f78281d0f82
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-28 15:15:42 +01:00
Friedemann Kleint
08d5059320 Fix geometry handling for native child windows
Don't move the native child window position for native child windows.

Initial-patch-by: Błażej Szczygieł <spaz16@wp.pl>
Task-number: QTBUG-82312
Fixes: QTBUG-79166
Change-Id: I117ef08da13c8e90ff60cf034126c9efdc17b836
Reviewed-by: Błażej Szczygieł <mumei6102@gmail.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-02-28 13:43:01 +01:00