Commit Graph

55436 Commits

Author SHA1 Message Date
Thiago Macieira
0c3ac95899 Logging: use GCC #pragma to suppress the frame pointer
We have a few lambdas now. However, GCC probably inlines everything
anyway in release mode, so this is likely moot.

Change-Id: Ic15405335d804bdea761fffd16d50573621446ab
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-03 19:05:12 -08:00
Thiago Macieira
bd728d1149 Logging: cache the last library file name in a backtrace
They usually come in groups, so this avoids extra work.

Change-Id: Ic15405335d804bdea761fffd16d4fb5c41e122f0
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-03 19:05:11 -08:00
Thiago Macieira
ff2535de5c Logging: add support for decoding backtraces using dladdr()
I'm pretty sure that's what backtrace_symbols() uses internally anyway,
so skip the middle-man.

Change-Id: Ic15405335d804bdea761fffd16d4fb2a1b0c2171
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-03 19:05:11 -08:00
Thiago Macieira
1cad4ed6a1 Logging: reorganize the backtrace code for simplicity and readability
Also removed the Qt::CaseInsensitive searching, which was slow.

Change-Id: Ic15405335d804bdea761fffd16d4f863847c360b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-03 19:05:11 -08:00
Thiago Macieira
ee7166e176 Logging: remove magic constant from backtrace code
Explain what that number 8 is by way of a comment and a constant.

Pick-to: 6.2 6.3
Change-Id: Ic15405335d804bdea761fffd16d4f7567089c575
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-03 19:05:11 -08:00
Thiago Macieira
6358bc9331 Logging: rejiggle the way we detect the availability of backtrace() API
We had proper CMake tests for all we needed, so we can drop the old
detection we were forced to use way back when. Said test (CMake's own
FindBacktrace.cmake) even found QNX's offering, which we reported as
"yes" in our configure output, but never actually used because it was a
different API. Now we'll report "no" for QNX.

Pick-to: 6.3
Change-Id: Ic15405335d804bdea761fffd16d4f73cfe4cf38a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-03 19:05:11 -08:00
Thiago Macieira
50132fb54b Logging: fix encoding of backtrace lines
File and function names are UTF-8 on Unix.

Pick-to: 6.2 6.3
Change-Id: Ic15405335d804bdea761fffd16d4fb71ec2b0d71
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-03 19:05:11 -08:00
Ivan Solovev
d589f3eefe Android: unblacklist tst_toolsupport::offsets
The test is no longer failing on Android in dev and 6.3, but still
failing in 6.2.
I think it's fixed by 63a35898f4
which is integrated into dev and 6.3

Task-number: QTBUG-87396
Pick-to: 6.3
Change-Id: I82e0aac1547f8e43353f0948cd3f91b4b8f9720e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-03-04 02:37:11 +01:00
Ivan Solovev
79fb80152f Android: make sure that orientationChange is reported after resize
On Android orientation changes are reported from the
DisplayListener.onDisplayChanged() method, while the screen size
changes are reported from QtLayout.onSizeChanged().
In practice these callbacks come in random order, so rotating the
screen multiple times might result in inconsistent order of signals
and events.

This patch makes sure that size change events always happen before
orientation changes. This is done by caching the new orientation
values and reporting them only when needed. At this point we also
need to use QMetaObject::invokeMethod() for orientation change,
like it is done for geometry change. Otherwise the orientation
update can still be processed earlier than the geometry change.

Also note that at some point we might get an orientation change
without a size change (for example Qt::LandscapeOrientation ->
Qt::InvertedLandscapeOrientation). That is the reason for
isSimilarRotation() helper function.

As a drive-by: ignore size changes with inconsistent values when window
size is reported to have old orientation, while the screen has already
been rotated. In such cases a new size change will be triggered shortly
with normal value.

Task-number: QTBUG-94459
Pick-to: 6.3 6.2 5.15
Change-Id: I5c98e526d0370d380344b2297169d5e0c0ee8ea7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-03-04 02:37:11 +01:00
Ivan Solovev
285ea13286 Android: set all QScreen's geometry-related parameters together
Screen has 3 parameters:
- physical size
- screen size (or screen geometry)
- available geometry

Before this patch, they were reported in 3 different methods. Screen
size update and available geometry update both were generating the
"screen geometry changed" event, that updated the user-visible
parameters. As a result, at some point we could end up in an
intermediate state, when screen size was already updated, but
available geometry was not yet updated.
This was specially visible while changing the screen orientation:
at some point screen geometry could be reported for the new
orientation, while the available geometry - still for old orientation.

This patch introduces a new method to set all geometry-related
parameters together and generate only one "screen geometry changed"
event. This allows to maintain consistency between 'geometry' and
'availableGeometry' properties of QScreen.

Task-number: QTBUG-94459
Pick-to: 6.3 6.2 5.15
Change-Id: I844f6d0db87df8d5e6e9bcce5d27126384a5a0de
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-03-04 02:37:10 +01:00
Alexandru Croitor
eec317a138 CMake: Generate wrapper shell scripts for all hosts when requested
This is useful for Qt for Android builds, where we want to build Qt on
a single host, but make the Qt installation usable on any host
(Windows, Linux, macOS).

There are only two flavors of shell scripts, unix ones that use sh and
Windows batch files.

If Qt is configured with
-DQT_GENERATE_WRAPPER_SCRIPTS_FOR_ALL_HOSTS=ON
then we generate both of them regardless of the current host platform.

Note that the target_qt.conf file still needs to be patched to specify
a correct HostSpec value so that qmake operates correctly.

Other target_qt.conf values might also need path adjustments depending
on use case (like HostPrefix and HostData).

Pick-to: 6.2 6.3
Task-number: QTBUG-101357
Change-Id: Ic86caaa8b318467528cc82dc7fbfecde998cdb71
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-03-04 01:58:10 +01:00
Sona Kurazyan
e440fec7fc Add literal operators for QLatin1String and QLatin1Char
The operators are declared in the Qt::Literals::StringLiterals
namespace, to avoid collisions in the global namespace.

[ChangeLog][QtCore][QLatin1String] Added literal operator""_L1 that
converts string literals and chars to QLatin1String and QLatin1Char.

Fixes: QTBUG-98434
Change-Id: Ia945a6acf4b8d4fbbb5f803264e4d79d7b17a8da
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-03-04 01:58:10 +01:00
Giuseppe D'Angelo
d45d62f09d QBitmap::fromPixmap: document \since
Change-Id: Ia8b4e20dc98e3b184b6e2ba9844907f813dbc1ab
Pick-to: 6.2 6.3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-04 01:58:10 +01:00
Magnus Groß
3c6b61a6e1 xdgdesktopportal theme: Implement appearance()
We can use the new org.freedesktop.appearance color-scheme setting in
the XDG Desktop Portal Settings to implement this in a DE-independent
way.

In the future we can also use the related "SettingChanged" signal in the
Desktop portal to support changing the theme during runtime.

Useful links:
Spec: d7a304a006/data/org.freedesktop.impl.portal.Settings.xml (L33-L45)
Blog post: https://blogs.gnome.org/alexm/2021/10/04/dark-style-preference/

Task-number: QTBUG-93955
Pick-to: 6.2 6.3
Change-Id: Ia5df22fb215ee94d68d2787da97a1c9f8f2c6b0c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-03-04 00:58:10 +00:00
Giuseppe D'Angelo
742ffd0f47 QDebug: streamline (private) formatQFlags
The implementation for extracting a QMetaEnum from an enumeration
type was duplicated from QMetaType::fromEnum, just use that one.
Also add an explicit cast for the valueToKeys call.

Change-Id: I51b1a214dbab2101ae704954727acf0219eb1604
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-04 01:26:53 +01:00
Marc Mutz
e93bf391fa Fix QTest::toString() over QT_TYPESAFE_FLAGS QFlags
QT_TYPESAFE_FLAGS allows explicit casts only to QFlags<T>::Int, which
is either int or unsigned int. The cast to the resp. other type fails.

To fix, first convert to QFlags<T>::Int with toInt(), and only then
cast to int or unsigned int.

Fixes: QTBUG-101399
Pick-to: 6.3
Change-Id: Ie74d53adc601cdf19708265b040092780676058f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-03-04 01:26:53 +01:00
Thiago Macieira
8e56a7bc6b qsimd.cpp: don't disable SSE FP math
Lowering the architecture all the way to the i386 baseline without SSE2
was causing warnings about disabling SSE FP math. We don't need to go
that low for 32-bit.

Task-number: QTBUG-101198
Change-Id: Ibf4acec0f166495998f7fffd16d682d0f5beec11
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-03-03 15:44:54 -08:00
Thiago Macieira
e8d3cf0909 qsimd.cpp: fix _FORTIFY_SOURCE=2 builds
That option makes printf() and some other functions become always_inline
functions with extent checking. Unfortunately, that also means GCC fails
to inline them when we're not compiling for the same target as
X86_BASELINE.

Fixes: QTBUG-101198
Change-Id: Ibf4acec0f166495998f7fffd16d682c7a7be94d8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-03-03 15:44:54 -08:00
Alexandru Croitor
7b94f87689 coin: Ensure we configure repos with CMake verbosity set to STATUS
We set the default verbosity of configure output to NOTICE in
regular Qt builds.
To preserve the STATUS verbosity in CI runs, we now pass it
explicitly when configuring all repos / tests.

Pick-to: 6.2 6.3
Change-Id: Ib63739c05855cfd5951d38ce3f8a7fc8d1218cd3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-03-04 00:21:44 +01:00
Alexandru Croitor
e2a0ddbb69 CMake: Make configure less verbose by default
Only show the more verbose configure output when configuring
with -developer-build (which matches --log-level=STATUS)

Otherwise in a non-developer build, restrict the output
to NOTICE+ message (includes WARNINGs and ERRORs).

Developers can still pass a custom log level when configuring.
For example -DCMAKE_MESSAGE_LOG_LEVEL=STATUS or
--log-level=STATUS.
The former method will be cached, while the latter is only applied
to the current configure invocation.

Also show the build instructions hint message only when configuring
for the first time.

[ChangeLog][CMake][configure] The configure output verbosity of
non developer-builds of Qt is now reduced by default. Pass
"-- --log-level=STATUS" to configure to make it verbose again.

Pick-to: 6.2 6.3
Change-Id: I7583a9c92142e0b1d7c5411b06403f40d8ebaf20
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-03-04 00:21:44 +01:00
Giuseppe D'Angelo
0deff80eab Associative containers: add a way to obtain a key/value range
Our associative containers' iterator's value_type isn't a destructurable
type (yielding key/value). This means that something like

  for (auto [k, v] : map)

doesn't even compile -- one can only "directly" iterate on the
values. For quite some time we've had QKeyValueIterator to allow
key/value iteration, but then one had to resort to a "traditional" for
loop:

  for (auto i = map.keyValueBegin(), e = keyValueEnd(); i!=e; ++i)

This can be easily packaged in an adaptor class, which is what this
commmit does, thereby offering a C++17-compatible way to obtain
key/value iteration over associative containers.

Something possibly peculiar is the fact that the range so obtained is
a range of pairs of references -- not a range of references to pairs.
But that's easily explained by the fact that we have no pairs to build
references to; hence,

 for (auto &[k, v] : map.asKeyValueRange())

doesn't compile (lvalue reference doesn't bind to prvalue pair).
Instead, both of these compile:

  for (auto [k, v] : map.asKeyValueRange())
  for (auto &&[k, v] : map.asKeyValueRange())

and in *both* cases one gets references to the keys/values in the map.
If the map is non-const, the reference to the value is mutable.

Last but not least, implement pinning for rvalue containers.

[ChangeLog][QtCore][QMap] Added asKeyValueRange().
[ChangeLog][QtCore][QMultiMap] Added asKeyValueRange().
[ChangeLog][QtCore][QHash] Added asKeyValueRange().
[ChangeLog][QtCore][QMultiHash] Added asKeyValueRange().

Task-number: QTBUG-4615
Change-Id: Ic8506bff38b2f753494b21ab76f52e05c06ffc8b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-03-04 00:21:44 +01:00
Edward Welbourne
dd5fc20e90 Minor clean-ups noticed during string-parsing improvements
Simplify a conditional to save some repetition, purge some spurious
parentheses.

Change-Id: I727d22ce81733e765c4ee951475ccdb599063399
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-03 18:50:59 +01:00
Edward Welbourne
9c58870423 Correct some typos and flat-out falsehoods in QTimeZone docs
Apparently the class docs didn't get an update when systemTimeZone()
was added (at 5.5). Also add QCalendar to the \sa.
Prompted by Jaishree pointing out a typo ...

Pick-to: 6.3
Change-Id: If6d38040fff4badc3c0bb765889c1289c560c2b0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-03 16:53:25 +01:00
Ievgenii Meshcheriakov
16b614f2e1 Network: Use system publicsuffix database copy when available
[ChangeLog][Network][QNetworkCookieJar] It is possible to use
system's copy of publicsuffix database when it is available.
This behavior is enabled by default on Linux and can be
controlled using new command line switches -system-publicsuffix,
-qt-publicsuffix, -no-publicsuffix, and -publicsuffix=all.

Fixes: QTBUG-95889
Change-Id: I911e1a13c1422cdc35851953309fff064e7c5f26
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-03 15:56:09 +01:00
Joerg Bornemann
f56c068ee0 pro2cmake: Fix indentation of INSTALL_EXAMPLESDIR assignment
Change-Id: If1f5d8b5afc76fac62fdf9836a17c4ab87ddc1b1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-03 15:56:08 +01:00
Joerg Bornemann
3d6c86ec57 pro2cmake: Fix static type errors in condition_simplifier_cache.py
Mypy reported the following:

condition_simplifier_cache.py:111: error: Argument 1 has incompatible type "*List[str]"; expected
"Optional[float]"
            file_handle = file_open_func(*file_open_args, **file_open_kwargs)
                                          ^
condition_simplifier_cache.py:111: error: Argument 2 has incompatible type "**Dict[str, object]";
expected "Union[str, Path]"
            file_handle = file_open_func(*file_open_args, **file_open_kwargs)

Fix by calling portalocker.Lock directly.

Change-Id: I538319791b1a4a1b6dffac0544d87c705e8809a7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-03 15:56:08 +01:00
Clemens Werther
5495eb9ec2 Fix off-by-one for "typically" lowest value INT_MIN
Pick-to: 6.3 6.2 5.15
Change-Id: I0e1115dc21e700dc79fb54be953573c75b41e70f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-03-03 09:54:07 +01:00
Lorn Potter
66a76a5def wasm: enable mobile native keyboarding
This works on iOS and Android, and Windows with touchscreen.

On Android, we need to listen to the input event
of a hidden text element and synthesize Qt keyboard
events from that in order to get input events into Qt.

On Windows, we need to be more creative about bringing the native
virtual keyboard up.

Because the entire canvas is contenteditable, we need to specify the
inputmode is set to 'none', otherwise the v keyboard pops up
when user clicks anywhere on the canvas. Therefore we set a hidden
element as contenteditable, which pops up keyboard when Qt
needs it for editable widgets. On Android, this is the same
element that is used to proxy the keyboard input.

[ChangeLog][wasm] Add support for native mobile keyboard

Done-with: Morten Johan Sørvig <morten.sorvig@qt.io>
Fixes: QTBUG-83064
Fixes: QTBUG-88803
Change-Id: I769fe344fc10c17971bd1c0a603501040fe82653
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-03-03 12:30:59 +10:00
Marc Mutz
6f5c78fe3d QFlatMap: add remove_if
The existing API of QFlatMap did not allow efficient removal of
elements:

- std::remove_if does not apply, because it works by moving elements
  back in the range onto those that need to be removed, which doesn't
  work in flat_map's case, because, like for all associative
  containers, the key in value_type is const.

- The node-based erase-loop (over it = cond ? c.erase(it) :
  std::next(it)) works, but, unlike in traditional associative
  containers, is quadratic, because flat_map::erase is a linear
  operation.

According to Stepanov's principle of Efficient Computational Basis
(Elements of Programming, Section 1.4), we're therefore missing API.

Add it.

I couldn't make up my mind about the calling convention for the
predicate and, despite having authored a merged paper about erase_if,
can never remember what the predicate is supposed to take, so be fancy
and accept all: (*it), (it.key(), it.value()), (it.key()). This means
that unary predicates can either not be generic or must be properly
constrained to distinguish between pair<const K, V> and K, but that's
not necessarily a bad thing.

There's no reason to supply a Qt-ified removeIf on top of the standard
name, because this is private API and doubling the names would do
nothing except double the testing overhead.

Fixes: QTBUG-100983
Change-Id: I12545058958fc5d620baa770f92193c8de8b2d26
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-03 00:25:14 +01:00
Marc Mutz
b2c7f17b94 tst_qflags: don't suppress deprecation warnings
... if there aren't any.

Pick-to: 6.3
Change-Id: I8531e0c1c3ca41d1b1a9d55c9d11782bd63b6f76
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-03 00:18:39 +01:00
Sona Kurazyan
e4aa4d4f3d Add compile-time checks for QLatin1String
Change-Id: If1b10a857275fb53c5d0b230bf6d11ce3e1ff2ca
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-02 22:22:36 +01:00
Sona Kurazyan
62c7145390 Fix QLatin1String(const char *) constructor to be constexpr
strlen() is not constexpr, use the QByteArrayView's
lengthHelperPointer() instead.

Change-Id: Ie49236edba3306e951402e6b776c15068cac0332
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-02 22:22:36 +01:00
Sona Kurazyan
736213bf66 QLatin1String: add missing APIs for compatibility with Qt string views
As a drive-by, fixed misleading wording used in docs.

[ChangeLog][QtCore][Potentially Source-Incompatible Changes][QLatin1String]
Added QLatin1String(std::nullptr_t) constructor, which makes
QLatin1String(0) call ambiguous. To fix the ambiguity, nullptr
must be passed instead of 0.

Task-number: QTBUG-98433
Change-Id: I2b888aa23469343d78aa640dc39a6028b77165dd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-02 22:22:36 +01:00
David Skoland
0e64165c2e Close WASM popups on non-accepted clicks
Generally, all clicks that weren't in a window or weren't handled
should trigger a closing of all popups.

Fixes: QTBUG-90990
Pick-to: 6.3 6.2
Change-Id: I40e6351b265e95e0570e7c5d42f3d5b222538453
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-03-02 22:22:36 +01:00
Giuseppe D'Angelo
44eff8f39f Fix Q_FLAG declaration over enumerations
One should use Q_ENUM, not Q_FLAG, to mark an enumeration.
Q_FLAG should go on the respective flag type.

Change-Id: I16cd5c0d405c3db1951569b72805fdae18898c45
Pick-to: 5.15 6.2 6.3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-02 19:45:12 +01:00
Giuseppe D'Angelo
52e523c33f Qt namespace: fix Q_FLAG_NS declaration for Qt::MouseEventFlags
The declaration was accidentally declaring the enumeration as
a flag type, not the actual flag type.

Change-Id: I515478b1628a6d72626da6d7e0061f1ea3d10c89
Pick-to: 6.3 6.2 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-02 19:45:11 +01:00
Alexey Edelev
8b5eb6cd09 Add the missing --no-zstd option to the manual rcc calls
Add the missing --no-zstd argument when generating resource artifacts
using binary or big resources or an existing .qrc file.

Task-number: QTBUG-101353
Change-Id: If930f0cb7ba3c89b21b01552aefd6c0e33fe5cb3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-03-02 17:58:07 +01:00
Eirik Aavitsland
03b9304703 Update bundled libjpeg-turbo to version 2.1.3
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.1.3

Pick-to: 6.3 6.2 5.15
Change-Id: I69ebd10641b07af324f6ae056cddb65cc0b5ce82
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-03-02 17:58:07 +01:00
Marc Mutz
ea3a7aaf2b QTest: fix QCOMPARE with QT_TYPESAFE_FLAGS
Amends 631a0cc45c.

Pick-to: 6.3
Fixes: QTBUG-101299
Change-Id: Ib17e405de4db9fb592aba4ea842d3768a95cad74
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-03-02 15:38:27 +00:00
Liang Qi
586fd9e034 tests: XFAIL a few in tst_QStaticText on Wayland
Task-number: QTBUG-100982
Pick-to: 6.3 6.2
Change-Id: I18cdb79d9261bac40cc619f9d327d0ef7ed722c4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-02 15:37:33 +01:00
Liang Qi
e49d2daf19 tests: XFAIL tst_QOpenGL::bufferMapRange() on Wayland
Task-number: QTBUG-100918
Pick-to: 6.3 6.2
Change-Id: I1b892a80bcb44e0e4f658ed7073c54900d8a358c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-02 15:37:33 +01:00
Liang Qi
2b3d11383e tests: XFAIL tst_QImageReader::setScaledClipRect() SVG/SVGZ
on Wayland

Task-number: QTBUG-100917
Pick-to: 6.3 6.2
Change-Id: I66c42bb0ceca83fd0531159c606d22c58b18b371
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-02 15:37:32 +01:00
Tor Arne Vestbø
745893997a macOS: Remove code for handling logical DPI changes
The logical (base) DPI is always 72 on macOS.

Pick-to: 6.3
Change-Id: Ibf9894fdc78d2af2d9949b29dd19ae9e8f2201c7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-03-02 14:58:10 +01:00
Eirik Aavitsland
423b650938 Fix painting clipping glitches with fractional scaling
In QPainter, clipping can only be done on whole pixels. The various
ways of specifying a clipping rectangle to the QPainter API have been
inconsistent in how fractional rectangles (either specified directly,
or as a result of fractional scaling) are mapped (rounded) to integer
coordinates.

Also, the mappings have not made sure to keep the edge-to-edge
property of clip rects under scaling. This is particularly important
when scaling QRegions with multiple rects, as QRegion is designed on
the assumption that an area can be described as a set of edge-to-edge
rects.

The fix rounds a clip rect identically with a fill rect. (Indeed, a
followup plan would be to merge QRasterPaintEngine's
toNormalizedFillRect() with the rectangle rounding function in this
commit).

Notably, a QRectF clip is now interpreted the same as a QPainterPath
clip describing the same area.

This modifies d9cc149995

Task-number: QTBUG-100329
Fixes: QTBUG-95957
Task-number: QTBUG-100343
Pick-to: 6.3
Change-Id: Iaae6464b9b17f8bf3adc69007f6ef8d623bf2c80
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-02 13:58:10 +00:00
Robert Löhning
27fae7207f png/ico decoder: Don't try reading beyond the file
This fixes oss-fuzz issue 44955.

Pick-to: 6.2 6.3
Change-Id: Ie74ae037630f83e64fd0678ff2eac579f35d02b8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-03-02 14:58:10 +01:00
Samuel Mira
38a86afcc4 Tidy up QTest::FatalSignalHandler
Rename some variables: avoid abbreviated names.
(Don't bother with renaming variables an imminent commit removes, though.)

Pick-to: 6.2 6.3
Change-Id: I3bd11f37ca687047555d43dff83c3c2f935135d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-02 14:58:10 +01:00
Edward Welbourne
fcecaf53f5 Adapt QTest::FatalSignalHandler() to support sa_sigaction when available
We don't currently have a use for the extra parameters, but Samuel
Mira's fix to ensure we don't miss fatal signals on Android needs to
be able to call the prior handler, which may need these parameters.

In the process, check returns from sigaction() and use its nullptr
semantics to query first when detecting whether to restore the default
when done, rather than setting and then restoring if it turns out
we've been replaced in the meantime.

Task-number: QTBUG-97652
Pick-to: 6.2 6.3
Change-Id: If30a0db35946c3dceb409ae3f41aa437149472e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-02 14:58:10 +01:00
Mårten Nordheim
6782a37bb5 Gradle: Update to 7.4
Pick-to: 6.3
Fixes: QTBUG-100989
Change-Id: I7978afc18a51b58ea95e4fb94328c4f98bb12486
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-03-02 14:55:01 +01:00
Eike Ziller
745c1f584d MIME providers: Make provider implementations final
We do not derive from them, and making QMimeXMLProvider final
avoids a warning about calling a virtual function from the
constructor.

Change-Id: I565c63eb555fabb3c98e7d284b54037b7a7194da
Reviewed-by: David Faure <david.faure@kdab.com>
2022-03-02 14:55:01 +01:00
Andreas Buhr
5a8052f9c1 Activate tst_qxmlstream for Android
tst_qxmlstream was disabled because it crashed. It does not any more.
But it extracted an input zip archive in-place, which is not
possible on Android. To resolve this, input files are
copied to a temporary directory first.
Also, input directories were given to rcc. rcc has a problem
with recursive directories. To circumvent this,
the file list is created in CMake and then given to rcc.

Task-number: QTBUG-87671
Pick-to: 6.2 6.3
Change-Id: I88bb823b9e5c085404e263d4a648d65c9cd6024c
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-03-02 14:55:00 +01:00