Commit Graph

41034 Commits

Author SHA1 Message Date
Tor Arne Vestbø
d0ce9886f1 QFontDatabase: Remove un-needed load() function
The function didn't take any of the arguments into account, and was
just initializing the font database, which all but one of the call
sites were already doing.

Change-Id: I83cab0059014dd256ec4b453e15fc2fe4bebcbdf
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2022-03-31 20:12:54 +01:00
Tor Arne Vestbø
a08e15cda1 QFontDatabase: Centralize initialization in ensureFontDatabase()
Instead of having multiple code paths call initializeDb(), we use the
already existing ensureFontDatabase() to provide the central point of
ensuring an initialized font database.

A couple of locks for the fontDatabaseMutex was added since the
ensureFontDatabase() function documents that as a requirement for
calling the function, but these locks were presumably already needed
as the original code paths accessed the database in the same way.

Change-Id: I5e29a069c4c7f68902dbe0c6c949a168d54f5f0e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2022-03-31 20:12:54 +01:00
Tor Arne Vestbø
c256bede99 QFontDatabase: Replace privateDb Q_GLOBAL_STATIC with instance() accessor
The use of both a global static and a dedicated instance() function made
it harder to know how and where the singleton font database was managed.

As Q_GLOBAL_STATIC is no longer needed (as of C++11) for ensuring thread
safe access we can contain the QFontDatabasePrivate singleton within
the instance() accessor.

Change-Id: Ia3d83ff2d83d326504243258a44d8ae8352d290d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-03-31 20:12:54 +01:00
Tor Arne Vestbø
4a3a6ef40c QFontDatabase: Remove unused createDatabase() function
Last uses was removed in 76068d0114.

Pick-to: 6.2 6.3
Change-Id: I8e1f404d2422e0f11dc28e52ce6dafa77e148126
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-03-31 20:12:54 +01:00
Topi Reinio
5578b47092 Doc: QMap: Add ref-qualifiers to \fn signatures for toStd[Multi]Map()
Because of a bug in QDoc there was never a warning reported for the
missing qualifiers.

Pick-to: 6.3
Task-number: QTBUG-101461
Change-Id: Ibb9114bc5d29e75158d2ac254169ba2a73043f0d
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
2022-03-31 18:23:27 +01:00
Thiago Macieira
867fee2c15 Doc: QThread: clarify that start() always creates the event dispatcher
Fixes: QTBUG-101283
Pick-to: 6.2 6.3
Change-Id: Ibf4acec0f166495998f7fffd16d6e4692be24409
Reviewed-by: Keith Kyzivat <keith.kyzivat@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-31 08:47:17 -08:00
Morten Johan Sørvig
4ff5a571b3 wasm: Support non-canvas container elements
Support specifying that Qt should use a div element
as the root container, in which case canvas management
is moved to Qt C++ code.

This enables us to take ownership of the canvas and its
configuration. In addition, it allows creating child
elements for the Qt container (canvas element children
have a special role are as fallback elements displayed
in case the browser can’t show the canvas)

Remove support for reading Module.canvas, which was
deprecated in Qt 5.

Add support for reading Module.qtContainerElements,
which can be either a canvas element (legacy) or a
div element (preferred).

Deprecate qtCanvasElements and print warning on usage.

Change QWasmScreen to accept either a canvas or any
html element. In the latter case, create the canvas
and configure it as required by Qt.

Change-Id: I57df8fb5772b2bfbba081af3f572b8b0e7d51897
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-31 18:47:17 +02:00
Edward Welbourne
aa4a2bb1e1 MS QNativeFilePermissions: fix unused member and capture warnings
Two members are only used in code that's conditioned on pseudo-feature
fslibs, which was defined in qfilesystemengine_win.cpp; move that
definition to qfiledevice_p.h so that the members's existence can be
conditioned on the same #if-ery as their use. The bootstrap build was
broken by the warning.

In the code that uses them, a lambda captured this but didn't use it,
causing the non-bootstrap build to get a warning (hence error) and
fail. So remove the unnecessary capture. Also suppressed warnings on
an unused function.

This amends commit 174af05400

Pick-to: 6.3
Task-number: QTBUG-79750
Change-Id: Ib29f3200b7736bc07df68aeec4fc6f568c8f4ddb
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2022-03-31 16:42:47 +01:00
Tor Arne Vestbø
64dd5a8183 CoreText: Avoid populating font family aliases if family was populated
When trying to match a font request to fonts in the database we might
end up with a mismatch due to the style not being available, but the
font family itself was.

If that's the case there's no point in trying to populate font aliases.

Fixes: QTBUG-98369
Fixes: QTBUG-99216
Pick-to: 6.3 6.2 5.15
Change-Id: I8776e5b89588a13749c9c7e414c5bfac86feab58
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-03-31 17:42:47 +02:00
Qt CI Bot
c168edba21 Merge integration refs/builds/qtci/dev/1648720546 2022-03-31 14:02:01 +00:00
André de la Rocha
4114a0ea75 Windows QPA: Fix slowdown with large table/tree views with accessibility
The accessibility code for notifying focus changes related to a
table/tree view was iterating over all items to find the focused one,
which for a very large number of items could cause a major slowdown
and UI freeze. This patch avoids the issue by removing the loop and
implementing the focusChild() method in the table/tree accessibility
classes.

Fixes: QTBUG-100997
Pick-to: 6.2 6.3 5.15
Change-Id: I04c847a5e65223b7a93ab82363feb32e1ebab9f3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-31 09:04:09 -03:00
André de la Rocha
350a75f792 Windows QPA: Avoid sending accessibility notifications before activation
When accessibility was activated after the application startup, it would
send state update notifications for every accessible object, which for a
large number of objects could result in a flood of UI Automation
notifications and UI slowdown. This patch ignores these notifications
until QAccessible is activated, which should avoid the slowdown and
seems to cause no side effects with accessibility tools.

Fixes: QTBUG-95114
Pick-to: 6.2 6.3 5.15
Change-Id: If1495d0aa846d7810b3d297b7e156563a7e5f6e6
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2022-03-31 09:04:08 -03:00
André de la Rocha
bcd0a32203 Windows QPA: Avoid slowdown with UI Automation name change notification
A previous fix for QTBUG-70621, which allowed changes in the state of a
Quick combo box control to be detected by accessibility clients has
reportedly caused significant slowdowns under some difficult to reproduce
circumstances, probably associated with a large number of accessible
objects. This patch restricts the name change notification to combo
boxes, which seem to be the only kind of control requiring them for
accessibility, instead of sending it for all control types.

Fixes: QTBUG-97103
Pick-to: 6.2 6.3 5.15
Change-Id: I18c0067478df5a80f7365195d3559b3f04faa815
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2022-03-31 09:04:08 -03:00
Tatiana Borisova
64fc50e309 CMake uses Desktop tslib for INTEGRITY configuration by mistake
IGY doesn't provide tslib backend. QT_FEATURE_tslib should be OFF.

Task-number: QTBUG-102121
Pick-to: 6.2 6.3
Change-Id: Id6417b92864312f6437c773a472aff8517b6e5dc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-31 13:48:54 +03:00
Mårten Nordheim
8367be8ede QNetworkInformation: Deprecate vague load functions
And replace them with more descriptive versions

Change-Id: I3d5256072a5bbe0919a08b800877aa9b6a305a0b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-03-31 11:54:42 +02:00
André Klitzing
a0a2bf2d95 Update bundled zlib to version 1.2.12
The remaining diff to clean 1.2.12 is archived in the qtpatches.diff file.
Also this fixes CVE-2018-25032.

[ChangeLog][Third-Party Code] zlib was updated to version 1.2.12.

Change-Id: Ifab5d57acdc90ace61f2fd22c6dbb7ec6b4ad319
Pick-to: 6.2 6.3 6.3.0 5.15
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-03-31 08:43:56 +02:00
Alexey Edelev
2eb7a92aa3 Android: Throw an error if project uses versioned shared library
Android internally cannot handle versioned shared libraries.
There is no explicit rule for that, but indirect signs point to this.
This adds an explicit error to androiddeployqt to give the clear
understanding of the error nature to user. Error is also thrown if
versioned library was used when linking Qt libraries.

E.g. when linking Qt with liba.so it might be symlink to liba.so.1.0
This means that liba.so.1.0 Qt will require liba.so.1.0 at runtime.
But since Android doesn't handle versioned shared libraries,
liba.so.1.0 will never be packaged correctly. Most build systems
support generating of versionless shared libraries, and this should
be used when building 3rdparty libraries for Android.

Task-number: QTBUG-101346
Change-Id: Ic49d1a0d7d3a4c5c0dc308a570e98e8a0a223053
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-30 22:55:59 +02:00
Edward Welbourne
657cc31b8a QSettings: use auto rather than naming iterator types
Not always possible, but avoid the noise where we can.

Change-Id: I4a37cc3e806b1b9d696647aca7303b30e36b471b
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-03-30 21:37:24 +02:00
Edward Welbourne
4fa60c1736 QSettings: s/int/qsizetype/ on the internals
Can't change the public API, but we can at least change the internals
to use the right type, ready for when we do. Also changed some C-style
casts to function-style, even when the type remains int; renamed an
inner loop variable to avoid shadowing an outer; and changed a use of
count() to size().

Change-Id: Id52ce0a2f0177bf1d6dfbd45a592a45afcddf9b4
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-03-30 21:37:24 +02:00
Edward Welbourne
605c747321 QSettingsPrivate: fold from/to parameters into the view they bound
Two methods of the private class used to take a QByteArray with from
and to indices into it, for where to start and stop a scan. Now that
they take a QByteArrayView, those parameters can be used by the caller
to shorten the view to the desired portion.

Change-Id: Id1586afb87a9e8a189b69e485278375ff504fb7b
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-03-30 21:37:24 +02:00
Edward Welbourne
08d20ee850 Use QByteArrayView more in QConfFileSettingsPrivate's methods
Avoid allocating QBA methods when the QBAV methods can do just as
well, especially where the QBA was already being QBAV-wrapped to avoid
such allocations.

Change-Id: I180c2316362685ffda613bab2c761e72c4483fce
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-30 21:37:24 +02:00
Edward Welbourne
b4d003c77f Prefer sliced()/first()/chopped() to mid() and arithmetic
The newer methods bypass checking and make it clearer what's
happening. They're also available on QBAV, unlike mid().

Change-Id: Ie0375888b889e393b91814ba80529d1a7227eb7f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-30 21:37:24 +02:00
Tor Arne Vestbø
3188615db6 iOS: Handle changes in user font preferences by invalidating font database
The user may tweak the appearance of text rendering on iOS to aid a11y,
by making the text larger or smaller, or bold. This feature, known as
Dynamic Type, will be reflected in the preferred content size category
of the application.

When we detect changes in this preferred content size category we respond
by invalidating the font database, which will trigger the application
to re-evaluate the sizes and weights of the theme fonts.

Unfortunately we do not currently pick up or propagate the scaled font
metrics when an explicit point or pixel size has been set on a QFont,
but this problem exists regardless of whether we dynamically handle
changes to dynamic types or only pick them up after an application
restart.

Change-Id: I8c722d0bfb4b76eade47ebfb6512e6676a910d6a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-03-30 19:55:21 +01:00
Tor Arne Vestbø
d84018616a macOS: Handle changes in the available fonts by invalidating font database
The user may use the Font Book application to add or remove fonts,
which affects the fonts that are available to Qt applications.

As the cross platform QFontDatabase implementation currently doesn't
support granular management (removal) of fonts, we need to invalidate
the entire font database.

Since the theme fonts on macOS (and iOS) are managed by the font
database we also need to invalidate the theme fonts, and report this
back to the application.

Change-Id: I1f6a7900f76e0b6a1f059bd43638a04bc0808e20
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-30 19:55:21 +01:00
Tor Arne Vestbø
c7280b3362 CoreText: Populate all variants of theme/system fonts
We populate the various QPlatformTheme::Fonts by asking the system for
the preferred font for each use-case, but that just gives us a single
font descriptor with a single style and weight. If the user then tweaks
the font by e.g. making it bold or italic, our font database will not
have any knowledge of these variants, and will fall back to another
font.

To fix this we ask CoreText for all variants of each of the theme fonts,
so that each of the theme font families are fully populated.

The preferred way to do this on macOS 10.15/iOS 13 and above is by using
the font's UI design trait. This avoids asking CoreText for private
fonts by family name directly, which is not supported and may result
in giving us Times or another fallback font instead.

Pick-to: 6.2 6.3
Change-Id: I4aa21624df62ac09a92d7ae0bc2cdde4f6ad6e5f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-03-30 19:55:21 +01:00
Tor Arne Vestbø
a068f2d7c9 CoreText: Add note about why we defer population of theme font descriptors
Pick-to: 6.2 6.3
Change-Id: I7018a92467c6db1b9d04b88e50113ba9c9d1a3b7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-03-30 19:55:21 +01:00
Tor Arne Vestbø
741a4987b8 CoreText: Reuse descriptorForFamily helper function in populateFamily
Pick-to: 6.2 6.3
Change-Id: I2c1098309fc994fb7a131564679299a2e850870a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-03-30 19:55:20 +01:00
Tor Arne Vestbø
1ab928c7f6 CoreText: Make population of theme fonts explicit
Pick-to: 6.2 6.3
Change-Id: I95e6b535e8ec98ca13c9a58f1e4ae4358ed9f028
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-03-30 19:55:20 +01:00
Yuhang Zhao
c8ca0e7070 Fix build with clang-cl
qtbase\src\corelib\global\qglobal.cpp(3510,21): error: call to member function 'endsWith' is ambiguous

Change-Id: I2b20077584a33ca5f40efdf397b5913afd6e7fae
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-31 01:05:59 +08:00
Tor Arne Vestbø
344e0e7141 Revert "Avoid populating font family aliases if family matched"
This reverts commit 69d525a6fa.

The change introduced behavior changes on Windows, where family
aliases are used to build a full set of styles for a family.

Change-Id: I64ca1cf5febf0a6277cbe0a0041ccdb76da72196
Pick-to: 6.3 6.2 5.15
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-03-29 23:26:37 +00:00
Edward Welbourne
0bdc7322d9 Tidy up QTapTestLogger::addIncident()'s regex parsing
It had some repetition that could be refactored out, some long lines
and a bool it worked out the hard way, when it had previously
determined the answer in passing without recording it.

Change-Id: I9e53ed087dfbe8067686b27b6cf9ac32040fbf19
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-29 22:21:58 +02:00
Edward Welbourne
784f5d76b9 TAP test logger: report B?XFAIL (mostly) as a message
Previously, only the first B?XFAIL would be reported, all others would
be discarded. Furthermore, if a B?XFAIL had happened, B?PASS was also
not reported, since the B?XFAIL served as test line. However, if the
B?XFAIL was followed by a SKIP, B?XPASS or B?FAIL, these were reported
as normal, producing exactly the kind of duplicated test line that the
skipping of B?PASS was meant to supply.

So change B?XFAIL to be reported among the messages, but retain the
TODO annotation of the first on the test line of a subsequent B?PASS,
if nothing more drastic happens in the mean time. So now more than one
B?XFAIL can be reported, the test is still marked as a TODO and we
don't get duplicate test lines for a subsequent non-passing result.

This replaces the bool m_wasExpectedFail member with a QTestCharBuffer
m_firstExpectedFail that records the first XFAIL's TODO line (so its
isEmpty() fully replaces m_wasExpectedFail).

Previously, the at/file/line information for a B?XFail would be
supplied as top-level keys in the YAML block for a "Pass" reported as
not ok due to the XFail, as this location information is now part of
the B?XFail's message in the extensions/messages block. Duplicating
the first B?XFail's location at top level would add complexity and is
arguably misleading, as the test result is really a pass (after
ignoring known issues), and the location of the pass is indeterminate
(nominally the end of the test function, but actually also after the
cleanup() call for this test, when relevant), which is why a Pass has
no location information.

Task-number: QTBUG-96844
Change-Id: Ib3f24f56266ff49bf3bc9759ac8263ac69a62130
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-29 22:21:58 +02:00
Edward Welbourne
ac38401d31 Move TAP's messages block to after the primary report details
In the process, split it from its comments block and don't bother with
a YAML block if it would only have contained comments.

Task-number: QTBUG-96844
Change-Id: I08c20f796252bb270ba9caa4c055cdcc0843a88b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-29 22:21:58 +02:00
Edward Welbourne
299186602a Add a test and remove a work-around for a fixed bug
The ASN.1 parser for a date-time had to check the date-time string was
all digits to catch the case of a sign in the month field, which used
to be accepted when it should not be. That bug has now been fixed, so
remove the work-around and add a second date-time test-case, renaming
(and modernising) the existing one for consistency.

Task-number: QTBUG-84349
Change-Id: I649c5129312b6865af08b22ba6893cb4e29243f8
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-03-29 22:21:57 +02:00
Doris Verria
1b6874034a Implement QPlatformTheme::appearance() for iOS
Implement support for detecting Light/Dark mode on iOS. This is needed
by the QQuickIOSStyle in order to display the proper image assets
according to the theme.

A further improvement would be to react to theme changes dynamically.

Change-Id: I95e11c4a4b647614bdd78d734941d2b11546687a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-29 18:10:37 +00:00
Laszlo Agocs
a86ee60887 Fix heap-use-after-free with rhi-based backingstore
Task-number: QTBUG-102030
Change-Id: I6b05007c6ae3d653197c5680b9fc5768b0e3690f
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
2022-03-29 17:53:24 +02:00
Laszlo Agocs
7e4c2ac711 Query the QWindow in every test iteration in qWFWExposed(QWidget)
Task-number: QTBUG-102030
Change-Id: Ic8aee76570a000709b480ffbe19335518e3f7a7e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-03-29 17:53:24 +02:00
Laszlo Agocs
2ca50df11c Fix up some QMatrix4x4 docs
The deprecation note for one of the operator* is wrong: Using
mapVector() is never the right choice given the deprecated operator*
itself is implemented by calling map(). It could be that in some cases
the results are identical so one can get away with migrating to
mapVector(), but this is incorrect in other cases and causes
regressions all over the place. Thus we should only recommend using
map() instead, never mapVector(). As shown by recent experiences, the
current docs are insufficient/wrong and caused a number of regressions
in the Qt code base as well.

Also enhance some related docs. It could be that the wording is not
always academically correct, however having some additional notes in
there help make it obvious to the reader (or at least raise some
alarms) that there are important differences between map and
mapVector.

Also improve the note for the other deprecated operator*. There is
only one way to convert to a vec4, given the existing implementation
of the operator, and that is by using 1 for w. Make this clear to the
reader.

Pick-to: 6.3 6.2
Change-Id: I1d8dbca44fdc103ab62d49bfc1d4ce37a9bc130b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-03-29 16:53:24 +01:00
Mårten Nordheim
4c4afb6e8d qfilesystemengine_win: Fix compilation with namespaces
The original using is outside QT_NAMESPACE, so it is
not correctly picked up by various parts of the code.
Simply moving it inside QT_(BEGIN|END)_NAMESPACE revealed
that the namespace (and thus scope) is closed and re-opened.
in the file, so fix that too.

Change-Id: I704f164b5705b539dbdf25b7743f5e339c016600
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-03-29 14:34:57 +00:00
Tor Arne Vestbø
a1d74b0618 Update mapping between Apple Clang versions and upstream Clang
We can not trust __clang_major__ and __clang_minor__ for Apple Clang,
but we still want a single Q_CC_CLANG define that can be used to check
the Clang version.

Pick-to: 6.3 6.2
Fixes: QTBUG-99020
Change-Id: I5128c1ff40d1ef1afeaab3c7fa4988a5bb170742
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-03-29 13:35:24 +00:00
Joerg Bornemann
60c70e4eff Doc: Document QT_NO_[SIGNALS_SLOTS_]KEYWORDS defines
Pick-to: 6.2 6.3
Fixes: QTBUG-70564
Change-Id: I8ed1a30567dabdcb95cdfce009f1d9e0645d3226
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-29 14:56:15 +02:00
Friedemann Kleint
0cdb44f01f Windows: Fix potential crash when retrieving default printer
GetDefaultPrinter() has been observed to return size == 0.

Pick-to: 6.3 6.2 5.15
Fixes: QTBUG-53290
Change-Id: Id4c7a06d14d368c792e15e55cacf2366b6aedc7b
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2022-03-29 13:56:14 +01:00
Ivan Solovev
d85c6527b5 Android: fix fullscreen handling
Commit a35a7fcb5a introduced the usage
of insets to correctly take into account the default Android status bars
and other reserved regions.

However in practice that does not work as expected - the bottom inset
is always reported to be non-zero, even when fullscreen mode is enabled.
To fix the issue, FLAG_FULLSCREEN is explicitly checked before applying
the insets.

Fixes: QTBUG-99624
Pick-to: 6.3 6.2
Change-Id: I8b25f0b06447cd452c42ef072493e3137e25f38b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-03-29 13:56:14 +01:00
Ivan Solovev
3c5b3a36af Introduce QTestPrivate::androidCompatibleShow() helper function
This function should be used in QWidget-related test cases instead of
QWidget::show() when you need to move or resize the widget and then
compare its position or geometry with the expected value.
The reason for introducing it is that on Android QWidget::show() is
showing the widget maximized by default, so its position and size
can't be changed.

Task-number: QTBUG-87668
Pick-to: 6.3 6.2
Change-Id: I8ec5c07b73968b98d924a41e5d41ddb4d7be1ced
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-29 13:56:14 +01:00
Morten Johan Sørvig
942de89562 Fix high-dpi and QScreen state initialization
Fix bug where QScreen::geometry() returns incorrect
(unscaled) geometry.

We maintain state:

  - QHighDpiScaling::m_active, which is set to true
    if any screen in QGuiApplication::screens() has a
    scale factor > 1, in updateHighDpiScaling()
  - QScreen::m_geometry, which is assigned the scaled
    screen size in QScreenPrivate::updateHighDpi()

Now the problem is that updateHighDpiScaling() requires
an up-to date screens list, and that updateHighDpi()
requires an up-to date m_active, and that currently
updateHighDpi() is called when constructing the QScreen
only.

This is all a bit unsatisfactory, but for now fix this
in the simplest way by adding a second call to
updateHighDpi() in handleScreenAdded(), after the call
to updateHighDpiScaling().

Pick-to: 6.2 6.3
Fixes-number: QTBUG-101601
Change-Id: I5f442ceb966c77d6746ee885203b67da96612587
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-29 12:35:50 +00:00
Marc Mutz
32692667a6 Apply Q_CONSTINIT across the codebase
Still not complete. Just grepping for static and thread_local.

Task-number: QTBUG-100486
Change-Id: I90ca14e8db3a95590ecde5f89924cf6fcc9755a3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-29 06:18:49 +01:00
Edward Welbourne
7d60fde9a7 Include file and line information in TAP diagnostics blocks
When producing a diagnostics block, include the file and line
information, if we have it, to describe it. This presently only adds
this information for skip, but could in principle do the same for a
B?XPass.

Task-number: QTBUG-96844
Change-Id: I6cc375d98e2369eba262010f9c2dfbcba931a6f1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-29 00:05:12 +01:00
Edward Welbourne
ae37fa0464 TAP test logger: move messages into the diagnostics block
Our TAP output was delivering messages as comments before the test
line, where TAP clearly expects the details of a test to follow its
test line. Version 13 provides a YAML block to deliver diagnostics and
encourages use of this, so accumulate our messages in a
QTestCharBuffer instead of emitting them one by one.

However, messages produced after a test has produced its test line
belong to that test, but are too late to be included in its
diagnostics block, so should be emitted immediately as before, albeit
now with a type prefix. This at least separates such messages, from
the end of one test, from messages produced early in the next.

In the process, add a type-prefix to each, to make clear what type of
message it was. Since the Yamlish supported by TAP consumers doesn't
support a way to have many messages, use the extensions: top-level
hash tag with a messages: sub-tag to gather our messages as a list.
(This expands at least one expected output file significantly and
substantially rewrites some others.)

Add methods to QTestCharBuffer, and a helper function, to support this.

Task-number: QTBUG-96844
Change-Id: If44a33da5879ed1670ef0980042599afd516f9d2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-29 00:05:12 +01:00
Mike Achtelik
c6f323f4d4 iOS A11Y: Do not add children of invisible parent
Prevent children from invisible parents from showing up in the a11y
hierarchy. This fixes a problem on iOS which e.g. always adds hyperlink
children of QML Text items, even if the Item itself is invisible.

Pick-to: 6.3 6.2
Change-Id: I88a6f08956b5fe78cb789a08f2078f96d7aa263c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-28 22:22:31 +02:00
Sze Howe Koh
f32e28db18 QTableView: Document the customizations applied to QHeaderView
These are non-default options which the user needs to manually set when
applying a custom QHeaderView.

Task-number: QTBUG-102034
Pick-to: 6.3 6.2 5.15
Change-Id: Ib3396f0a82c358c71a8501fc2d71158f725bc228
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2022-03-29 03:05:23 +08:00