When being queried for QMetaObject::IndexOfMethod, qt_static_metacall
would compare the argument with each of the class' methods'
addresses. Taking the address of an overloaded function is ambiguous
unless you cast to the right type, which the moc-generated code did
using explicit static_cast<>s. If the function is not overloaded, GCC
would warn about the static_cast<> being "useless", which isn't wrong.
Fix by using an implicit cast to a local variable of the correct type
instead of an explicit cast. Since there's no explicit cast anymore,
GCC doesn't warn.
Code before the change:
using _t = void(Counter::*)(int );
if (*reinterpret_cast<_t*>(_a[1]) == static_cast<_t>(&Counter::valueChanged)) {
^--------------------------------------
-Wuseless-cast
*result = 0;
return;
}
After:
using _t = void(Counter::*)(int );
if (_t _q_method = &Counter::valueChanged; *reinterpret_cast<_t*>(_a[1]) == _q_method) {
*result = 0;
return;
}
Since we're using a C++17 construct, we can't pick to 5.15.
Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-71938
Change-Id: If6ba4bf17b3bf7f64e9662ba9d085273882fb460
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There's no point in having each TU that includes this header unit-test
the ascii_isspace function anew.
Amends 7f9398fd4d.
Pick-to: 6.4
Task-number: QTBUG-97601
Change-Id: I17addc3256f4afafb8ec6a86116654b0099efcda
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
The promise tests have been ported to qtwasmtestlib so that they do not
have to use asyncify anymore.
Task-number: QTBUG-99611
Change-Id: Id1b5742c90e36a89540e7a2387cb4110c21ace9b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
qt_internal_add_plugin calls qt_set_target_info_properties with the
TARGET_VERSION argument and passes arg_VERSION. However, the function
qt_internal_add_plugin does not have a VERSION argument.
If arg_VERSION is set before calling qt_internal_add_plugin, that value
will be used, and that could be wrong for the plugin.
Remove the TARGET_VERSION argument from the
qt_set_target_info_properties call.
Pick-to: 6.4
Change-Id: I0ae9e0e6636d74fdc20e6ab9ca525c5a9126000c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This patch adds access to the QWindowsScreen interface from QScreen with
the aim to provide the native handle of QScreen. This handle will be
used in QtMultmedia to find DXGI interfaces related to that screen.
Change-Id: I93f066b3f0d4d70331aeedab36bb0db111a34556
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Since it's no big deal, we can disable this. Making it use rdseed via
inline assembly or detect when the compiler is fixed is Someone Else's
Problem.
Fixes: QTBUG-104697
Change-Id: I89c4eb48af38408daa7cfffd16feabb5408e2fbf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
I'm not sure why they're here, but they only undo the work
from earlier.
Spotted in the API review
Amends 20104bb237.
Pick-to: 6.4
Change-Id: Ifc0fa66a304f819c1f59ef8e4e498ab14f859ef8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Gradle 7.4.2 and AGP 7.2.1 versions are the latest at the moment.
Fixes: QTBUG-103711
Pick-to: 6.4
Change-Id: I871d1331e0340e1cda7dbbc0799bb2c20aed6146
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Commit 5359d4 made it so that the window will always have a valid
compositor pointer, which means that we don't have to keep the
"no-compositor" fallback code path around.
Change-Id: Id226e272937a7d488b27ea08dbc575fd9a039ac6
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
We use it to implement QSysInfo::machineUniqueId()
Pick-to: 6.2 6.3 6.4
Change-Id: I9303001cbc3e5e6716ee57ce9ae785dba08ba88f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We can't use the replacement kIOMainPortDefault yet, as it's not
available in operating system versions we still support, but the
kIOMasterPortDefault documentation explicitly says that passing
NULL as a port argument indicates "use the default".
As the underlying type of a mach_port_t is potentially either
a pointer or an unsigned int, we initialize the default to 0.
Pick-to: 6.2 6.3 6.4 5.15
Change-Id: I288aa94b8f2fbda47fd1cbaf329799db7ab988a0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
As a preparatory measure for using showXFilePicker, the Qt file
filter has to be transformed to the format used by the showXFilePicker
(sXFP) options. A class structure reflecting the options was created. Based on
an input in the form of a qt file filter, it will parse the filter to
the sXFP options format. Unit tests were added and the code is not yet
used in non-test env, next change will use it.
Task-number: QTBUG-99611
Change-Id: I277286467a7b5ce6f323c19bdd31740a41b6a6be
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This fixes a problem where the accessibility tree is not correctly
updated, when using e.g. a StackView. The problem was, that sometimes
when pushing items of the previous view where still selectable via
TalkBack. When popping this sometimes lead to some views not being
selectable because the subtree wasn't updated. To solve this, lets tell
android directly that the subtree changed when invalidating a view.
Fixes: QTBUG-102825
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Ifbf8da1b95f02935b9bcffabfe821547b1128103
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This allows to create EGL context without involving Xlib.
This extension was created a year ago and is present in Mesa since 21.0
Change-Id: I7cb0aece1e67b4db59d453cbcfbd317bb5d9c777
Reviewed-by: Liang Qi <liang.qi@qt.io>
Added the functionality to report text statuses from tests, reporting
file and line of assertion failures. Refactored the qtwasmtestlib.js
for improved stability.
Task-number: QTBUG-99611
Change-Id: I717e0cc38ac7f155fe870710f6b5e4bfb81b9317
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
On android the event loop is normally blocked, when the application
is suspended, e.g. when it enters the background or when the screen is
locked (see android.app.background_running). This leads to a problem
when we try to process events after this happens, e.g. when android
sends us an ACTION_CLEAR_ACCESSIBILITY_FOCUS event after the event loop
is suspended. While handling it we eventually call
QtAndroidAccessibility::runInObjectContext() which tries to do a
blocking call on the object context, however, with the event loop being
suspended we run into a deadlock which leads to an ANR. So we need to
make sure to never make a blocking call while the event loop is
suspended.
Task-number: QTBUG-102594
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I33f0440a3da84fb4bdae5ab0fc10d514c73f23ad
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The "GpuDescription::detect().gpuSuitableScreen" is a device
name like "\\.\DISPLAY1", not a user-friendly name.
Amends commit qtbase/75f22702933bad4f0da2b63a94ea183021771e4c
Pick-to: 6.4
Change-Id: I525ecd026f3ee3bc467834449ae023ebfa1138c1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Use a more detailed description instead.
Also adds the missing part of the GCC parameter.
Amends commit qtbase/42287255d38bf493b5731396b99bc9cd7b1baba4
References:
https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gcc/Instrumentation-Options.html#Instrumentation-Options
Change-Id: I94a22ac7dfa80644e92fe01021f7868dfa02dd69
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Uniforms of int and ivec arrays are supported from GLES v2.0.
Change-Id: I9a08db18f584e39b4f71b7348a2a1fe4089bfce4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Many algorithms (ciphers etc.) had become 'legacy' in OpenSSL v3,
meaning they are not available by default. Since we don't mess with
loading providers and don't load the 'legacy' one, we have to
skip tests involving such algorithms.
Pick-to: 6.4 6.3 6.2 5.15
Fixes: QTBUG-104232
Change-Id: Ieceabeb080e531aeb24f733cb8c83ad08a25049c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It expands to sseregparm in gcc, and then can't build with SSE2
disabled.
Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-104726
Change-Id: I063ed87ed7f7ba683a19cd3f6e8a25c5111ef72a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There's no good replacement yet, so for now ignore the deprecation.
Pick-to: 6.2 6.3 6.4 5.15
Change-Id: I56928b73c47b677e3fdafd35cc5ae558e5285314
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
value() can potentially throw an exception. We know that it doesn't in
this case, but the compiler doesn't know. And our code checker doesn't
know either and generates lots of false positives. Also, without the
exception propagation code the resulting binary is probably smaller.
Coverity-Id: 386110
Coverity-Id: 384314
Coverity-Id: 383835
Coverity-Id: 383784
Pick-to: 6.4
Change-Id: Icdacf8e003fd3a6ac8fd260ed335239a59de3295
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When item.height > viewport.height, the next item is not found
correctly, resulting in an infinite loop.
In this case, move directly to the next item.
Pick-to: 6.4 6.3 6.2
Change-Id: I67a40a079ca9dd9189bf84ae550758c685b83d75
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Under normal circumstances, when the second point is touched, the
first point has not been released, and the message at this time
should contain two touch points. We are simulating the case where
the message is lost when the popup is closed by touch. Amends
efc02f9cc3
Pick-to: 6.4 6.3 6.2
Change-Id: Ic722e3dbd615c46076ede26611d0107501c5e274
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The include paths in QMAKE_INCDIR_FOO entries in qt_lib_XXX.pri files
are filtered to not contain implicit include directories.
We must enclose the regular expression with ^...$ to avoid catching too
many paths like any subdirectory of /usr/include.
Fixes: QTBUG-104736
Change-Id: I2d40e6ec6d3f3421d591fed90b4dd9ebbbeb59f4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Previously QtModulePlugins.cmake files were only created and
included in static library Qt builds.
Having the targets available in shared library builds would be
useful for custom project deployment purposes. One could query
the location of the plugins or use various generator expressions
referencing their location.
Ensure we always generate and include the QtModulePlugins.cmake files
regardless of the build type.
Allow opting out of including the files by setting
QT_SKIP_AUTO_PLUGIN_INCLUSION to ON, just like we allow for Qml
plugins with QT_SKIP_AUTO_QML_PLUGIN_INCLUSION.
Pick-to: 6.4
Fixes: QTBUG-94066
Change-Id: I69a5dc17762a8e43265578fc33b82b5c4b7a1f5c
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Don't duplicate the logic of plugin package inclusion for each Qt
module. Instead move it into QtPublicPluginHelpers.cmake.
Pick-to: 6.4
Task-number: QTBUG-94066
Change-Id: I5e1f5176a0e754ed56a792c97865752529462617
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Use message(STATUS) for the 'Generating Plugins' message.
This way it will go to stdout instead of stderr, which follows the
convention we have for most of our other messages.
Also list only the modules that actually have plugins, rather than all
known modules.
Pick-to: 6.2 6.3 6.4
Change-Id: I1ea0ed71418ede54790cabd32e03e82fc69f2858
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Make our QRhiMemAllocStats struct a bit more generic, drop the memory
allocation part in the naming, and use the same getter and struct for
reporting some important timings. (we are free to rename for now, there
are no users in other modules yet)
The time spent in graphics (or compute) pipeline creation has a special
relevance in particular with the modern APIs (as it is the single
biggest potentially time consuming blocking operation), but also highly
interesting with others like D3D11 simply because that's where we do the
expensive source-to-intermediate compilation is HLSL source is provided.
In order to see the effects of the various caching mechanisms (of which
there can be confusingly many, on multiple levels), the ability to see
how much time we spent on pipeline creation e.g. until we render the
first view of an application can be pretty essential.
Task-number: QTBUG-103802
Change-Id: I85dd056a39db7e6b25fb1f9d02e4c94298d22b41
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The goal is to make it possible to implement QSGRhiSupport::backendName()
in Qt Quick with just a single line:
return QString::fromUtf8(QRhi::backendName(m_rhiBackend));
instead of duplicating the strings and the logic.
Similarly, QBackingStoreRhiSupport can now drop its apiName() helper
entirely.
Change-Id: Ia8cbb1f1243539ed4d7a98e71dcc2ed56b017e40
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Docs are private for now, but it is still preferable that the code
snippets in there are up-to-date.
Change-Id: Icaf28d9b6a9ac029755ba241263f59d5091aa1b5
Reviewed-by: Inho Lee <inho.lee@qt.io>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
These classes are all derived from QDomNode, and their assignment
operators are directly or indirectly calling the ones from QDomNode
by explicitly converting to it. We can just use the default assignment
operators instead.
Change-Id: I1e3d4eef2188d124e5d54a909eb18bb93ddaa110
Pick-to: 6.4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- removed outdated docs about QXmlParseException (a leftover from
SAX-based implementation)
- replaced 0 with nullptr
- fixed a typo
Change-Id: I96362be8bb6a5f1b23eb8999416b6b04228e0a5f
Pick-to: 6.4 6.3 6.2
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
The manually defined native JNI function tables allow defining a name
that may be different from the actual function name; this name is then
used from the Java-side.
This can be useful to provide also as an option with the new
"unstringifying" macros which can help for example in porting code
to these new macros.
Pick-to: 6.4
Change-Id: Icfebfb351cb8dfb122795d20b37e2eac167a41bf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It didn't enter the original patch because it would
prevent it to be backported to 6.2 and 5.15.
Pick-to: 6.3 6.4
Change-Id: I9af30b86b98d5d101b0784cf45781cf46d216c6d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
While headerscheck doesn't detect this (generic code), this might
trigger warnings in user code.
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I6183323d0a1c73b021699d4c4afa2d1fcf71aad2
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
User code in an event handler can do arbitrary things, including
operations that lead to destroying the QWidgetWindow. An example is
what the autotest does: reparenting the top-level widget to under
another top-level upon the drop. Internally this leads to destroying
the drop target's QWidgetWindow as the widget is now a child, not a
top-level.
In fact some of the existing drag and drop handling code seems to be
prepared to handle the case of having the drag target widget destroyed
in the user's event handler during a drag-move. But none of it is
prepared for having the QWidgetWindow destroyed upon returning from
forwardEvent().
The associated bug report has the same root cause, it is just popping up
now via the new 6.4 behavior: adding a QOpenGLWidget to a widget
hierarchy upon a drop leads to getting a new QWidgetWindow (if the
window only had regular raster widgets before).
To solve this, avoid touching members on 'this' after the
forwardEvent(). It looks like the handlers for mouse events follow
this pattern already, no member data is touched after forwarding events
(not sure if that is intentional or just incidental but it is the safe
solution, even if this is not feasible everywhere, but ideally input
events should take this into account).
Fixes: QTBUG-104596
Pick-to: 6.4 6.3 6.2
Change-Id: I96c704cadcd799fc5619b776e939dfdf313a27dd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The previous fix 754512a64d
did not handle qml plugins, which meant that they would still have
hardcoded paths and see warnings like the one below when generating
the prl files
CMake Warning (dev) at
cmake/QtFinishPrlFile.cmake:103 (message):
Could not determine relative path for library
qml/QtQml/WorkerScript/libworkerscriptplugin_debug.a
when generating prl file contents. An absolute path will be
embedded, which will cause issues if the Qt installation is
relocated.
Handle qml plugins as well.
Amends 754512a64d
Amends f4e9981259
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-104708
Task-number: QTBUG-104396
Change-Id: Icfb1069d1cb0a39a35004b20e58ee6e386d14f3b
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Previously if zstd was not found, one would see such a warning message
Could NOT find WrapZSTD: Found unsuitable version "", but required is
at least "1.3" (found ZSTD_LIBRARY-NOTFOUND)
This is because PC_ZSTD_VERSION was a defined variable with an empty
value, which makes FPHSA believe that a version was extracted from
somewhere.
Avoid passing that value directly.
Now the warning message is
Could NOT find WrapZSTD (missing: ZSTD_LIBRARIES ZSTD_INCLUDE_DIRS)
(Required is at least version "1.3")
Pick-to: 6.2 6.3 6.4
Change-Id: I88760d94db0d869d328085996298f4aaa88bc6c2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Rename FindWrapDoubleConversion.cmake into
FindWrapSystemDoubleConversion.cmake.
Merge contents of Finddouble-conversion.cmake into the one above.
This allows users to provide their own Finddouble-conversion.cmake
file (Conan can do it).
Don't mark the system package as required, because we have a bundled
one too.
Add link to upstream.
Make sure to show either Config file or library path when one is
found.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-104541
Change-Id: I9ea2330697c6fc280328849ca11522291c4073d8
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This allows picking up 3rd party Find modules. One use case is
Conan-generated Find modules.
Also add TODO in case we ever need to handle finding the upstream
target name rather than the Hunter chosen one.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-104542
Change-Id: I243987c657f74e8127076666d9734b2b657bc0ee
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The version option needs to be specified before the COMPONENTS
option, otherwise it is treated as another component.
This causes failures when a Conan provided FindPCRE2.cmake script is
picked up, which actually does validation of component names based
on the component information stored in the conanfile.py recipe.
Move the version value to be before COMPONENTS.
Amends 1007aac63a
Pick-to: 6.2 6.3 6.4
Task-number: QTBUG-104542
Change-Id: I92c70f266a07c4aabdadcecda1ba7e107a033604
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
If the user has a Wacom stylus in proximity of the tablet already
(perhaps left it lying on the tablet) and starts a Qt application, we
don't get to see a proximity enter event, so a lot of device information
is missing; nevertheless, creating a stop-gap device (with ID 0, type
Unknown) makes it possible to get basic QTabletEvents with pressure,
until the next time the stylus leaves and comes back into proximity.
Pick-to: 6.4
Fixes: QTBUG-65559
Change-Id: Ibacbdb78461c0b62d4040c80d210a1b06074e952
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>