Commit Graph

54904 Commits

Author SHA1 Message Date
Fabian Kosmale
987b896b4e Blacklist putWithServerClosingConnectionImmediately on Windows
Task-number: QTBUG-100362
Change-Id: Ib09aec5ea03867163d476a2c92562bc949fc1b1a
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-02-02 05:25:06 +01:00
Marc Mutz
9f31f579ec Sequential erase/_if: don't apply predicate twice to element
The code was trying to avoid a detach in the case no element needed to
be removed, by first running find_if() on const_iterators, and then,
after converting its result to (mutable) iterators, start the
remove_if() algorithm where find_if() left off.

But this applies the predicate to the element found by find_if() (if
any) _twice_: first just before we exit the first find_if() and then
just as we enter remove_if(), which will start by running find_if()
again, with the result of the initial find_if as 'first'.

Apart from being needlessly inefficient, this violates the
specification of Uniform Erasure, which defines sequential erase_if()
as being equivalent to remove_if() + container erase(), with the
former being specified to apply the predicate exactly once per
element.

Fix by writing the remove_if() part by hand.

Instead of doing the dance with the loop invariant documentation
twice, simply implement erase() via erase_if() (complicated a bit by
the weird passing of predicates by lvalue reference instead of by
value, as would be idiomatic). This exposes users to:

[ChangeLog][QtCore][Potentially Source-Incompatible Changes] A fix in
the implementation of the erase-like algorithms of sequential Qt
container may re-enable signed/unsigned comparison warnings previously
suppressed by having occurred in std library code. To fix, cast the
value to look for such that it has the same signedness as the
container's elements.

... but the issue would be the same had we inlined std::remove()
instead of passing a lambda to sequential_erase_if(), so it's nothing
we can, nor should, work around.

[ChangeLog][QtCore][Containers] Fixed a bug in the implementation of
most sequential Qt container's erase-like algorithms (member
removeAll()/removeIf() and free erase()/erase_if()) where the equality
operator or the predicate, respectively, was applied to the first
matching element twice. Each element is now tested exactly once.

Pick-to: 6.3 6.2
Change-Id: Ib6d24b01b40866c125406f1cd6042d4cd083ea0d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-02-02 04:16:59 +00:00
Robert Löhning
27b560373d QImageReader: Check for existing handler in initHandler
Some calling code did this beforehand, other didn't. Now, the function
itself checks for an existing handler before doing anything else.

Change-Id: I8fc43fb8788c9dfe825b15ffa2fa69ee43915cd6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-02-02 04:12:17 +01:00
Marc Mutz
961f5a6fa2 QGuiApplication: invert meaning of qt_is_gui_used
The default value was true, which is non-zero, forcing the variable
out of the BSS and into the DATA segment.

Fix by inverting the meaning so the default value can be false.

Since qt_is_gui_unused sounds a bit complicated, however, take a cue
from the variable's only writer and rename it qt_is_tty_app.

Pick-to: 6.3
Change-Id: I198e9786f7e71178d69fecb5179287bf39b3a1d6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-02-02 03:48:00 +01:00
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