Commit Graph

9493 Commits (252e3a1526dc01c5e5024a4ff4f4fb2e87fbc3d2)

Author SHA1 Message Date
Ilya Fedin 974a7bd6e0 FileChooser portal: set current_name
Fixes: QTBUG-100297
Pick-to: 6.3 6.2
Change-Id: I5d41e01aafeccce2d886debdb595b4c87b03a043
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-14 03:52:52 +04:00
Assam Boudjelthia 2da00bfc3a Android: Don't assert in add/removeWindow
No need to assert, returning when the window is already added or not
removed is enough.

Pick-to: 6.2 6.3
Fixes: QTBUG-100173
Change-Id: Id491f17612ce42c4e26e9d41ad38f0a6372775bd
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-04-12 18:21:02 +00:00
Assam Boudjelthia 0742e5770b Android: wrap QAndroidInputContext's m_focusObject in a QPointer
To make sure we don't end up use a dangling pointer for m_focusObject.

Pick-to: 6.2 6.3 5.15
Task-number: QTBUG-102447
Change-Id: I75058040be109a39f830bc706efe85969ffbc8ec
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-04-12 12:53:28 +03:00
Liang Qi 09e9f45933 xcb: get geometry correctly for rotation with RAndR 1.5
xcb_randr_get_crtc_info() returns already rotated size.

Pick-to: 6.3
Change-Id: I33eacf988b44cea77411ad79ae24fef7e8e1564e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-04-08 18:30:17 +00:00
Liang Qi 4609cc8631 xcb: compare with screen name instead of old monitor info
because the old xcb_randr_monitor_info_t was invalid very often
during update.

Pick-to: 6.3
Change-Id: I8c0bda93bde4e816fc98cde1a7205c6369ab39e1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-04-08 20:30:17 +02:00
Andreas Buhr f929756578 Fix crash in tst_qmltc_examples on Android
tst_qmltc_examples failed because m_accessibilityContext
could become a dangling pointer if the object in points to gets
deleted. This resulted in a crash.
Amends e0c61193ea.

Task-number: QTBUG-101865
Task-number: QTBUG-95764
Pick-to: 6.3 6.2 5.15
Change-Id: Ie85118429b1afa6e4a41f899ca065f493e166570
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-08 19:55:18 +02:00
Tor Arne Vestbø e702b64b34 macOS: Allow duplicate entries in file dialog name filter
Using QFileDialog::setMimeTypeFilters() with a list of mime types may
in some cases result in the same name for two different mime types,
for example both "image/heic" and "image/heif" will result in the
name "HEIF image (*.heic *.heif)".

When the resulting name filter is propagated to the platform layer,
we add entries to a NSPopUpButton, but the convenience API we used,
addItemWithTitle:, does not allow duplicates. As a result, the entries
in the menu didn't match the list of name filters we then looked up
and applied to the actual file name filtering, causing off by one
errors.

Ideally we'd make sure the name filters are unique and well formed
all the way from the QFileDialog to the platform and back, but for
now we work around issue by using the NSMenu API directly, which
does allow for duplicate entires.

Fixes: QTBUG-101361
Pick-to: 6.2 6.3
Change-Id: Iee3db4e6c5adfdbdd7f0094b4efd65aa2ecc0f57
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-04-07 14:05:04 +02:00
Tor Arne Vestbø 04837c1687 Don't blit individual rects of region when when scrolling backingstore
The QPlatformBackingStore::scroll() API takes a QRegion as input, but
we have no guarantee that the individual source and destination rects
of the region will not overlap each other when applying the scroll offset,
so we can't naively iterate the rects and call qt_scrollRectInImage for
each one.

The reason this didn't cause any issues in practice was that the QWidget
repaint manager was always passing in a single rect as the region.

On the other hand, the client has requested a scroll of the given
region, so it might assume any other part of the backing store is
preserved as is. Scrolling the bounding rect of the region violates
this assumption.

Amends 19ef76b0606621f189d3bc56549d200f2f5ebb25.

Pick-to: 6.2 6.3
Change-Id: I27934dd6685311c0b53ea2adb60fa5997e360f6c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-04-07 03:18:56 +02:00
Morten Johan Sørvig 08733dff58 wasm: use “specialHtmlTargets” for canvas lookup
We’d like to support use cases which require using
multiple html documents, for example when displaying
application content using more than one browser window.

Normally Emscripten uses the primary html document when
looking up elements by id, which means that targeting
elements on secondary documents is not possible.

Emscripten does provide a workaround: the application
can create custom id mappings to any html element on
the “specialHtmlTargets” object, and then use the
“!id” syntax instead of normal “#id” lookup.

Change-Id: I4dda920868cfbc6f8991425daf8933144c0ffad8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-04-05 22:34:44 +02:00
Tatiana Borisova 8116fdde1c Reorganize work with graphical libraries on INTEGRITY
- Currently we manually unpack all platform libraries,
  that are required for GUI apps, and pack it into single eglmegapack.a library.
  It could be better do not execute such additional step,
  but have possibility to add required graphical libs
  to cmake interface lib via toolchain file list variable.

Pick-to: 6.2 6.3
Change-Id: Ic4122600f02e6828d528ee4f00075f8c27f42e38
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-04-05 17:27:15 +03:00
Timur Pocheptsov 306f44a176 QCocoaTheme: use NSColor.controlAccentColor for QMenu items
The highligh color we have looks too different to what system menus
have. Accent color seems to be better matching this color, though
it's not really what we can see in menus, which are transparent and blend
with watever lies below them.

Fixes: QTBUG-75386
Change-Id: I03f66808eb885594862ad9b31398cae4ca186593
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-04-05 15:01:12 +02:00
Jarkko Koivikko 8bca441b6f Android: Fix deadlock caused by a race between permissions query and IM
Android permissions query blocks Qt main thread. If the input method
was activated before the permissions query started, android would try
to invoke input method before returning back to permissions query.
This will cause a deadlock.

Fix the issue by moving the deadlock counter to Qt core and
incrementing the value before the permissions query. This will prevent
the input method queries to enter Qt main thread.

Fixes: QTBUG-99484
Pick-to: 6.2 6.3 6.3.0
Change-Id: I54ea59578880cde4095c26fa2a6a264c4dc1b7ff
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-05 12:06:23 +03:00
Liang Qi 27efadec22 xcb: Correctly set physical size for screen with RandR 1.5
This amends 9a4c98e556.

Fixes: QTBUG-101038
Pick-to: 6.3
Change-Id: Ie75953af475dc606b34c3e274438075f20bdd8ae
Reviewed-by: Liang Qi <liang.qi@qt.io>
2022-04-04 17:48:14 +00:00
Assam Boudjelthia 90b928bad4 Android: minor code refactorings for QAndroidPlatformMessageDialogHelper
Change-Id: Ia42450a5c3ebc2f608bae599f03246464136ca06
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-04-01 21:11:35 +00:00
Assam Boudjelthia a7801fa325 Android: hide() in the QAndroidPlatformMessageDialogHelper destructor
The native dialog window is not being hidden or destroyed when the
QAndroidPlatformMessageDialogHelper object is destroyed. This makes
sure to not leave any native dialogs open.

Pick-to: 6.2 6.3 6.3.0
Task-number: QTBUG-97482
Fixes: QTBUG-101758
Change-Id: I2e50caebd286ea6abd3e948a4873dc3c971626a4
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-04-01 21:11:35 +00:00
Morten Johan Sørvig e4380b90ea wasm: rename “canvas” API to “container”
We now accept using div element as the root element
for application content, instead of a canvas. Rename
API and variables accordingly, where “container” covers
both the div and canvas cases.

Change-Id: Ibc2e096bcd5ca7e08609da348c53a404a4955c94
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-04-01 18:47:47 +00:00
Tor Arne Vestbø 919f514f29 macOS: Don't scroll individual rects of a region when inline scrolling
The QPlatformBackingStore::scroll() API takes a QRegion as input, and we
kept this data type in the implementation of QCALayerBackingStore::scroll
for the logic of figuring out whether we could use the existing back
buffer as source of the scroll or if we needed to pull data from the
front buffer.

We then iterated the rects of the resulting in-line region, and called
qt_scrollRectInImage for each of them. This will unfortunately not work
whenever the scroll of one of these rects ends up overwriting parts of
the back buffer that later rects of the region use as their source rect.

This could be reproduced by moving the cursor within a text document,
which would dirty a small area around the cursor, making the subsequent
scroll of the viewport result in garbled text.

This issue exists in the other platform backingstore implementations
too, but since the QWidgetRepaintManager never calls scroll() with
anything but a single rect they would not have any issues.

The problem could potentially be solved by sorting the rects before
blitting them, but now this quick fix solves the regression on macOS.

Fixes: QTBUG-102181
Pick-to: 6.2 6.3 6.3.0
Change-Id: I80f6d26117321e3c09e068cdb03eb320e244a5de
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-04-01 15:12:24 +00:00
Lorn Potter 2bf20e38b0 wasm: fix android input when fast typing
This fixes two issues:
When user fast types, more than one character would get sent sometimes.
Also, occasionally, 'Process' would appear along side of the typed
character.

Change-Id: I2ea3bfcbe987703bcbf298e0a0301bed6b8fccb3
Done-with: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Pick-to: 6.3
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-04-01 08:54:02 +10: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
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
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ø 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
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
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
Timur Pocheptsov 040643043b TLS backend (OpenSSL): add warning message
To make a failure to load libssl or libcrypto more obvious (so that,
for example, failing auto-tests are immediately correctly diagnosed).

Pick-to: 6.3 6.2
Change-Id: I2b1874cc6a04005d286382bb9cd28ee3681aa4e4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-28 21:05:22 +02:00
Mike Achtelik ec4c6e0acb Android A11Y: Add supported role infos to A11yNodeInfo
This allows the screen reader to pick up on them and give additional
info e.g. that text links which are now added automatically since
QTBUG-67878 are clickable.

Pick-to: 6.3 6.2 5.15
Change-Id: I96d8dd628d10b26b4c9ffee15dfa01a9abef61b1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-03-28 20:05:22 +01:00
Marc Mutz 80b6bcc385 Short live Q_CONSTINIT!
It expands to the first available of

- constinit (C++20)
- [[clang::require_constant_initialization]] (Clang)
- __constinit (GCC >= 10)

Use it around the code (on and near static QBasicAtomic; this patch
makes no attempt to find all statics in qtbase).

[ChangeLog][QtCore][QtGlobal] Added macro Q_CONSTINIT.

Fixes: QTBUG-100484
Change-Id: I11e0363a7acb3464476859d12ec7f94319d82be7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-26 17:15:02 +01:00
Jarkko Koivikko 1fefff6d1f Android: Keep the ParcelFileDescriptor open for content uris
Detaching fd and closing the ParcelFileDescriptor prevents IO with the
services like Google Drive on Android.

Instead, the file system should keep the ParcelFileDescriptor open while
the IO operations take place and close it manually. Also, prevent Qt
from closing the handle for us.

Pick-to: 6.2 6.3
Fixes: QTBUG-101996
Change-Id: Ie54c04ad5aa1e7ee5444a04c30ac1323f73047bb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-03-25 19:06:53 +02:00
Mike Achtelik 5677d79bf2 iOS A11Y: Set more accessibilityTraits
Set traits for roles that have a direct mapping between QAccessible::Role
and UIAccessibilityTraits. This allows the screen reader to pick up on
them and give additional info e.g. for links.

Pick-to: 6.3 6.2 5.15
Change-Id: I0f85e525fef390dcdf1ea664a0d325ce54f5b25b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-25 11:53:54 +01:00
Rafael Roquetto e555069151 QNX: remove mmrenderer overlay window support
QtMultimedia no longer supports overlay windows. The QNX multimedia
plugin now relies on the canonical rendering codepath via QVideoWindow.

Change-Id: Ic3bb14865f147a47200554e4791c191540e5bb75
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2022-03-24 09:42:03 +10:00
Tor Arne Vestbø ee15aa7482 CoreText: Maintain theme fonts in the font database instead of themes
The ownership of the fonts were handled in the iOS and macOS themes,
but the CoreText font database also kept a reference to these fonts.

As there was no way for the themes to reset the font database
references we could potentially end up in a situation where the
font database had stale references. And as the font database
would not rebuild the theme fonts once populated the themes
then would not be able to build a new list of theme fonts.

Moving the ownership to the font database makes semantics
and management of the fonts clearer.

Pick-to: 6.3 6.2
Change-Id: I61756abaf5487f28d520dfa1cf7a8ee2d716cce6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-03-23 20:14:18 +01:00
Eirik Aavitsland d0a299869b Jpeg handler: Detangle error reporting from the abort handling
If libjpeg has detected a fatal error, wait until after the longjmp to
report the error using qCWarning(), as some compilers don't like that
happening before the stack has been restored.
Also avoids code duplication.

Fixes: QTBUG-100821
Pick-to: 6.3 6.2
Change-Id: I8d0e6e1bcc4f2a85dae06b3879453ee9077288c0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2022-03-22 18:52:23 +01:00
Shawn Rutledge f0254ef50c qsql_ibase: fix includes
QMap was a transitive include, apparently; and we have mostly
standardized on specifying the module where each include comes from.

Change-Id: I1a54db879e744120f5b10eb0b16f8ba36cde8300
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-21 20:41:23 +01:00
Volker Hilsheimer 4ac00ca901 QTabBar: let styles draw tab text with foreground role
QTabBar::setTabTextColor's documentation and implementation suggests
that the set color will always be used unless invalid, and that the
foreground role is used otherwise. QTabBar then sets the foregroundRole
palette entry to the specified color before calling the style. The intent
is evidently that the tabTextColor is used no matter the foregroundRole
(which by default is the role that contrasts with the background role).

If the styles always paint the text with WindowText, then the tabTextColor
gets ignored if the foregroundRole is not WindowText (perhaps because
the backgroundRole is set to Base).

Fix this by respecting the widget's foregroundRole when painting the tab
label in the common style (which is the only style that implements
drawControl for CE_TabBarTabLabel). QMacStyle and QStyleSheetStyle
need to be adjusted to prepare the palette consistently with the logic
in QTabBar.

Pick-to: 6.3 6.2
Fixes: QTBUG-101456
Change-Id: I077a2034eebfe3f56cea28917494f4db01e48747
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-03-21 19:41:23 +00:00
Rafael Roquetto d15ef5bc3a QNX: always create buffers for child windows
The QNX raster backend worked on the assumption that child windows were
sharing their parent toplevel window buffer instead, and thus did not
have a buffer of their own. This piece of code dates back from the
BlackBerry days, and I am guessing the motivation was to tackle
mmrenderer/foreign windows.

In fact, not having buffers causes QWindow to malfunction, as
independent buffers are required.

This patch makes sure every QQnxWindow has a backing buffer, as
expected. Foreign widnows shall be dealt with via different means.

Change-Id: I059ac4f8ac684b3577048f874f82b866f21326b1
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2022-03-21 12:12:54 +10:00
Tor Arne Vestbø bdb9a254c2 macOS: Remove dead code for focus ring handling in Mac style
It was added in 375dd7ad34
but never used.

Pick-to: 6.2 6.3 5.15
Task-number: QTBUG-101883
Change-Id: Ibad7e0b1c371bdee63bcdbea0c5280091107408a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-18 19:47:59 +01:00
Fabian Kosmale 468e9c13a9 Misc: Do not depend on transitive includes
As a drive-by, remove superfluous includes from qnetworkmanagerservice.h
and obey the coding conventions for includes in a few more places.

Change-Id: I65b68c0cef7598d06a125e97637040392d4be9ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-17 17:14:37 +01:00
Fabian Kosmale 49b25ab07b XCB: Do not depend on transitive includes
As a drive-by, follow the coding convention when including qobject.h

Change-Id: I73066646d7f03ee0138e70567738e296b2183f63
Reviewed-by: Liang Qi <liang.qi@qt.io>
2022-03-17 17:14:37 +01:00
Fabian Kosmale e4ab3e39e1 Sql: Do not depend on transitive includes
Change-Id: I9407c34c9fb6add655649dd7058bce7a25be5f5d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-17 17:14:37 +01:00
Volker Hilsheimer 58a14d9433 Enable tests to turn off Windows Vista animations
Animations in that style depend on the current time, which makes it
impossible to run baseline tests. Introduce a dynamic property that
allows us to set the time that animations use.

This way, tests can turn the animation off, or control which time should
be used.

To keep performance overhead low, check only once whether the dynamic
property is set at all.

Pick-to: 6.3
Change-Id: I9bc57b9867fb0d852e101570eca4c7609e7fe1a8
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-03-16 15:56:17 +01:00
Mårten Nordheim d8d202a3ba Fix remaining uses of deprecated QScopedPointer::take
Change-Id: I804aef0aabc1c1bccdf92ff8da7b6c2f5377252a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-15 21:08:21 +01:00
Mårten Nordheim 6eda249402 Fix deprecated use of QBA/Q*String::count
'Use size() or length() instead'

Change-Id: I284fce29727c4c1ec9ea38a4e8ea13a9e0af5390
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-03-15 20:18:56 +01:00
Assam Boudjelthia 6696134644 Android: guard against potential null pointer access
androidPlatformIntegration might be called before
setAndroidPlatformIntegration() is called, and also all other
uses of androidPlatformIntegration is already guarded in our
code.

Pick-to: 6.2 6.3
Task-number: QTBUG-100470
Change-Id: Ifd7d36ba7f2f3b55652466825d7fd84c87ec5e19
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2022-03-15 16:09:04 +02:00
Oliver Eftevaag 06c2ffdae7 Fix typo
Change-Id: I4cc6c6867490c1e10ca6c4bf5620325826a687a3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-14 10:15:12 +01:00
Aleksandr Reviakin 367f96aedf wasm: Use % instead of vh for canvas dimensions
Pick-to: 6.3
Fixes: QTBUG-95067
Change-Id: I19e439eb81200728c2b773ab6799bb205caa1231
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-03-13 23:24:59 +00:00
Laszlo Agocs 68a4c5da9a Compose render-to-texture widgets through QRhi
QPlatformTextureList holds a QRhiTexture instead of GLuint. A
QPlatformBackingStore now optionally can own a QRhi and a
QRhiSwapChain for the associated window.  Non-GL rendering must use
this QRhi everywhere, whereas GL (QOpenGLWidget) can choose to still
rely on resource sharing between contexts. A widget tells that it
wants QRhi and the desired configuration in a new virtual function in
QWidgetPrivate returning a QPlatformBackingStoreRhiConfig. This is
evaluated (among a top-level's all children) upon create() before
creating the repaint manager and the QWidgetWindow.

In QOpenGLWidget what do request is obvious: it will request an
OpenGL-based QRhi. QQuickWidget (or a potential future QRhiWidget)
will be more interesting: it needs to honor the standard Qt Quick
env.vars. and QQuickWindow APIs (or, in whatever way the user
configured the QRhiWidget), and so will set up the config struct
accordingly.

In addition, the rhiconfig and surface type is (re)evaluated when
(re)parenting a widget to a new tlw. If needed, this will now trigger
a destroy - create on the tlw. This should be be safe to do in
setParent. When multiple child widgets report an enabled rhiconfig,
the first one (the first child encountered) wins. So e.g. attempting
to have a QOpenGLWidget and a Vulkan-based QQuickWidget in the same
top-level window will fail one of the widgets (it likely won't
render).

RasterGLSurface is no longer used by widgets. Rather, the appropriate
surface type is chosen.

The rhi support in the backingstore is usable without widgets as well.
To make rhiFlush() functional, one needs to call setRhiConfig() after
creating the QBackingStore. (like QWidget does to top-level windows)

Most of the QT_NO_OPENGL ifdefs are eliminated all over the place.
Everything with QRhi is unconditional code at compile time, except the
actual initialization.

Having to plumb the widget tlw's shareContext (or, now, the QRhi)
through QWindowPrivate is no longer needed.  The old approach does not
scale: to implement composeAndFlush (now rhiFlush) we need more than
just a QRhi object, and this way we no longer pollute everything
starting from the widget level (QWidget's topextra -> QWidgetWindow ->
QWindowPrivate) just to send data around.

The BackingStoreOpenGLSupport interface and the QtGui - QtOpenGL split
is all gone. Instead, there is a QBackingStoreDefaultCompositor in
QtGui which is what the default implementations of composeAndFlush and
toTexture call. (overriding composeAndFlush and co. f.ex. in eglfs
should continue working mostly as-is, apart from adapting to the
texture list changes and getting the native OpenGL texture id out of
the QRhiTexture)

As QQuickWidget is way too complicated to just port as-is, an rhi
manual test (rhiwidget) is introduced as a first step, in ordewr to
exercise a simple, custom render-to-texture widget that does something
using a (not necessarily OpenGL-backed) QRhi and acts as fully
functional QWidget (modeled after QOpenGLWidget). This can also form
the foundation of a potential future QRhiWidget.

It is also possible to force the QRhi-based flushing always,
regardless of the presence of render-to-texture widgets. To exercise
this, set the env.var. QT_WIDGETS_RHI=1. This picks a
platform-specific default, and can be overridden with
QT_WIDGETS_RHI_BACKEND. (in sync with Qt Quick) This can eventually be
extended to query the platform plugin as well to check if the platform
plugin prefers to always do flushes with a 3D API.

QOpenGLWidget should work like before from the user's perspective, while
internally it has to do some things differently to play nice and prevent
regressions with the new rendering architecture. To exercise this
better, the qopenglwidget example gets a new tab-based view (that could
perhaps replace the example's main window later on?). The openglwidget
manual test is made compatible with Qt 6, and gets a counterpart in form
of the dockedopenglwidget manual test, which is a modified version of
the cube example that features dock widgets. This is relevant in
particular because render-to-texture widgets within a QDockWidget has
its own specific quirks, with logic taking this into account, hence
testing is essential.

For existing applications there are two important consequences with
this patch in place:

- Once the rhi-based composition is enabled, it stays active for the
lifetime of the top-level window.

- Dynamically creating and parenting the first render-to-texture
widget to an already created tlw will destroy and recreate the tlw
(and the underlying window). The visible effects of this depend on the
platform.  (e.g. the window may disappear and reappear on some,
whereas with other windowing systems it is not noticeable at all -
this is not really different from similar situtions with reparenting
or when moving windows between screens, so should be acceptable in
practice)

- On iOS raster windows are flushed with Metal (and rhi) from now on
(previously this was through OpenGL by making flush() call
composeAndFlush().

Change-Id: Id05bd0f7a26fa845f8b7ad8eedda3b0e78ab7a4e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-11 21:25:00 +01:00
Morten Johan Sørvig 851dc581cf Revert "QScreen_win: retrieve user friendly monitor name"
This made the screen names be non-unique (in my case
“28E850”), which causes the code in handleScreenChanges()
to think they are the same screen.

This reverts commit e9fd1c6aab.

Pick-to: 6.3 6.2
Change-Id: I97fb76aeb66857b4bf9b3c5b4bd6db6024446798
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
2022-03-11 19:32:08 +00:00