Commit Graph

42774 Commits

Author SHA1 Message Date
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
Cristián Maureira-Fredes
3f7d087d33 uic: Add pass to empty functions
When there are no translations on the UI file,
the function was left empty but without a 'pass'
statement, generating a SyntaxError,
this change includes it to avoid problems while
using the generated Python file.

Fixes: PYSIDE-1234
Change-Id: I30482a95c95fb4b4f4456531946a79c960d76318
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-03 14:50:35 +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
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
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
Shawn Rutledge
7447e2b337 QTextMarkdownImporter: fix use after free; add fuzz-generated tests
It was possible to end up with a dangling pointer in m_listStack.
This is now avoided by using QPointer and doing nullptr checks before
accessing any QTextList pointer stored there.

We have 2 specimens of garbage that caused crashes before; now they don't.
But only fuzz20450 triggered the dangling pointer in the list stack.
The crash caused by fuzz20580 was fixed by updating md4c from upstream:
4b0fc03077

Change-Id: I8e1eca23b281256a03aea0f55e9ae20f1bdd2a38
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2020-02-28 09:31:59 +01:00
Kai Koehne
e1b6c67bcd Doc: Fix punctuation for QMetaType::QMetaType()
Change-Id: I99d78ae475844f3d145952fd789c5753979745f7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-02-28 08:41:36 +01:00
Kai Koehne
4e51dc440f Doc: Fix documentation for deprecated methods in QJsonDocument
\deprecated has to stand on its own - qdoc will ignore anything on the
right side of it.

Change-Id: Ib698aa66826d6430bbafd926a9c64febd5463c5c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-02-28 08:41:36 +01:00
Kai Koehne
e939d34a9f Doc: Fix wording of operator=!(QMetaType, QMetaType()
Change-Id: I02ca10f968acb42a6e0d793cad78d7d0baa7f472
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-02-28 08:41:36 +01:00
Kai Koehne
da059d0382 Doc: Fix punctation in QPdfWriter::addFileAttachment
Change-Id: Ic00ffd88ecbaa88409bf968f6794fad6f53a2f0e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-28 08:41:36 +01:00
Kai Koehne
6d5d467bcf Doc: Replace 'In alternative' with 'Alternatively'
Amends b19220d17f

Change-Id: Ic6869ce77440b43b30248f1130dabe8cc1b231e9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-02-28 08:41:36 +01:00
Alexander Akulich
4c86e667d2 Revert "QNetworkReply: deprecate the 'error' getter"
This reverts commit ccb2cb84f5 and
commit 0f568d0a67.

The patches fix ambiguity between a getter and a signal by changing the
getter name, but we still have to rename the signal to follow the signals
naming convention.

Revert the commits to keep the getter as is and change the signal name instead.

Change-Id: Iddbab7c33eea03826ae7c114a01857ed45bde6db
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-02-28 07:21:14 +03:00
Andy Shaw
eaf7f572bf Android: Don't recurse into directories inside the assets when iterating
When iterating, it should only return what is in the specified path and
not the contents of the sub-directories inside the given path in
addition.

Change-Id: Iad56f075c22fdf1c633582e37444e26520c24a73
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-02-27 22:56:26 +01:00
Andy Shaw
09c5dfb732 Windows: Enable closing the system tray menu when clicking outside of it
In order for the system to close a menu when clicking outside of it or
outside of the controlling window for the system tray then it needs to be
at the foreground right before the menu is tracked. This makes it act
like other system tray menus then.

Change-Id: I663670c506cfd1e2ba59cd3e75b12e1f8ba17c33
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-27 22:56:26 +01:00
Kai Uwe Broulik
c2a13ae501 QConcatenateTablesProxyModel: Add getter for sourceModels
Currently, there's no generic way to get the source models as there's only
calls to add or remove them.

Change-Id: I23cdef7c93328b58a80ec4659b44073f8ff05088
Reviewed-by: David Faure <david.faure@kdab.com>
2020-02-27 21:10:21 +01:00
Thiago Macieira
ede8545245 QMimeXMLProvider: add missing semi-colon in the #else case
Fixes: QTBUG-82547
Change-Id: Ia8b65350cd5d49debca9fffd15f74e22c0536805
Reviewed-by: David Faure <david.faure@kdab.com>
2020-02-27 11:06:02 -08:00
Assam Boudjelthia
ecae4732a7 Android: QFileDialog::selectedFiles() check isLocalFile()
call toLocalFile() only if the returned QUrl::isLocalFile() is true,
otherwise return toString(). Same thing as done for QFileDialog static
functions as in 1576f81baa.

Change-Id: I3f8cab385e32d0943587b3382a636ea3a168d518
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-02-27 18:37:43 +00:00
Robert Loehning
cb1145fb26 Fuzzing: Add fuzz target for QCborValue::fromCbor
Change-Id: I59fbab99849a23c553520db33d6c7182dc7b114d
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-27 19:36:30 +01:00
Lars Knoll
bb802b4318 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-02-27 19:35:43 +01:00
Volker Hilsheimer
924b97d6ab Fix QDateTimeEdit's handling of invalid time in dst gap
During a spring forward, a time-zone omits an hour. A QDateTime with
such an hour is invalid, but QDateTimeEdit's handling of this invalid
time was not done correctly.

With this fix, up/down changes of any field that would result in an
invalid date-time corrects the time to be valid, while leaving as
much as possible of the user-entered data unchanged. To do that, we
rely on QDateTime::toMSecsSinceEpoch to return a value even for such
an invalid time, which then can be used to construct a valid
QDateTime.

Edits that would result in an invalid hour are reverted to the
previous when pressing return, if correctionMode is
CorrectToPreviousValue. This change also implements support for
CorrectToNearestValue, which uses the same mechanism as when stepping
over an invalid time.

Include a test that verifies that the various interactions result
in a reasonable value. Since QDateTimeEdit does not respect the
timezone or timespec of the QDateTime it is initialized with, we
have to find the first hour of daylight saving time for a year
that we know works for most time zones. Failing that, we have to
skip the tests. Verified in a wide range of time zones.

Change-Id: I05b906ae3b5f6681891d23704f00f9c10cd479ae
Fixes: QTBUG-79803
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-02-27 19:35:28 +01:00
Volker Hilsheimer
31b06a0437 QWizard: deprecate visitedPages and add visitedIds instead
As per the ### Qt 6 comment. A method visitedPages should, following
the convention of the other QWizard APIs, return a list of QWizardPage
pointers. Since the method returns a list of IDs, visitedIds is the
correct name.

[ChangeLog][QtWidgets][QWizard] visitedPages has been deprecated, use
visitedIds instead.

Change-Id: Ifdb94adf093be14cb48c84cb40818c55ff5189a0
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-02-27 19:35:19 +01:00
Volker Hilsheimer
cb390719c6 Remove ### Qt 6 comment that we won't address
QStatusBar is 22 years old, and those protected APIs have been around
ever since. There is no good reason to make them private now.

Change-Id: I62624800d8e287e21535967aa6a861b98cae97d5
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-02-27 19:35:08 +01:00