Commit Graph

55150 Commits

Author SHA1 Message Date
Thiago Macieira
ac7f73e507 qfloat16: add AVX512VL qfloat16 conversion tail
Slightly simpler implementation for the tail because of the OpMask
support.

Change-Id: I60fdef243d0c4e04890dfffd16266facd53d78aa
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-02-01 08:31:15 -08:00
Timur Pocheptsov
8247c0dac3 QMacStyle::standardIcon - use the real file name
When converting to cmake, aliases from the (now deleted) qstyle.qrc were omitted and
now we have to use the original names.

Pick-to: 6.3 6.2
Fixes: QTBUG-100317
Change-Id: Ieb83e95c62f10c0e2193602e4c12c5fc1667e15a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-02-01 17:12:08 +01:00
Tor Arne Vestbø
e05300163e Move QIOType wrapper for io_object_t to QtCore
Since we require C++17 now we can use auto for the retain and release
template arguments, which allows us to get rid of the wrapper functions
for IOObjectRetain and IOObjectRelease.

Pick-to: 6.2 6.3
Change-Id: Ifc4bf0fe50dfd0eaf6bb2e143acce6df7df17bdc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-02-01 16:56:02 +01:00
Tor Arne Vestbø
7d19efa7bb testlib: Disable window restoration on macOS in a non-persistent way
The recommended way to register defaults on macOS is via registerDefaults:
which puts the key/value into the volatile NSRegistrationDomain.

This stops testlib from dumping preference files into ~/Library/Preferences:

  ❯ plutil -p tst_qwidget.plist
  {
    "ApplePersistenceIgnoreState" => 1
  }

Pick-to: 6.2 6.3 5.15
Change-Id: I4ac812014f9ff97bc446806eaf2108cd1c8b89c3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-02-01 16:56:02 +01:00
Oliver Wolff
2430172639 configure: Check for basic cpp/winrt support
Some configurations (like MSVC2019 with c++20 on Windows 10) fail
to compile winrt/cpp headers as these include experimental
coroutines unconditionally. In these cases we can fall back to the
legacy implementation.

Pick-to: 6.2 6.3
Change-Id: Ibd574995f8ca1f865bbcdabede1ffcd0c340022f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-02-01 16:51:01 +01:00
Joerg Bornemann
0ad8dd4805 Doc: State Qt versions for when CMake commands etc. were introduced
Introduce the qdoc macros \cmakecommandsince, \cmakepropertysince, and
\cmakevariablesince that insert a paragraph akin to the \since context
command.

Example:
    \cmakecommandsince 6.3
produces the paragraph
    This command was introduced in Qt 6.3

The macro text is wrapped in \n\n to ensure that we always generate a
new paragraph.

Pick-to: 6.2 6.3
Task-number: QTBUG-100212
Change-Id: Id5c8e8812e6b0b915674d108a0e775091e9eacd8
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-02-01 16:51:01 +01:00
Alexandru Croitor
1031fa1547 CMake: Allow installing examples outside of the Qt prefix
Introduce a new QT_INTERNAL_CUSTOM_INSTALL_DIR variable to
allow specifying an 'examples install dir' outside of the Qt prefix.

It will be used in a follow-up change to ensure we don't package
the example binaries in our CI artifacts (thus saving space).

This will be even more important when the examples will contain code
to deploy Qt libraries alongside each deployed example (which would
significantly increase the package size).

Pick-to: 6.2 6.3
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I06b4a8f9e8c57a712a356bca0f5c351a9362bc30
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-01 16:51:01 +01:00
Alexandru Croitor
98c89c8cc1 CMake: Build examples as ExternalProjects in prefix builds
Change prefix builds to use ExternalProjects to build examples
by default. This will affect our CI which only does prefix builds.

To make it work, we have to do a few adjustments:
- look for Config files in the build-tree (before Qt is installed)
- build only one examples with only a single config,
   even if Qt is a multi-config build
- install examples as part of main make install step, rather than
  as part of the make step (which is the default for EPs)
- adjust CXX flags when building with MSVC to ensure we can still
  use sccache and separate debug info
- derive the correct install prefix for each example and pass it
  to the ExternalProject

As a drive-by, add TODOs to address tidiness of the code and corner
cases that likely don't work (Conan).

Amends d97fd7af2b

Pick-to: 6.2 6.3
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I3060da5dc64e7b06052f9dcb720d4d250f876450
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-02-01 16:51:01 +01:00
Alexandru Croitor
1273ffb000 CMake: Copy FindFoo.cmake scripts to build dir in prefix builds
They are used by build dir Qt6FooConfig.cmake files in conjunction
with export(EXPORT)'ed target files when building ExternalProjects
against a non-installed Qt (or in a top-level build).

Change-Id: I688caf1bd1b8a8fe7e549cebade2aef6f928bd6c
Pick-to: 6.2 6.3
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-01 16:51:01 +01:00
Alexandru Croitor
ac4a913f33 CMake: Deduce install prefix of example in qt_internal_add_example
We want to get rid of the INSTALL_EXAMPLEDIR and INSTALL_EXAMPLESDIR
code in each example project.

This was an internal workaround to ensure examples are installed into
a relative path somewhere under $qt_prefix/examples and not in
$qt_prefix/bin or similar.

To achieve that we do two things.

First, deduce the install prefix for each example in the
implementation of qt_internal_add_example (our add_subdirectory
wrapper) and assign it to CMAKE_INSTALL_PREFIX before calling
add_subdirectory. We need to make sure to remove the default
value of CMAKE_INSTALL_PREFIX in the generated
cmake_install.cmake file.

Second, we set an internal variable called
QT_INTERNAL_SET_EXAMPLE_INSTALL_DIR_TO_DOT before the add_subdirectory
call, which will be checked whenever find_package(Qt6Core) is called
in an example project. If the variable is set, the
INSTALL_EXAMPLEDIR var is set to "." in the scope of where Qt6Core
is found.

This ensures that the hardcoded INSTALL_EXAMPLEDIR values in our
example projects are changed to ".".

With both changes, our example project install(TARGET DESTINATION)
calls will now install to
"${CMAKE_INSTALL_PREFIX}/examples/${example_relative_dir}/."

Once all repositories are updated to use qt_internal_add_example
instead of add_subdirectory, we can get rid of the
QT_INTERNAL_SET_EXAMPLE_INSTALL_DIR_TO_DOT workaround.

For repositories that still don't use qt_internal_add_example,
the install prefix rewriting will not happen, but the examples will
still be installed to the proper place because they use their own
hardcoded INSTALL_EXAMPLEDIR value.

Amends d97fd7af2b

Pick-to: 6.2 6.3
Task-number: QTBUG-96232
Task-number: QTBUG-98545
Change-Id: I78c118e10c41b519c570c7d87529afd15aeed900
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-02-01 16:51:00 +01:00
Alexandru Croitor
1a103beff6 CMake: Shorten ExternalProject example project paths
Instead of nesting the external project build dir under the current
binary dir, place the EP build dir where it would usually be when we
use add_subdirectory.

Shorten the name of the external project to just ${subdir} instead
of using the relative current binary dir path.

Place the EP prefix and stamp dirs under a new ${subdir}-ep folder
next to the example build dir.

Overall this places example executables where you'd usually expect
them to be, as well as shortens a bunch of build paths to circumvent
path limit issues when building on Windows.

Pick-to: 6.2 6.3
Fixes: QTBUG-94608
Task-number: QTBUG-96232
Change-Id: Ifb921c5a6397385e8a914111bf56ee59cda003fd
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-01 16:51:00 +01:00
Alexandru Croitor
209438c16a CMake: Split qt_internal_add_example into two functions
One for building using ExternalProject_Add and one when examples are
built in-tree by calling add_subdirectory directly.

Pick-to: 6.2 6.3
Change-Id: If4c5301163aefed9f15148a70a8f7014bc817ac0
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-01 16:51:00 +01:00
Allan Sandfeld Jensen
b954a79e25 CMake: Run export(EXPORT) for prefixed and top-level builds
This is necessary to be able to find Qt6 modules in CMake
ExternalProjects before Qt is installed, regardless of top-level or
per-repo builds.
One use case is examples that are built as ExternalProjects.

Pick-to: 6.2 6.3
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ic6a9bfd1c52a04e34b221deab40f419a6fee9463
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-02-01 16:51:00 +01:00
Laszlo Agocs
fb8bd02e63 rhi: d3d11: Switch the default swap effect and scaling mode
[ChangeLog][QtGui][QRhi] With Direct3D 11 the default swap effect is now
DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL combined with DXGI_SCALING_NONE. This
should provide a better (less "jumpy") resizing experience for Qt Quick
content in particular, because the stretch effect for size-mismatched
present is not ideal for user interfaces. We'd rather want to keep the
size as-is and have the white border on the right/bottom (which we will
have anyway, inevitably). This is also closer to what one gets with
OpenGL (though that may depend on the driver as well). For Vulkan on
Windows, the behavior will remain very similar to what
DXGI_SCALING_STRETCH does, depending on the implementation probably,
because the Vulkan spec fails to address the handling of scaling modes
for size-mismatched presents. To get the old D3D behavior, i.e.
FLIP_DISCARD+SCALING_STRETCH, set the environment variable
QT_D3D_FLIP_DISCARD to a non-zero value.

Pick-to: 6.3
Fixes: QTBUG-99637
Change-Id: Ic8a219fbf3cdb6458b7ec9149bf27e771d9f7ddd
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-02-01 15:06:46 +01:00
Alexey Edelev
f9e48854af Use IMPORTED_LOCATION of rcc target
Use IMPORTED_LOCATION of rcc target when generating Android
deployment settings, instead of the hardcoded host path.

Introduce a helper function to find the location of the imported tool
target.

Change-Id: Icfa51ee7a01b3f58fc4892da03055f9ed531cc0b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-02-01 15:06:46 +01:00
Laszlo Agocs
1b672951ca rhi: d3d11: switch to uuidof everywhere
There seems to be bizarre issues with IID_* as they are not always
exported or are in a different library depending on the SDK and where
dxguid.lib comes from. If not mistaken, we don't need these symbols at
all because in C++ one can use __uuidof instead (which would not be
possible in C code and there the IID_ objects are necessary).

Pick-to: 6.3
Change-Id: I04712382630768a742bb5f42cc5fca9ad10ff719
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-02-01 14:32:58 +01:00
Ben Fletcher
5962605abb rhi: Code quality - remove defaults from switch enums
On code review of previous RHI patches it was noted that many switch on
enum statements contain a default.  This is discouraged as it prevents
the compiler from automatically identifying switch statements that do
not cover all enum cases.

This patch addresses rhi base classes.  Further patches required for
specific backend implementations.

Change-Id: Ib2bb30c66fd214b65a4ca7b787c7c610f3c313f5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-02-01 05:32:57 -08:00
Giuseppe D'Angelo
035babe502 QAbstractItemView: do not access invalid model indices (2/N)
Similar to the parent patch, the private selectAll() was doing
two out of bounds accesses on an empty model. Guard it.

Change-Id: If0f3ce1e6c44a152791313e47db79985e71ef955
Pick-to: 5.15 6.2 6.3
Reviewed-by: David Faure <david.faure@kdab.com>
2022-02-01 14:32:57 +01:00
Giuseppe D'Angelo
33ad8b6fa9 QAbstractItemView: do not access invalid model indices (1/N)
Calling selectAll() on a view with an empty model, with the view
in ContiguousSelection, causes an out of bounds access into the model.
Guard the access.

Change-Id: I3830a979bad760e9e1526c1c8b12d9767d41fc99
Pick-to: 5.15 6.2 6.3
Reviewed-by: David Faure <david.faure@kdab.com>
2022-02-01 14:32:57 +01:00
Giuseppe D'Angelo
22ac61e62a QAbstractItemView: code tidies
In preparation for an upcoming fix, refactor an if over an enumerator
to a switch (which is how this code should've been to begin with).

Change-Id: I11a2de6d66f0359b985b587b7fd37022a7bf56e6
Pick-to: 5.15 6.2 6.3
Reviewed-by: David Faure <david.faure@kdab.com>
2022-02-01 14:32:57 +01:00
Marc Mutz
472722382d QCoffPeParser: simplify std::optional check
Even in C++98 one could declare variables in if statements and
contextually convert them to bool:

   if (D* d = dynamic_cast<D*>(base))
      ~~~
   else if (D2* d = dynamic_cast<D2*>(base))
      ~~~

std::optional is contextually convertible to bool, so we don't need
C++17 if initializers. Just use

   if (auto optional = ~~~~)

Pick-to: 6.3
Change-Id: Ie64c2c1ceb7b608eda0534d837f46d3c4be49bf8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-01 12:47:58 +01:00
Marc Mutz
0d9f4e7526 Make one QT_REMOVED_SINCE/QT_BUILD_REMOVED_API per module
A single global QT_REMOVED_SINCE will start hurting us once more
modules downstream of QtCore start using the mechanism.

With every use of feature, the set of code that needs to compile under
QT_BUILD_REMOVED_API increases. Since we use QT_REMOVED_SINCE in
situations where overloading the new and the old function don't work
in general, this means all code included by any removed_api.cpp needs
to be very carefully written to ensure that any calls to the overload
set formed by the combination of old and new function(s) don't create
ambiguities.

Likewise, the set of APIs that change semantics under
QT_BUILD_REMOVED_API also increases. At some point, the combination of
removed_api.cpp including almost every module header and almost every
header exposing source-incompatibilities when included in
removed_api.cpp will make maintenance a headache.

By making QT_REMOVED_SINCE and QT_BUILD_REMOVED_API per-module
(QT_CORE_REMOVED_SINCE, ...), easy now that we generate the export
macros using CMake, we limit the scope of this problem to the module
using the feature. Downstream modules (say, QtWidgets) will now see
the QtCore API like every other user, even in the
widgets/compat/removed_api.cpp TU.

Pick-to: 6.3
Change-Id: I177bc7bd5aa8791639f97946c98e4592d2c7f9d9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-01 11:47:58 +00:00
Axel Spoerl
2628e897fe Add tab close button in QTabBar baseline test
Fixes: QTBUG-99772
Pick-to: 6.3
Change-Id: I01e0fc78880baae12f46005e4a88db41bea89d65
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-02-01 12:47:58 +01:00
Marc Mutz
543489fed2 QTextTable: fix signed/unsigned warning
Even disregarding the warning, we're instantiating
QList<int>::removeAll<uint>(), which is wasteful, so cast the fragment
to int, like in the indexOf() call a line above.

Detected by a rewrite of, essentially, QList::removeAll() as
removeIf() + lambda, which brought the comparison from an -isystem
header (std::remove()) into Qt code (the lambda), and apparently
un-suppressed the warning.

Qt 5.15 has the same code, but is unaffected, because removeAll() is
no template there.

Pick-to: 6.3 6.2
Change-Id: Id9fe33be647fc3dc958e316f0fbe03009b2a7adc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-01 07:50:56 +00:00
Thiago Macieira
05e029619f CMake: fix running of headersclean targets when CMAKE_CXX_FLAGS is set
We were passing the full option from the user as a single string in the
command-line to the compiler.

clang++ -c "-O3 -g1 -march=tigerlake -mprefer-vector-width=256 -maes" [...]
error: invalid integral value '3 -g1 -march=tigerlake -mprefer-vector-width=256 -maes' in '-O3 -g1 -march=tigerlake -mprefer-vector-width=256 -maes'

Pick-to: 6.2 6.3
Fixes: QTBUG-100315
Change-Id: I6fcda969a9e9427198bffffd16ce83150d4e4263
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-01-31 19:07:58 -08:00
Laszlo Agocs
2c008d6faf rhi: d3d11: Try uuidof instead of IID_* to help old MinGW
Fixes: QTBUG-100294
Pick-to: 6.3
Change-Id: Iee90355ecd48a753f9a7ec53e7f5758e3d12eddf
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2022-02-01 03:02:18 +01:00
Marc Mutz
aaa74e8f99 QWeakPointer: make default ctor constexpr
... and thereby also QPointer's.

Found by applying C++20 constinit around the codebase.

Pick-to: 6.3 6.2
Change-Id: I9f149b2346624ca913c29b796f94ac7d24fe560a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-01 01:59:10 +00:00
Marc Mutz
724a369308 QGuiApplication: constant-initialize lastCursorPosition
Because we used (exported) qInf() to initialize static QPointF
QGuiApplicationPrivate::lastCursorPosition, the initialization was
done at runtime.

Fix by using qt_inf(), which is inline and constexpr.

Pick-to: 6.3 6.2 5.15
Change-Id: I8b07c6c8bf1f644eaa88f2f33166045726915725
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-01 01:31:49 +01:00
Ben Fletcher
9ef702a37b rhi: Add the basic infrastructure for geometry shader support
.. but this will only be supported on Vulkan, OpenGL 3.2+, and Open GL
ES 3.2+ for the time being.

The situation is:

- Vulkan is working.  qsb accepts .geom files already, and QShader has
  existing geometry shader support.

- OpenGL 3.2 and OpenGL ES 3.2 are working.

- D3D11 is not working.  D3D11 supports geometry shaders, but SPIRV-
  Cross does not support translating geometry shaders to HLSL.

- Metal is not working.  Metal does not directly support geometry
  shaders.

Change-Id: Ieb7c44c58b8be5f2e2197bf5133cf6847e6c132d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-01-31 08:53:37 -08:00
Ben Fletcher
1c3ae79ad3 rhi: Add support for polygon fill mode
Support for Polygon Mode (Triangle Fill Mode in Metal, Fill Mode in D3D)
in the RHI graphics pipeline.

Options are Fill and Line

Status:
    OpenGL - ok
    Vulkan - ok
    Metal - ok
    D3D11 - ok
    OpenGL ES - does not support glPolygonMode.

Change-Id: I20b7ef416624700c3dc8d1cbe6474f4ca3889db8
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-01-31 08:52:05 -08:00
Alexey Edelev
1d28fd7a9c Restore missing Qt definitions
Restore the 'QT_NO_JAVA_STYLE_ITERATORS' and
'QT_NO_NARROWING_CONVERSIONS_IN_CONNECT' definitions for Qt
targets.

Add the function that adds global definitions for Qt targets according
to the provided scope and the target property-based switch to disable
the definition for a specific target.

Pick-to: 6.2 6.3
Task-number: QTBUG-100295
Change-Id: I28697e81f9aabc45c48d79aae1e5caea141e04e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-01-31 17:40:43 +01:00
Sona Kurazyan
f2f5c7d2b7 QtFuture::connect: fix for signals with a single std::tuple argument
If the signal passed to QtFuture::connect() takes multiple arguments,
we need to wrap the arguments in a std::tuple when reporting the result.
To detect this case we were checking if the result type of a QFuture
returned by QtFuture::connect() is a std::tuple, but this was not
correct: the result type could be a std::tuple also if the passed
signal takes a single std::tuple argument. Instead, check if the signal
takes more than one argument.

As a drive-by modified the tst_QFuture::signalConnect to use const
values for tuples used in multiple test-cases, to avoid repetition.

Fixes: QTBUG-100071
Pick-to: 6.2 6.3
Change-Id: I1ce39cf87028f36ef94a9d1a4423b0c51473afd4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-01-31 17:40:43 +01:00
Ivan Solovev
26fa539ad2 Blacklist tst_QFileSystemWatcher::signalsEmittedAfterFileMoved on all Windows versions
The test was already blacklisted for Windows 10 and Windows 7. Now it
is flaky on Windows 11 as well.
Blacklist it for all windows platforms.

Task-number: QTBUG-98478
Pick-to: 6.2 6.3 5.15
Change-Id: I870fb6ce80cfe244a76d08bf40677fdb6becab97
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2022-01-31 17:39:33 +01:00
Jani Heikkinen
43dfe13e2c Bump version from 6.2.0 to 6.4.0 in tests as well
Change-Id: I6fbce239f1ce45c921cf3bf1c3970e03d0e520d6
Reviewed-by: Antti Kokko <antti.kokko@qt.io>
2022-01-31 17:20:06 +02:00
Jani Heikkinen
994fd04b2b Bump version to 6.4.0
Change-Id: Ie0e2133d6c9125b901364c979c60b6efd585f026
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2022-01-31 17:20:06 +02:00
Alexandru Croitor
8dce9ee119 rcc: Fix missing IGNORE directive for Qt version in tst_rcc
The IGNORE directive was likely removed as an oversight
in the linked change.

This fixes the test to pass when bumping the Qt version.

Amends 9836dbd6ee

Change-Id: I497325d6d8b8b67cce7b0840bfb9bfa70d85fe73
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-01-31 16:20:06 +01:00
Mårten Nordheim
8437c27582 QNetworkReply: rename socketConnecting to socketStartedConnecting
From the API review.

Pick-to: 6.3
Change-Id: Ic05737db79327e7811fcd974a70914b837e06601
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-01-31 14:24:11 +01:00
Leena Miettinen
ec57418ecf Doc: Update Notepad tutorial
Update to use Qt Creator 7.0 and CMake as the build system.

Fixes: QTBUG-100075
Pick-to: 6.3
Change-Id: I71e1d1446a2c79c98423ca5d4427b4b4eb00021b
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2022-01-31 14:24:11 +01:00
Oliver Wolff
a3503c8eae Blacklist tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109 for Win
The test also fails on Windows 11

Pick-to: 6.2 6.3
Task-number: QTBUG-98475
Change-Id: Iab079587d743500d222f2272d1145424e079b4a3
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2022-01-31 12:40:35 +01:00
Samuli Piippo
42221aa84c Catch2: upgrade to 2.13.8
Update Catch2 header to latest released version. Needed
to build correctly with glibc 2.34.

Two patches applied on top of the upstream release. Previously
used Qt specific change extracted to a separate patch file.

Fixes: QTBUG-95842
Pick-to: 6.3 6.2
Change-Id: I67e442bbe756ff00c96a45eabf593f7aecddd628
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-01-31 09:26:00 +02:00
Edward Welbourne
9a83706046 Fix misguided winding backwards past start of start of MS TZ data
QWinTimeZonePrivate::data()'s search for a rule applicable to a given
time, in the first year whose milliseconds qint64 can represent, tries
to look at the preceding year to get start-of-year data, which leads
to misleading results. It does so to determine whether to use a rule's
standard or daylight-saving details, but this year is long before the
invention of daylight-saving time, so we can bypass the whole mess.

Unfortunately, MS's data does pretend (in some zones) that DST has
always been in effect, so cutting off that claim at some historical
point will actually get better results for before the cut-off than for
the period after it, until the relevant zone actually adopted DST.
Conservatively put the cut-off at 1900, before any actual zone used
DST, albeit after the idea was originally floated.

This fixes a failure found by some QDate::{start,end}OfDay() tests
that I want to introduce.

Pick-to: 6.3
Task-number: QTBUG-99747
Change-Id: I15cf9dd092b946191e8863c7e85fbeb4ba6c106d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-01-30 20:45:15 +01:00
Marc Mutz
2e4db2596a QCalendar: port registry from QHash to QFlatMap
Unlike many other uses of QFlatMap, this actually promises to hit the
QFlatMap sweet spot, and we're using all its levers.

To wit:

- Enable lookup via QAnyStringView through a transparent comparator
  without having to convert the QAnyStringView to QString first. This
  is impossible with QHash, because qHash() values are not consistent
  for different string types: u"a"_qsv == "a"_L1, but qHash(u"a"_qsv)
  != qHash("a"_L1).  The relational operators don't have this
  consistency problem, and they also implement case-insensitive
  comparison, another thing qHash lacks.

- Pick different types of containers for keys and values. For the
  keys, use QStringList, which makes availableCalendars() trivial and
  extremely fast. We can reserve() the flat_map to limit the effect of
  reallocations, because we have a pretty good idea about how many
  entries we'll have. For the values, use the same container as for
  byID. This might be better with QVarLengthArray, but that's for
  another patch.

- Fix the double lookup in registerBackendLockHeld() by using
  try_emplace() instead of contains() + insert().

To enable QFlatMap's full potential, we still need to teach
ensurePopulated() to create the two containers for the QFlatMap
unordered and let QFlatMap sort them in one go, but that, too, is for
another patch.

Change-Id: I7fe4f3f7596e9b234696fbc8e467128b85629f8a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-01-30 14:18:36 +00:00
Edward Welbourne
9135531c33 Refine QTZP_win's msecsToDate() by trusting arithmetic
Division and modulo are guaranteed to be consistent, with the former
truncating towards zero, so the latter giving a remainder that either
is zero or has the same sign as the numerator. In particular, when the
numerator is positive, the remainder is necessarily greater than minus
it, so the formerly correct but unilluminating arithmetic necessarily
gave the answer one and we can just --jd rather than doing anything
cleverer. Assert the fact that ensures this.

Pick-to: 6.3 6.2
Change-Id: Ia718bb947192f1fd2eb36549be12d30e4ee03d58
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-01-30 15:17:55 +01:00
Marc Mutz
58e8ae5605 QFlatMap: fix is_transparent detection
Add a level of indirection via void_t such that

    struct is_transparent {};

works, and not just

    using is_transparent = <unspecified>;

Pick-to: 6.3
Change-Id: I3ca2af6a07e6989dc95abc10fb2d0078a5269e5b
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-01-30 10:11:46 +01:00
Marc Mutz
2b617a29dc QFlatMap: remove binary_find()
The private binary_find() overload set is literally identical to the
public find() one, so cut out the middle man.

One less level of function templates to compile.

Pick-to: 6.3
Change-Id: Ia7b248d883b7bcff39c4f7b470d2567970572885
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-01-30 10:11:25 +01:00
Marc Mutz
64bc6509c3 QFlatMap: add full is_transparent support [3/3]: add overloads
Now add the missing overloads for mixed-type lookups, supported by
is_transparent Compare objects.

Pick-to: 6.3
Change-Id: Ib588b6a4f733d5d9908c8c7d7c209df6e7bd6674
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-01-30 04:14:21 +01:00
Tatiana Borisova
d336fdd393 Fix tst_qfloat16 run time error for INTEGRITY (tested on sa8115)
- Bounds::has_denorm returns denorm_indeterminate.
  It is expected behavior for GHS compiler.

Task-number: QTBUG-99123
Pick-to: 6.2 6.3
Change-Id: I8402c541093a73623b6dc507012d98e565789cff
Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-01-30 00:02:38 +00:00
Dimitrios Apostolou
b013f94086 Write XML test log files even for the flaky test re-runs
Previously the qt-testrunner script was avoiding to write XML log files
for the flaky test re-runs, since parsing them always provides limited
information about what went wrong (for example unparseable files) and
might miss issues completely (for example a crashed test might not even
write a log file), or even mislead if multiple different data points
about a single testcase end up into the database..

But currently Coin is the system that uploads test information to the
testresults database and expects to find such log files in an attempt to
send as much information as possible regarding failures.

Re-enabling these log files will allow Coin to deduce as much
information as possible about the test runs.

This is a temporary step at least, until the test-uploading logic is
separated from Coin. Then it will be easier to find the full information
about what happened with flaky or crashed tests by special logs from
qt-testrunner.py, which is the test re-running orchestrator and
therefore has more knowledge about what went wrong.

Fixes: QTQAINFRA-4754
Change-Id: I69e4469cbe6c0a6ca5b2473eaf8d034632564342
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Toni Saario <toni.saario@qt.io>
Reviewed-by: Simo Fält <simo.falt@qt.io>
2022-01-30 01:00:35 +01:00
Dimitrios Apostolou
b4d9d5c89c qt-testrunner: do not try to re-run initTestCase and others
Some function names are special for qtestlib, in the sense that they can
not be specified as a command line argument to run individually.

In such cases qt-testrunner treats the failure specially and tries once
to re-run the full test executable.

Fixes: QTBUG-89011
Change-Id: I0cc25f91c57374e5ac65ade10e2e223fe969f211
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
2022-01-30 01:00:35 +01:00
Marc Mutz
1ae5b3628d QCalendar: replace two overloads with one QAnyStringView function
The backend was already ported, so this is just about applying
QT_REMOVED_SINCE and updating the docs.

Change-Id: I2c78908deb9cdb3cee19ce8bc148ab3117c1ad9a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-01-30 00:03:45 +01:00