Update _qt_internal_add_android_deployment_multi_value_property and
_qt_internal_add_android_deployment_property signatures to match the
_qt_internal_add_android_deployment_list_property signature.
Pick-to: 6.3
Change-Id: Ie4fb2ebe96c783222fc4b56c3186e22b96cbbb95
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
_qt_internal_collect_target_apk_dependencies function is common for
all targets, but its signature was telling that it's target-specific.
This also causes an issue when we had more than one target in tree
that produce apk, since only first target got the property after
respective finalizer was executed. This change generalize the function
and uses _qt_internal_apk_dependencies target to store the extra
library directories from the build tree.
_qt_internal_add_android_deployment_list_property signature is also
changed to support reading values from multiple lists of multiple
targets.
Amends d20f4ae706
Pick-to: 6.3
Change-Id: I5b40fa96a0eb73348c0029e2b13c63a9465cb520
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Since there is an actual qwidgetbaselinetest.h header file, one should
not include a .moc file. The build system will take care of it, and
currently warns about this #include.
Pick-to: 6.3
Change-Id: I4fbff9ef75c901fe3db4df54d6f3ff0d9307edce
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Data-driven test case that renders the HTML files into an 800x600 image
for baseline comparison.
Task-number: QTBUG-99148
Pick-to: 6.3
Change-Id: I9ccc0cd21a1e94ff68d23bb82b84e1da46d6335a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This fixes the issue where WASM could not even be configured with
autotests enabled.
Change-Id: I0890d52754de92fa84be170906fcb0478e90304e
Pick-to: 6.3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Script that wraps Qt test execution in order to iron-out flakiness.
Task-number: QTBUG-96353
Change-Id: Ie8ee780e3f4f8d086c080a7784f9f68fd1867be2
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
You can use these link targets in Qt docs to refer to
QDS topics.
Pick-to: 6.2
Change-Id: I4d4e288e1456ef92c5e8d9949390a431220eab75
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Adds the following in a QShader/QShaderDescription:
- a list of separate images
- a list of separate samplers
- a list of "combined_sampler_uniform_name" -> [
separate_texture_binding, separate_sampler_binding ] mappings
(relevant for GLSL only)
On the QShader (and qsb/QShaderBaker) level not having separate image
(texture) and sampler objects exposed in the reflection info is not
entirely future proof. Right now we benefit strongly from the fact
that Vulkan/SPIR-V supports both combined and separate
images/samplers, while for HLSL and MSL SPIRV-Cross translates
combined image samplers to separate texture and sampler objects, but
it is not given that relying on combined image samplers will always be
possible in the long run; it is mostly a legacy OpenGL thing that just
happens to be supported in Vulkan/SPIR-V due to some benefits with
certain implementations/hw, but is not something present in any newer
APIs.
In addition, before this patch, attempting to run a shader with
separate textures and samplers through qsb will just fail for GLSL,
even though SPIRV-Cross does have the ability to generate a "fake"
combined sampler for each separate texture+sampler combination. Take
this into use. This also involves generating and exposing a
combined_name->[separate_texture_binding,separate_sampler_binding]
mapping table for GLSL, not unlike we have the native binding map for
HLSL and MSL. A user (such as, the GL backend of QRhi) would then use
this table to recognize what user-provided texture+sampler binding
point numbers correspond to which auto-generated sampler2Ds in the GL
program.
Take the following example:
layout(binding = 1) uniform texture2D sepTex;
layout(binding = 2) uniform sampler sepSampler;
layout(binding = 3) uniform sampler sepSampler2;
Inn the reflection info (QShaderDescription) this (assuming a
corresponding qtshadertools patch in place) now gives one entry in
separateImages() and two in separateSamplers(). Assuming sepTex is
used both with sepSampler and sepSampler2, the GLSL output and mapping
table from QShaderBaker will have two auto-generated sampler2Ds (and
no 'texture2D' or 'sampler').
One immediate benefit is that it is now possible to create a shader
that relies only on separate images and samplers, feed it into qsb,
generate all the possible targets, and then also feed the SPIR-V
binary into a tool or library such as Tint (e.g. to generate WGSL)
that canot deal with combined image samplers.
Change-Id: I9b19847ea5854837b45d3a23edc788c48502aa15
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
...backed by support in the backends for D3D11 and Vulkan.
Expose only what works in practice: scRGB with RGBA16F and HDR10 with
RGB10A2 (or A2BGRA10 etc.). For general use, e.g. to render 2D/3D
content, scRGB (i.e. extended sRGB linear) should be chosen because
that is a linear space.
On Windows with a HDR10 display (and an NVIDIA card) both of these are
known to work, as long as Use HDR is enabled in the Settings for the
display on which the window is created.
When requesting a HDR format and it is not supported, we will fall
back to the default SDR RGBA8/BGRA8 format. However, the behavior
seems to be a bit weird with Vulkan and NVIDIA at least when there is
a HDR display but Use HDR is set to Off: this seems to enable HDR mode
for the lifetime of the window (with the usual set of black screens
while switching over the entire display). Not sure why the driver does
this. With D3D/DXGI, with fewer abstractions in the way, we can check
upfront properly, so that will nicely fall back to the defaults
regardless of why HDR is not available.
Support can also be checked in advance via
QRhiSwapChain::isFormatSupported() as long as the QWindow is
available. (though with Vulkan, as said above, this also seems to
ignore the Use HDR setting of Windows)
Complications, such as moving a window from one screen to another, are
currently not known how they behave. To be seen how this is handled by
the Windows compositor. (from 1903 and up it is said to be able to
automatically downconvert scRGB to SDR so perhaps moving from a HDR to
a non-HDR screen would work - remains to be seen if this needs
something more involved)
When it comes to other platforms and potential future support:
- based on its docs Android 8+ may support scRGB with Vulkan as-is on
a suitable device/display, as long as the application declares
android:colorMode="wideColorGamut" in the manifest.
- for Metal the layer can be made EDR enabled and then
e.g. MTLPixelFormatRGBA16Float/kCGColorSpaceExtendedLinearSRGB should
work. However, this won't be added unless we can test it.
- Linux is unknown.
If one needs access to display specific values such as the min/max
luminance when implementing tonemapping or a transfer function, that
needs platform/API specific approaches, and sadly the kind of data
exposed seems to vary, potentially making it difficult to maintain a
single cross-platform logic. With D3D one can get the
DXGI_OUTPUT_DESC1 from the IDXGIOutput6. This has the min/max
luminances in nits and a bunch of other things. For convenience the
output object is now exposed from the swapchain's nativeHandles()
whenever the D3D backend is used at run time. For Metal one would
presumably access maximumExtendedDynamicRangeColorComponentValue and
co. in the NSScreen. Elsewhere one needs to rely on platform/winsys
specific approaches, if there are any. Remains to be seen longer term
if/how this needs/can be better supported.
Change-Id: I2e61a0e062282d4bfdfba39655941c0f9a795112
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
CMake versions less than 3.19 don't support adding the source files to
the PRIVATE scope of the INTERFACE libraries. It looks like these
PRIVATE sources are only used by IDEs to display them in a project
tree. Skip them to avoid configuring issues.
Fixes: QTBUG-99316
Pick-to: 6.3
Change-Id: Id03f540ac9c94e920adfae5de4f364bd7aba4613
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This change tries to make the API more user friendly and prevent wrong
use of multi-abi API. ANDROID_ABI argument of qt6_add_executable was
position-depend and needed to be placed after the executable 'sources'.
Using the target property we solve this problem and provide more
consistent and common way to enable multi-abi build for the single
target.
This meanwhile also requires to execute multi-abi build configuration
in the finalizer, since the property might be set at any point.
Also the priority of the QT_ANDROID_ABI target property now is higher
than the priority of the QT_ANDROID_BUILD_ALL_ABIS variable. So target
will only build packages with the ABIs specified in QT_ANDROID_ABI
property if both are set.
Pick-to: 6.3
Task-number: QTBUG-88841
Change-Id: I3515297ed267974498913c59619433dc234ec217
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
- use sliced() instead of mid(), since we know we call sliced()
in-contract
- replace the manual memmove() with calls to QBA::remove(), but first
resize() to tailOffset, and only then remove(0, headOffset), so we
only move Chunk::size() bytes, as the old code did
- don't bother updating the offset members, as we're restricted to
rvalues now, and we only need to leave behind a partially-formed
object
This code shows that we desperately need QBA::slice() and/or an rvalue
overload of QBA::sliced(), cf. QTBUG-99218. Add a comment to use these
functions when they become available.
Change-Id: I5d8c7363d443dff69338f6f6a7b4bff9957917ec
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
QCoreApplication::installTranslator() does not take ownership of the
QTranslator. The QTranslator dtor removes itself from QCoreApplication
again.
Pick-to: 6.3 6.2 5.15
Change-Id: I17eb7ab350631eb32fe76af29d9a576a0efa05d8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
...fixing tst_QLocale:
QDEBUG : tst_QLocale::formatDate() expected data of type 'QString', got 'char8_t [64]' for element 1 of data with tag 'unicode in format string'
QFATAL : tst_QLocale::formatDate() ASSERT: false in file /home/marc/Qt/qtbase/src/testlib/qtestdata.cpp, line 105
In C++20, the type of u8 string literals changed from const char[] to
const char8_t[].
[ChangeLog][QtTest][QTestData] Fixed streaming of u8 string literals
in C++20 mode.
Pick-to: 6.3 6.2 5.15
Task-number: QTBUG-99480
Task-number: QTBUG-99481
Change-Id: I53bd73522a4ebce307f360e225f25590f981d44a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The Unix code stores an additional flag, ThreadPriorityResetFlag, in
the Policy enum, but ubsan does not approve:
qthread_unix.cpp:303:30: runtime error: load of value 2147483648, which is not a valid value for type 'Priority'
qthread_unix.cpp:304:75: runtime error: load of value 2147483648, which is not a valid value for type 'Priority'
Fix by making the variable of std::underlying_type_t<Priority>.
The masking and unmasking code can now be simplified, too.
In the Windows version, replace some switch targets with equivalent
ones to keep -Wswitch-like warnings, though I hasten to note that both
switches use a default case, so have anyway implicitly disabled said
warning.
Pick-to: 6.3 6.2 5.15
Change-Id: Ie4ea7d05e2928d2755ad12d36535197f85493191
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When the the replacement has the same size as the replacee, but that
size is zero, the whole operation is a no-op, and there's no need to
detach().
[ChangeLog][QtCore][QByteArray] A replace(pos, n, after) call no
longer detach()es when n == after.size() == 0.
Pick-to: 6.3 6.2
Change-Id: I1e8d7c7fb6383f8bfea3212e49fca8a128535564
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Don't call first() on a potentially empty list of families. Fixes
a crash on startup on QNX for me.
Change-Id: I551d21dac8cfd104b774d6442bdbe1db35f8b75c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
These directories are common on desktop operating systems. "Public" is
used for sharing files with other users and "Templates" lets you add new
files to the file creation desktop menu (for example in a file
manager). An example use in a Qt application would be KDE's KIO having
default icons for both directories.
This is where they point to:
Windows: C:/Users/Public, C:/Users/<USER>/AppData/Roaming/Microsoft/Windows/Templates
macOS: ~/Public, ~/Templates
Unix: ~/Public, ~/Templates
Task-number: QTBUG-86106
Task-number: QTBUG-78092
Change-Id: Ifca60c7d2a6dc2109ec290e8fb109ee2d5ca4d38
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Extract function terminate_on_exception() that de-duplicates the
#ifdef'ery around the try/catch and the handling of the pthread
cancellation pseudo-exception.
Apart from de-duplicating complex code, it will also help suppressing
a ubsan false positive, which is why we're picking it all the way to
5.15.
Pick-to: 6.3 6.2 5.15
Change-Id: I99ad2c0618b8dc30801931df09400c6611d9f9e4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Replaces a three-liner with a more elegant, idiomatic one-liner.
Pick-to: 6.3
Change-Id: I57fbe5d808dffa44f6fceffb97c47f0c84ccd3df
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Two functions' implementations were marked as inline, when their
definitons weren't. This is non-sensical, bordering on dangerous, so
remove the inline keyword.
Pick-to: 6.3 6.2 5.15
Change-Id: Iece21f9552aede273fa1f5a7aef0c94307fa5142
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
- There is no mounted partition, where we can create/delete files at runtime.
Tests should be excluded for now.
Pick-to: 6.2 6.3
Change-Id: I1c4db13d35da7d570c4bf787299d829e08951195
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Added Unix to the title of the enum
QStandardPaths::StandardLocation docs Linux paths table as this
also aplies to Unix based OS's such as QNX.
Fixes: QTBUG-63695
Pick-to: 6.2 6.3
Change-Id: I37b1bb6167984ccf7877baf2e6e764337121a947
Reviewed-by: Tommi Mänttäri <tommi.manttari@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... as opposed to QByteArray::toHex('\0'), which doesn't.
Picking to all LTSs because it's in a test.
Pick-to: 6.3 6.2 5.15
Change-Id: I392d5714c4865e530a246ed30a13cdac26b98e0b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The qgenericatomic.h occurrences are getting in the way of splitting
up qglobal.h, so inline the define.
Task-number: QTBUG-99313
Change-Id: I0d6e3553c5ed4ac9e426bef2fe07d2672d73c671
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Both multi-arg as well as QStringBuilder support QStringView these
days, so there's no need for a temporary QString, even one
fromRawData(), with all its extra codegen, when QStringView can do the
job just fine.
Change-Id: Ie9031aef85c5f0b535e94d9e414b7bd71ad909f7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- There is no possibility to unpack *.zip archive anywhere on test device or save any file.
Currently we don't have mounted file system.
Task-number: QTBUG-99123
Pick-to: 6.2 6.3
Change-Id: I8c8d272a92b4475a7548bd10d32fc4203672926b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Just a leftover from code that has been replaced long ago.
Task-number: QTBUG-95237
Pick-to: 6.3 6.2 5.15
Change-Id: I8b1b0f319683ecfb2c93cc51a047616fe29770f7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
When fallbacks are disabled for QSettings then it should not be
falling back to any child groups or keys that might exist in a
fallback set of settings.
Fixes: QTBUG-85295
Change-Id: I563999293a103702035c8d3b027b59b94ca43c0e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Browsers like Safari do not support the hardwareConcurrency property.
Will hard code it to 2, as iOS only supports that amount.
Pick-to: 6.3 6.2
Change-Id: Icb35d3b698b28d8191a554167dc8cc262b806fb2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
On macOS 12.1 the NSEventPhaseCancelled phase can in some situations
report deltas, which causes the scroll to "jump". This happens for
example when initiating a momentum-scroll, and then putting two
fingers on the trackpad to cancel the momentum phase, which starts
a new NSEventPhaseMayBegin phase. When then lifting the two fingers
again, we get an NSEventPhaseCancelled event with deltas, but the
deltas seem like uninitialized data (has a x-value, after doing
a purely vertical scroll e.g.).
Task-number: QTBUG-97841
Pick-to: 6.3 6.2 5.15
Change-Id: I14e765b6111e53e7d3d0da219d4ac7fefe5243d0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Set ${FWCryptoTokenKit} when the framework has been found.
This is useful for WIP card reader support in QtConnectivity.
Task-number: QTBUG-97946
Change-Id: I0e85e0fd2e0fc45fb3069bbdaa2d8b2c927a6c2d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If Xcode wasn't configured with any simulators the build would fail
since we had no device to build for. But we don't need to build for
a specific device, we can build for the generic simulator device,
just like we do for the non-simulator build. This likely didn't
work properly at the time it was first implemented, but now seems
to work fine, and is less fragile than the current solution.
Running tests still enumerates the available simulators,
as that needs a concrete device to run on.
Fixes: COIN-777
Pick-to: 6.2 6.3 5.15
Change-Id: I50e31c1b350cf83ce348275b467051263dea88a9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This is going to screw up the git blame functionality (which is why they
were forward-declared instead of implemented on-site) but the
alternative is that Qt Creator thinks qstring.cpp had almost no
functions inside.
Pick-to: 6.3 6.2
Task-number: QTCREATORBUG-25594
Change-Id: Ib42b3adc93bf4d43bd55fffd16c1986f1a3c1574
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Added section about having the State Machine Framework moved to its
own module.
Pick-to: 6.2
Pick-to: 6.3
Task-number: QTBUG-89285
Change-Id: I95d065230708d5b505d04309fd6ca21007d878dc
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi>
The event dispatcher implementation is now in QtCore,
except for the call to QWindowSystemInterface::sendWindowSystemEvents().
Implement QWasmWindow::requestUpdate() using emscripten_request_animation_frame(),
instead of the previous registerRequestUpdateCallback() function
which now is removed.
Pick-to: 6.3
Change-Id: I7a13eb5391d48dba0f2afe4704ef3188b8daa74b
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
The QtCore event dispatcher will be used from QtGui
as well. Add virtual function where window system events
processing can be added.
Pick-to: 6.3
Change-Id: Ia6eda9ae18b2e91189ef9f60b6621d19a83313de
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
The test helper is expected to crash, but when built with asan, it
just fails.
Skip the test in that case.
Pick-to: 6.3 6.2 5.15
Change-Id: I583142f5ec623895df62498100c1a30539b149ab
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The hasPrefix() function would only use the second 'lookahead' parameter
to check if there was more unparsed text after the current character.
When it's obvious from the codebase that it should actually look ahead
of the current character being processed, and compare againt that future
character.
Html comments were also not handled quite right. Partially because of
the broken hasPrefix() function, but also because it would advance the
current index tracker by 3 instead of 2. Remember that the beginning of
an html comment is <!-- meaning that there are only supposed to be 2
dashes required, not 3. The result would be that something like this
<!----> would not automatically close, because the current index tracker
would jump over the first 3 dashes when it begins a comment, and the
remaining unprocessed string would be ->
Also, because of the broken lookahead in hasPrefix(), a comment could
actually be started with just <!- not requiring a second dash at all.
Pick-to: 6.3 6.2 5.15
Fixes: QTBUG-99147
Change-Id: I8f4d4a1107eaf2dae16d16b7b860525d45a1c474
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
If a popup is open, Qt delivers events to the popup child under the
mouse, so we need to correctly translate the local position of the
context menu event to that child's coordate system.
This is already done correctly for regular mouse events, so use the same
logic here.
Fixes: QTBUG-99371
Pick-to: 6.2 6.3 5.15
Change-Id: Ief24c755e76d4d1aa2304b06662ed26ae309f684
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We didn't delete the new'ed up QMetaTypeInterfaces, causing asan to
complain.
Fix by storing them in strong references alongside their users in a
statically-allocated container.
We use shared_ptr to hold them, because QMetaTypeInterface doesn't
have a virtual destructor, so deleting objects of the TypeInfo types
(plural!) derived from QMetaTypeInterface though a pointer to the base
class is UB. The shared_ptr constructor, however, is templated, so it
stores the correct call (~TypeInfo()) in its type-erased deleter.
We can't use std::make_shared(), because that doesn't support
aggregate initialization until C++20, so we manually new up the
TypeInfos.
5.15 is not affected.
Pick-to: 6.3 6.2
Change-Id: Ic7ec88c34e02a9e0dd3421848c0c0885f4756702
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>