Commit Graph

57279 Commits

Author SHA1 Message Date
Marc Mutz
bd43c245e8 Port qt_doubleToAscii to qsizetype
Allows central handling of large buffers.

Adjust some callers.

Pick-to: 6.4 6.3
Task-number: QTBUG-103531
Change-Id: Ib55974c3de250883cd0f6d11a7eee051c7fd11bc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-26 02:06:17 +02:00
Marc Mutz
ec35efd7f2 Fix stringish::simplified() for strings > 2Gi characters
If, after simplification, the result string would have been >2Gi
characters in length, the code returned a shorter string, truncated
mod INT_MAX, because the algorithm had not been ported to qsizetype.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103531
Change-Id: I57cfed34e5c69406f8d3f2913962d006b4bc6bd0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-07-26 02:06:17 +02:00
Marc Mutz
ab512adf12 Port QUtf8BaseTraits to qsizetype
It's unclear why the the char8_t overloads have int sizes. At the time
60aa0d0868 added these, the uchar
overloads were already using qsizetype.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103531
Change-Id: I8ed4c5462de29a7d48255e440e34bcd5114755fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-26 02:06:17 +02:00
Marc Mutz
4ed2c92bf4 Port QStringIterator to qsizetype
Most of the API is formulated using iterators, but index() and one of
the ctors still used int.

Patch users. There appear to be no users of this class outside of
QtBase.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103531
Change-Id: I097ce839d74ff76bd8c1925d09634ffeaaa2fc07
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-26 02:06:17 +02:00
Marc Mutz
34800d1f09 QStringIterator: fix UB [1/2]: use has{Next,Previous}() more
Replace

- pos > i with hasPrevious()
- pos < e with hasNext()

Everything is inline, so there's no difference in assembly, but less
source code lines to fix later.

Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I3f9cf2716c96b811b29b75fa20f88cc3b461771a
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-26 01:29:16 +02:00
Marc Mutz
f73833809b Fix QString::vasprintf for strings > 2GiB
Both format strings > 2GiB, as well as result strings > 2Gi characters
were affected by the append_utf8() helper function being left unported
from int to qsizetype.

There were actually two bugs in that 5LOC function:

1. The len argument was an int, but the caller feeds a difference of
   pointers (even explicitly cast to qsizetype) to the function, so
   any stretch of verbatim text > 2GiB in the format would cause the
   output string to be corrupted.

2. If the result string was already > 2Gi characters in size, a call
   to append_utf8() would truncate it mod INT_MAX, because the
   string's size() was stored in an int variable and the used in a
   resize() call.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103531
Change-Id: I0a09d27b7782093d3f8ea17bb621ff8dad375072
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-26 01:29:15 +02:00
Marc Mutz
0b5d4c3eae Fix QString::toLatin1() for strings > 16Gi characters on ARM64
More qsizetype truncation to int, this time in the number of chunks in
SIMD processing, so the limit isn't 2Gi, but 16Gi.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103531
Change-Id: Ib584c8dc7aa8dedc1cb8181e7d6f20b582c93f8c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-26 01:29:15 +02:00
Marc Mutz
88f2a78594 QLocale: port to qsizetype [1/N]: indexed to ranged loops
Ranged for loops are independent of the container's size_type, so port
what we can to them.

Pick-to: 6.4 6.3
Task-number: QTBUG-103531
Change-Id: I0fd5c9c721e892ea617f0b56b8ea423e7a9f0d04
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-26 01:29:15 +02:00
Marc Mutz
15a80cf8a9 Fix QString::arg() for format strings with a huge amount of placeholders
QString::arg()s placeholders are limited to triple-digits, so 1000
different ones. By the same token, the length of any one of them is
bounded to five (%L?\d{,3}). But the total possible length of escape
sequences is _not_ 5000B, because there's no limit on the number of
_equal_ placeholders, so a format string where the total escape sequence
length exceeded 2Gi characters, e.g.

  QString("%L100").repeated(INT_MAX/5 + 1).arg(42);

would produce corrupt data.

Pick-to: 6.4 6.3
Task-number: QTBUG-103531
Change-Id: Id27ee02579387efcbb5928de1eb9acbeb9f954c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-26 01:29:15 +02:00
Christian Ehrlicher
f9d002ea20 MySQL plugin: fix escaping a QByteArray
1df974590f introduced a regression which
kills the escaping of a QByteArray because QString::fromUtf8() gets a
wrong length from a QVarLengthArray.

Pick-to: 6.4
Fixes: QTBUG-105078
Change-Id: Ic2f76c82c246e1e9eaf1d3f907d11fc345b5655e
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2022-07-25 22:08:19 +00:00
Alexandru Croitor
fcd64a4981 CMake: Don't use PUBLIC_LIBRARIES for executables
Change-Id: I5648fbed3542395e65f86e35825b1b50f824133e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-25 19:53:05 +02:00
Alexandru Croitor
4720735103 CMake: Change __qt_internal_include_plugin_packages to be a macro
The __qt_internal_include_plugin_packages function includes
PluginConfig.cmake files which in turn might look for dependencies
with find_dependency. The dependencies that were found not have their
_FOUND variables set in the calling scope, which could cause multiple
lookups of the same dependency packages.

Change the function to be macro, so that all relevant _FOUND variables
are set and no unnecessary package lookups are done.

As a result, no need to set the QT_ALL_PLUGINS_FOUND_BY_FIND_PACKAGE
variable using set(PARENT_SCOPE)

Pick-to: 6.4
Task-number: QTBUG-104998
Change-Id: Iba0fc83d9e58651f095e7b70d1ed19f064c4e577
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-25 19:52:54 +02:00
Alexandru Croitor
63db26a47e CMake: Don't look for Qt6 components that are already found
This matches what we do in Dependencies.cmake files, except this time
for COMPONENTS passed to the Qt6 package.

For example if a project does
 find_package(Qt6 COMPONENTS Widgets Core)
we'd end up looking for Core twice. Once as a dependency of Widgets
and once as a standalone request of the project.
Make sure to skip the second lookup if it was already found.

Pick-to: 6.4
Task-number: QTBUG-104998
Change-Id: I61db7fbb99818b4b70a0bfe3e167b6f14732292e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-25 19:52:51 +02:00
Alexandru Croitor
3892e86d6e CMake: Don't unset Qt6Qml_FOUND when including Qml plugins
Removing the variable would cause nested find_dependency calls of
FooQmlPluginDependencies.cmake files to look for the Qml package
again and again.

If we got to the point of including QmlPlugins.cmake, we already know
that the Qml package was found.

Set it to TRUE after every inclusion to avoid repeated Qml package
loading.

The second inclusion pass will ensure to set the found variable to
FALSE in case if some dependency is actually missing.

Amends aad4158959

Pick-to: 6.4
Task-number: QTBUG-104998
Change-Id: I562a1c2ea0abac61453a743ab2e7d2f228de7ff0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-25 19:52:48 +02:00
Alexandru Croitor
dffcc2370e CMake: Record the precise package name where Private modules live
Previously if a target depended on CorePrivate, we would write a
_qt_internal_find_qt_dependencies(... Qt6CorePrivate) call into a
FooDependencies.cmake file.
That find_qt_deps call would remove the 'Private' suffix and would run
find_dependency with NAMES set to both the altered and non-altered
names.
This would find the relevant package but it would set the wrong
_FOUND variable name, e.g it would set Qt6CorePrivate_FOUND instead
of Qt6Core_FOUND.
This in turn could cause multiple lookups of the Qt6Core package
during dependency handling because the correct _FOUND var would not be
set.

Instead of always looking for the Qt6CorePrivate package, make sure
we look for an appropriately named package for all Privates modules,
because we have the necessary info to determine the correct name.

Note that INTERNAL modules will still be looked up via a Private
suffixed package name because that's how the package name is chosen
for them.

Remove the code that accounted for Private modules in
qt_internal_remove_qt_dependency_duplicates because it's not needed
anymore.

Warn when a package name can't be queried from a target's property
because the target might not exist yet.

Add a TODO comment for the code that searches with two NAMES.
We can't remove it right now, because it might break user projects
that use stale Dependencies.cmake files.

The dbus subdirectory is added before the tools subdirectory
to ensure that the new package name extraction does not error out, due
to trying to access a target that does not yet exist.

Amends 425ff34aa1

Pick-to: 6.4
Task-number: QTBUG-104998
Change-Id: Ib34ae5ed92f68b4265518c2b8802daeb1a3a04d6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-25 19:52:45 +02:00
Alexandru Croitor
d48e596b3c CMake: Split 3rd party libs to be built before and after corelib
The ZLIB and the PCRE2 should be created before Core, because
src/corelib does qt_find_package to find the bundled / built
libraries.

The libpng, libjpeg, and the rest of the 3rd party libraries should be
created after the Core target is created, because they reference
Core conditionally in qt_internal_extend_target.

Targets should ideally be referenced only after they are created, when
creating linking relationships, but if code needs to extract
properties from those targets, then the targets must exist.
This will be the case in a future change which will extract the
package name from a target's property via qt_internal_extend_target ->
qt_register_target_dependencies chain.

Pick-to: 6.4
Task-number: QTBUG-104998
Change-Id: I732827e5bb4c88532c1e5261ef753d73bda6e638
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-25 19:52:41 +02:00
Alexandru Croitor
82a00471ac CMake: Don't use AUTOMOC for third party libraries
None of them have Qt sources that need moc-ing.
It's also needed to circumvent an AUTOMOC + PCH issue when AUTOMOC is
enabled for a target that does not have any C++ sources, but the
target links to another target that does have C++ sources.

Pick-to: 6.4
Change-Id: Ib1b2aa766089f093117c1ba34e156dfe8b0957e6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-25 19:52:38 +02:00
Alexandru Croitor
976539b4af CMake: Create aliases for Internal targets using common function
Previously we did not create Qt6:: namespaced aliases.
This is needed as a workaround preparation for getting the package name
of a module target from one of it's properties.

Before it would fail in qtinterfaceframework because
ifvehiclefunctions-simulation-server uses PUBLIC_LIBRARIES
in its qt_internal_add_app call, and because _add_app does not handle
such an option, some weirdness in qtbase's _add_app -> _add_executable
-> _extend_executable -> _register_target_dependencies ended up trying
to register PlatformAppInternal as package dependency.
That issue will be handled in separate changes.

Pick-to: 6.4
Task-number: QTBUG-104998
Change-Id: Ifd03528c95b08cb6837a6aaa26cbf97c0cbabbb4
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-25 19:52:34 +02:00
Alexandru Croitor
6235f7fa62 CMake: Export a few useful Qt module target properties
These include:
 _qt_package_name
 _qt_is_public_module
 _qt_is_private_module
 _qt_public_module_target_name
 _qt_private_module_target_name

Pick-to: 6.4
Task-number: QTBUG-104998
Change-Id: I012463944de8fc333f477a7880f9d27a69d6ef47
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-25 19:52:31 +02:00
Alexandru Croitor
8dac271889 CMake: Don't repeatedly look for the Qt6 dependency
When loading Qt packages, don't look for the Qt6 dependency if it was
already found in the given subdirectory scope.

This reduces the amount of find_dependency(Qt6) calls.

Pick-to: 6.4
Task-number: QTBUG-104998
Change-Id: I737c4433daf30eed51a058b45cd539dff7657ca4
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-25 19:52:28 +02:00
Alexandru Croitor
0f8017efb6 CMake: Move QT_HOST_PATH check and computation into Qt6 package
Instead of trying to compute and validate the QT_HOST_PATH and
QT_HOST_PATH_CMAKE_DIR variables in the generated toolchain file,
do it in the Qt6 package.

This provides better error messages when a project is configured
without using the Qt generated toolchain file.
Because it's not done in the toolchain anymore, remove the various
host variables from __qt_toolchain_used_variables.

Pick-to: 6.4
Task-number: QTBUG-104998
Change-Id: I1ca239ff83b8f783897e171fee352fc43e8ad7a8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-25 19:52:25 +02:00
Alexandru Croitor
7b24ffa936 CMake: Improve Qt6HostInfo package lookup condition
Instead of checking if QT_HOST_PATH is set during user project
configuration to find out if Qt6HostInfo should be looked up,
record if QT_HOST_PATH was provided during Qt configuration
into Qt6Dependencies.cmake and look up the package in a user
project based on that information.

This improves handling of the case where cmake is directly used
to configure a Qt project (instead of qt-cmake), which means no
QT_HOST_PATH might be set by the user, and then cmake would error out
saying that e.g. Qt6CoreTools is not found, instead of saying that
Qt6HostInfo is not found.

Pick-to: 6.4
Task-number: QTBUG-104998
Change-Id: I0377d5440e4b5b295af73cfd4b5188f61d48e440
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-25 19:52:22 +02:00
Alexandru Croitor
a41bef8ede CMake: Move Qt6HostInfo lookup into a function
Also replace the duplicate call in QtSetup using the
new function.
To do that, we have to actually the call it in QtBuild
after QtPublicDependencyHelpers.cmake is available.

That call is needed so that Qt6_HOST_INFO_foo variables
are available in qt_generate_qmake_and_qtpaths_wrapper_for_target.

Pick-to: 6.4
Task-number: QTBUG-104998
Change-Id: Ic5776c214bee6bedcea714b213b0e5a42c1bae06
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-25 19:52:18 +02:00
Tor Arne Vestbø
bee6f47d22 cmake: Teach qt_internal_extend_target about PLUGIN_TYPES
Change-Id: I2e8a3faa6ada66a644dceeb98f9ba8e994db4192
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-25 19:47:13 +02:00
Ivan Solovev
2979df59b9 QNetworkInformation: guard deprecated method definitions
The definitions of the deprecated methods were not guarded by the
QT_DEPRECATED_SINCE() check, which causes compilation errors when trying
to get rid of the deprecated APIs using QT_DISABLE_DEPRECATED_BEFORE.

Task-number: QTBUG-105126
Pick-to: 6.4
Change-Id: Iff7a5bbde743b4351b98c58090da44fe05c4654a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-07-25 19:29:08 +02:00
Edward Welbourne
2648b4ad2c Skip some spurious parentheses on macro argument uses
When an argument to one macro appears as a single argument to another
macro, the usual "put it in parentheses" rule doesn't apply since it's
necessarily something the right shape to be a macro parameter. In some
cases, furthermore, the added parentheses could show up in the output
produced by a test when reporting an expression that was compared or
verified. Also removed the parentheses around one comparison.

Pick-to: 6.4
Change-Id: I226f4356fb057351187dac2134cc12c06026c40c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-07-25 19:29:07 +02:00
Edward Welbourne
a670a00aed Skip semicolon after uses of QTRY_IMPL() and QTRY_LOOP_IMPL()
The macros' expansions end with an if-block and a for-block,
respectively, so the following semicolon is superfluous. Since we
control these macros' use (they're internals), just skip the
semicolons, rather than wrapping their bodies in do-while(0).

Pick-to: 6.4
Change-Id: I53f7786a66a0dc7709ac9f96d49985edafceec39
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-07-25 19:29:07 +02:00
Edward Welbourne
4048efc80c Move the early-failure checks in QTRY_IMPL()
These checks should not be included in the #expr reported when the
test fails. They're an internal implementation detail of the loop.
Split a long line while I was about it.

Pick-to: 6.4
Change-Id: Iaea0478967d01cd72ef5a5e9a6501d4be2324b18
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-07-25 19:29:07 +02:00
Edward Welbourne
21e9c223b7 Test skip and fail in cleanup() as well as in cleanupTestCase()
The skipcleanup and failcleanup tests were actually testing skip and
fail in cleanupTestCase(), not in cleanup(). Add almost-duplicate
tests and clean up so that we now have {fail,skip}cleanup(,testcase}
tests to cover all four cases. Generated expected output. The new
tests (with old names) get their fail or skip - during cleanup() -
reported against the test instead of the cleanupTestCase function.
(Results for {init,cleanup}TestCase() are always reported, even when
these slots are not defined, as no-op passes.)

Pick-to: 6.4
Change-Id: I0988d1696b50c0e2f30c45ddc25e1bd0bfd2151a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-07-25 19:29:07 +02:00
Mårten Nordheim
afbae9c2ac Use class scope to refer to static function
The call to metaObject() in the ctor may generate a warning since it
calls a virtual function during construction.

Amends be09628e15

Change-Id: I27472786b41624d582525c4260a54db61ee7ed16
Reviewed-by: Harald Sitter <sitter@kde.org>
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
2022-07-25 19:29:07 +02:00
David Redondo
c142fd8f68 Send parent_window handle to desktop portal
Sending parent_window to the portal allows it/the window manager to
better place portal dialogs in respect to the application window, for example
on top of it instead of a random position. For this use the focusWindow()
(if available) since the API in QDesktopServices does not take a QWindow
parameter. The file dialog has an explicit parent that can be used.
The introduced virtual is provided as a hook for the wayland platform
that already includes a class that inherits from QGenericUnixServices.

Change-Id: I5571f08d07e5a4e3ae32efd1f09e2727cec9e7c5
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2022-07-25 18:29:49 +02:00
Tor Arne Vestbø
f3cd571687 qmake: Link static plugins even in shared Qt builds
It's perfectly possible to create static plugins in an otherwise shared
Qt build, but the logic to import these plugins into applications was
assuming a fully static Qt build. We now handle this more granularly.

Change-Id: Iacfa72f04c7918613b50ca87cf123e7f4c0841d5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-25 18:02:37 +02:00
Tor Arne Vestbø
6ebc4249e2 qmake: Split up logic for enumerating plugins from how they are processed
Sanitizing the contents of the QTPLUGIN variable, and adding default
plugins from the available modules, should be a separate step before
the resulting QTPLUGIN is iterated and processed by for example linking
to each plugin, generating an import file, and adding module dependencies.

This makes it easier to add logic to the processing step later on.

Change-Id: I00e826c7fe87b29cf2e6bf4e1901c4d1482a20e6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-25 18:02:37 +02:00
Tor Arne Vestbø
2b9b5d43f4 cmake: Generate prl and pri files for static plugins in shared Qt builds
The CMake build system files are properly generated, but the qmake parts
were missing.

Change-Id: Icbcce3143db976c536c802ea2314bc3f2595da51
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-25 18:02:37 +02:00
Tor Arne Vestbø
f68e2c92cc cmake: Link static plugins even in shared Qt builds
It's perfectly possible to create static plugins in an otherwise shared
Qt build, but the logic to import these plugins into applications was
assuming a fully static Qt build. We now handle this more granularly.

This works for in-source tools and tests as well, which don't go through
the same CMake machinery for plugins as user projects do. The only case
that does not currently work is in-source examples, as they don't share
any of the plugin machinery with neither Qt internal tools/tests or user
project, but that's a bigger architectural issue that goes beyond this
change.

Change-Id: Ie00a97b02ac38ec4affadc447a3bfd0ec7d9c69a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-25 18:02:37 +02:00
Mikolaj Boc
5a4e5c62af Improve window dragging on WASM
Window dragging has been considerably improved by replacing the mouse
events by pointer events and placing a pointer lock on WASM canvas, so
that off-browser window events are delivered to us.

Translation of the drag origin has been limited to inside the canvas, so
that a window cannot be dragged so far that it becomes offscreen and is
unreachable.

Change-Id: Id177c630a6466f04464a513371d6b97d3a098b6a
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-07-25 14:40:40 +02:00
Jaishree Vyas
57b4e30ff8 Write QProperty use in QML
Details: Added a note on how QProperty works in QML using BINDABLE keyword

Task-number: QTBUG-89166
Change-Id: Ib48dd26b0724f906efa65d14fbb75a8b97255b05
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-25 09:46:42 +02:00
Laszlo Papp
a1ca0c99de QProcess: Extend the setStandardOutputFile doc
It seems to be a hidden gem that one can stop redirecting the standard
output to a file without creating a new QProcess instance.

I have discovered this while browsing the private implementation of
QProcess trying to answer this question:

https://stackoverflow.com/a/72989131/2682142

I believe that this should be documented unless it is not meant to be
guaranteed behavior.

Change-Id: I180764d4cc56f6395d6d65942077e3ede63c71ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-23 16:05:38 +01:00
André Klitzing
4fde012a90 Provide more details of failed connection
Otherwise the errorString from qtls_openssl is lost that
would help a lot why a tls connection failed.

"Error during SSL handshake: error:1414D17A:SSL routines:tls12_check_peer_sigalg:wrong curve"

Pick-to: 6.4 6.3 6.2
Change-Id: Iab74b73488219686e5926308db02bc4063818c9f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-07-23 09:29:05 +02:00
Thiago Macieira
df0085d3a2 QVariant: do allow non-default-constructible types
So long as you only ask us to copy it. Copying is mandatory, though.

I'll firm up the warning in a later commit, which may not get cherry-
picked as far back.

Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-105140
Change-Id: I3859764fed084846bcb0fffd170432abf65dc197
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-22 12:42:55 -07:00
Thiago Macieira
392566cf61 Revert "Drop call to setPlatformScreen in QHighDpiScaling::setScreenFactor"
This reverts commit 7b2ae3faab.

Reason for revert: this breaks multi-monitor XCB with HighDPI.

Fixes: QTBUG-105079
Pick-to: 6.4
Change-Id: I386c9480c33d1f67b3478332c8e03fe3eeeeee39
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Fushan Wen <qydwhotmail@gmail.com>
2022-07-22 19:42:55 +00:00
Ivan Solovev
5a5bc86028 QT_INLINE_SINCE: take version into account
This patch improves the QT_INLINE_SINCE(maj, min) macro to take
deprecation version into account.
If the specified (maj, min) version is less than or equal to the
version defined by QT_DISABLE_DEPRECATED_BEFORE, the macro will expand
to "inline", and the out-of-line fallback will be removed from the
library.

This is achieved by introducing the helper
QT_IF_DEPRECATED_SINCE(major, minor, whenTrue, whenFalse) macro.

Fixes: QTBUG-104131
Pick-to: 6.4
Change-Id: I285029dad7b71126072b024a3be6d7b11341996d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-07-22 20:26:56 +02:00
Dimitrios Apostolou
45501f6ca6 Ensure list has elements before getting them
Before a recent fix it would happen occasionally that
lastNormalizedPositions.at(0) would segfault because the list was
empty. The cause of the flakiness was fixed, but make the test more
resilient anyway by checking first the list is correctly populated.

Furthermore on some platforms this check fails:

  qAbs(leftWidget.lastNormalizedPositions.at(1).x() - 0.8) < 0.05

So instead of QVERIFY use QCOMPARE_LT to print the values when it fails.

Task-number: QTBUG-104268
Change-Id: Id5430eb53c133cf5d23647cfd9749f01f266efce
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-07-22 19:19:59 +02:00
Dimitrios Apostolou
60f61198f2 Fix test flaky-crashing on OpenSUSE with KDE window manager
Sometimes XCB_EXPOSE event is being propagated twice, once before and
once after qWaitForWindowExposed(). But the window has focus only after
the second expose event. Changing it to qWaitForWindowActive() fixes the
issue.

Fixes: QTBUG-104268
Pick-to: 6.2 6.3 6.4
Change-Id: Ibc78dd4958ed1a4a8d0967b29d2a53457ab9ae8b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-07-22 19:19:58 +02:00
Harald Sitter
be09628e15 fix AT_SPI_BUS_ADDRESS actually working
the previous invocation wasn't working because QSpiAccessibleBridge
first needs to construct the connection before it can connect to the
enabledChanged signal that gets emitted as part of connectA11yBus,
effectively missing the signal emission because the connection wasn't
established by the time the emit happens. delay the signal emission
through the eventloop so the caller has time to connect to all signals.

https://bugs.kde.org/show_bug.cgi?id=452132

Change-Id: I1cf9fdd824b2c118cc6278b207aaaedeff259bb1
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
2022-07-22 18:21:16 +02:00
Axel Spoerl
2f4204238c Sync and assert StandardPixmap enums in QPlatformTheme and QStyle
Add missing enum values in QPlatformTheme::standardPixmap to sync with
QStyle::standardPixmap changes from:
785d2b9d07
aa5a595a98

Add enum values NStandardPixmap at the bottom of both enums as well
as an assertion in QStyle constructor that these values are identical.
Add omitvalue for NStandardPixmap in QStyle (QPlatformTheme enum is
not documented).

Pick-to: 6.4
Change-Id: I9ee528d032c445bed5aeace716893b2af8367de2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-22 16:52:35 +02:00
Volker Hilsheimer
e79d7f12e6 Update freetype to 2.12.1
ftdebug.c files are new, adapted the import script to copy the source
file for Windows as well.

Replaced the CMakeLists.txt content that was imported from the .pro file
with the respective variables and logic from the freetype CMakeLists.txt
file, which should make it easier to maintain this next time.

Pick-to: 6.4 6.3 6.2 5.15 5.12
Fixes: QTBUG-105032
Change-Id: I1e846167b268df4b1b0a50dcec602def1a0bdcb4
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-07-22 14:25:26 +02:00
Kai Köhne
425a6415e7 Doc: Remove non-existing directories from qtxml.qdocconf
Change-Id: Id34d1620ff5beeaee6cc308ea9e8a0a2233febe7
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-07-22 13:32:29 +02:00
Kai Köhne
4b31724abe Doc: Document protected variable as internal
Fixes
  qt5/qtbase/src/xml/dom/qdom.h:200: (qdoc) warning: No documentation for 'QDomNode::impl'

Task-number: QTBUG-105091
Change-Id: Ib4341aac7f01878bf63dab07d6905cb1efee5123
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-07-22 11:32:28 +00:00
Marc Mutz
538378f229 Port QCollator/Posix to qsizetype
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-105038
Change-Id: If0cbe82105b753dfebfe1fa1ca7cbd759012e3d5
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-22 13:05:50 +02:00