Commit Graph

9429 Commits

Author SHA1 Message Date
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
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
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
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
fef455999a Android: Fix issue in loading multimedia Android plugin
Qt projects on Android were failing to correctly load the plugin lib.
The main reason is missing environment variables when the media
integration starts. To make sure that the variables are loaded, I have
change the setenv to be done in the java side instead of c++ side.

Fixes: QTBUG-100299
Pick-to: 6.3
Change-Id: Iba0b6af40574be2d88824ebdcfb1626335cecf09
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-03-02 11:23:54 +02:00
Liang Qi
cfc2e267a4 xcb: fix a typo for WindowTypes
Pick-to: 6.3 6.2 5.15
Fixes: QTBUG-101306
Change-Id: If02fe4997d27b952886ce664133d1aafc2b41669
Reviewed-by: Liang Qi <liang.qi@qt.io>
2022-03-01 07:38:20 +00:00
Yuhang Zhao
540745e599 Windows QPA: Add convenient overload to query window frame
To be used in a later commit.

As a drive-by, return early in the frameOnPrimaryScreen
overload to avoid calling GetWindowLong in cases we
don't need them.

Pick-to: 6.3 6.2
Change-Id: Ia69f4acbbf3e044073f818f357e614d4c6680d21
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2022-03-01 13:08:03 +08:00
Yuhang Zhao
77d0ad6657 Windows QPA: Add some offset to the system menu when appropriate
Before this patch, the system menu will always appear on
the top-left corner of the window if the window doesn't
have the standard window frame. However, this doesn't look
very good on most situations, especially when the window
has a homemade title bar. This patch adds an extra check
for this kind of situations. This patch will automatically
apply an appropriate offset for the system menu if the user
is trying to use a self-made title bar for their frameless
or customized windows.

Pick-to: 6.3 6.2
Change-Id: I55e1c4ac26a4051ca48928d4a2ac3456dce117d1
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2022-03-01 13:08:02 +08:00
Yuhang Zhao
7261c81152 Windows QPA: fix window style correction for context help button
According to Microsoft Docs [1][2], WS_MINIMIZEBOX and WS_MAXIMIZEBOX
must be accompanied by the WS_SYSMENU style, and the WS_EX_CONTEXTHELP
style is not compatible with WS_MINIMIZEBOX and WS_MAXIMIZEBOX. This
patch adds additional checks for these situations.

[1] https://docs.microsoft.com/en-us/windows/win32/winmsg/window-styles
[2] https://docs.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles

Pick-to: 6.3 6.2
Change-Id: If32f8b42e25cfc67ffd1e84cc4b061f21a01042a
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2022-03-01 12:29:36 +08:00
Yuhang Zhao
770ea68588 Windows QPA: Use less magic number
The correct calculation of the invisible frame margin and the window
border width (they are the same thing actually) is the thickness
of the size frame plus the thickness of the padded border. When
DPI is 96, both of them is 4px and thus the invisible frame margin
and window border width is 8px. So previously the empirical
magic number can work normally is because the error is very small.
It's not a big thing because even on a high DPI screen the error
is still very small. For example, on my 4K monitor with 200%
scaling, the error is only 2px, human eyes almost can't find the
visual difference. But since we now know how to calculate these
values correctly, let's use the correct calculation instead. The
magic numbers and empirical expressions just make people confused.

Pick-to: 6.3 6.2
Change-Id: Ieda4796231935f2ad1b6f28e4aa4af5b5bce2256
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2022-03-01 09:11:51 +08:00
Liang Qi
404c5dc49f xcb: free a randr monitors pointer after usage
This amends 9a4c98e556.

Pick-to: 6.3
Fixes: QTBUG-101302
Change-Id: Ia7a2f82550843a90a5e101788e3835bf3332f697
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-02-28 23:44:15 +01:00
Timur Pocheptsov
af05f278ed QMacStyle: fix tool buttons (in checked mode)
While switching to the 'momentary push in' button type, the old code that
shows button as pressed/checked was removed. Since 'square' buttons
were sharing this part with rounded push buttons, the change broke
checked square buttons. So we retain the old code for this particular
case.

Also, add a minimal baseline test for this scenario: square button,
triggering 'toolbutton' style with/out 'checked' state.

Fixes: QTBUG-100802
Pick-to: 6.3 6.2
Change-Id: Ib7b15b13ead834c7bb2cd36de76ccd5bedb07810
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-28 08:46:21 +01:00
Yuhang Zhao
64d65a645c Windows QPA: Highlight the first entry in the system menu
This is what native Win32 applications usually do.

Pick-to: 6.3 6.2
Change-Id: I19f1170113b4064f1d683dbd13b7de7d263105f0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2022-02-25 12:43:16 +08:00
Yuhang Zhao
56fa390d72 Windows QPA: More debug enhancements
Pick-to: 6.3
Change-Id: Ibf03fa82f14cf704267b85348ce11ee2d505ff24
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-02-25 09:30:35 +08:00
Marc Mutz
b727f2190f Protect headers against min/max macros
... using the usual pattern, which, being idiomatic, doesn't need a
comment explaining it.

Pick-to: 6.3
Change-Id: Id6b12450495a18f89e1f83f2018b6218b03ff6a7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
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>
2022-02-22 20:12:29 +00:00
Viktor Arvidsson
cfe421cee2 Windows QPA: Calculate window frame for frameless windows the same for all code paths
When we add the WS_THICKFRAME/WS_CAPTION window flags to a
frameless window the return value of AdjustWindowRectEx is no
longer 0. This works fine when creating the window since the version
of QWindowsGeometryHint::frame used during creation checks the
FramelessWindowHint, however later when the window changes
screen, the screen change code checks the fullFrameMargins which
uses a version of QWindowsGeometryHint::frame that does not
early out, causing a missmatch in the geometries of the backing
store and platform window.

This fixes aero snapping shortcuts for frameless windows on multi
monitor setups.

Fixes: QTBUG-84466
Pick-to: 6.2 6.3
Change-Id: I2357ea32669e4676645549996a3ac6073f3df15c
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2022-02-22 18:03:11 +00:00
Volker Hilsheimer
29a7489769 Always include qt_windows header first
qt_windows takes care of setting NOMINMAX, which prevents native headers
from defining `min` and `max` as macros, breaking the build. So include
that header always as the first header.

Pick-to: 6.3
Change-Id: I82cd8b21d263102000e6e66f135465bc2c126db4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-02-22 14:48:38 +01:00
Piotr Srebrny
8761078629 Remove unused variable which causes compiler error
Pick-to: 6.2 6.3
Change-Id: I87348370d10d2047e8fa861d7675bc0cd3db080b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-02-21 18:02:48 +00:00
Lorn Potter
5a7b836ca7 wasm: make input callback returns consistent
Change-Id: I43d9db1723d85eef69cfa2e51da4a6a640e8b3c5
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-02-20 22:28:24 +00:00
Michal Klocek
be2745e478 Install 3rdparty headers for static builds
For static builds we need 3rdparty headers to be installed.
Leaf modules like qtwebengine needs 3rdparty libs and header for
zlib, freetype, harfbuzz, png, jpeg. Without those the Chromium bundled
versions are used, however it might end up badly if qt has already
bundled one.

Introduce new header only modules with additional arguments for
qt_internal_add_module:

 * EXTERNAL_HEADERS to pick exactly which headers are public
 * EXTERNAL_HEADERS_DIR to include whole directory preserving the
   files directory structure

Fix qtsync so it keep directory structure for all non-qt modules when
syncing headers and do not generate warnings for headers files.

Task-number: QTBUG-87154
Task-number: QTBUG-88614
Change-Id: If1c27bf8608791cd4e0a21839d6316a445a96e9f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-19 01:52:32 +01:00
Andy Shaw
a14f2d5914 Windows: use QSystemLibrary instead of LoadLibrary directly
Using QSystemLibrary ensures that it will only use the expected copy of
the system library and not one that has been placed in the application's
working directory or elsewhere in the PATH environment variable.

Pick-to: 5.15 6.2 6.3
Change-Id: Ic4234334f73482b38ee5f06345bf11f8c029edc5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-18 10:02:52 +01:00
Zhang Hao
72931f4920 Fix UI mismatch when QPrinter::setDuplex
Amends fa854f214a. If user call
QPrinter::setDuplex method, the QPrintDialog explicitDuplexMode value
won't update.

Fix this by:
1) handle device-specific default and value set in QPrinter in
QCupsPrintEngine(Private)
2) handle the explicitly user-selected value in QPrintDialog(Private)

Done-with: Michael Weghorn <m.weghorn@posteo.de>
Pick-to: 5.15 6.2 6.3
Fixes: QTBUG-99504
Change-Id: I1a471a8554e83aa4bec8bb95fcc95f9135b0ac8c
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-02-18 12:19:17 +08:00
Morten Johan Sørvig
738a11eeac wasm: reliably determine QScreen position
Fix bug where QWindow content would be drawn with an
offset from the QScreen’s topLeft if the page was scrolled.

On Qt for WebAssembly, screen geometry is equivalent
to canvas geometry, where the canvas position is the
position of the canvas on the document body.

getBoundingClientRect() is the correct function to use
here, however it returns a rect relative to the viewport.
Offsetting this rect by offsetLeft/Top can work in some
bases, but this offset is relative to HTMLElement.offsetParent
and not necessarily to the document body.

Determine the correct QScreen position by subtracting
the body position from the canvas position (both relative
to the viewport).

Change-Id: Ifb7fd28adedbf997d63f79f9b626cfcf3664ff54
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-02-17 20:17:38 +00:00
Morten Johan Sørvig
2ed3cc8e7a wasm: move canvas configuration to Qt implementation
The required canvas configuration is an implementation
detail; move it out of the .html file (which we expect
that users will replace), and into the QWasmScreen
constructor.

This also enables using a div element as the container
element (instead of a canvas), since Qt then can create
and configure the canvas during QWasmScreen construction.

Change-Id: Ia849517d00fa3e8ec307065a524c0c91296dd490
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-02-16 21:20:36 +01:00
Ivan Solovev
60799fc141 Android A11Y: Fix value rounding
QAccessibleInterface stores values as QVariants. When dealing with
double values, as a result of some calculation (for example, Slider
value update), rounding errors can be introduced.
When converting double values to QString using QVariant::toString(),
these rounding errors result in strings like
0.30000000000000004 instead of 0.3 or
2.7755575615628914e-17 instead of 0.3 - 3 * 0.1 and similar zeroes.

To fix this issue, this patch introduces a custom conversion for
floating-point values. The idea is to convert QVariant to double,
and then convert double to QString using 'f' format and a suitable
precision, determined from the UI element's minimumStepSize(), if
it has one, otherwise falling back to QString::number()'s default
(which is 6).

Task-number: QTBUG-93396
Pick-to: 6.3 6.2 5.15
Change-Id: Ia5ca7345812e39629e9c191b6d8b896a8f51de80
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-02-15 17:51:33 +01:00
Ivan Solovev
a374d59abc Android A11Y: Announce value together with element name when focused
Before this patch when we focus a new element, only its description
was announced.
For elements like Slider that means that if it had no accessible name
or description, its value would be announced (all is fine here).
But if the slider is defined like that:
 Slider {
     Accessible.name: "int slider"
     value: 5
     from: 0
     to: 20
     stepSize: 1
 }

only the name ("int slider") will be announced, but not the actual
value.

This patch fixes the logic of content description generation. If the
element has value, then it is added to the description and announced
as well.

Task-number: QTBUG-93396
Pick-to: 6.3 6.2 5.15
Change-Id: Ia8667149ebd867945c5f57d951fd6ade0f382598
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-02-15 17:51:33 +01:00
Ivan Solovev
b238f83380 Android A11Y: handle valueChanged events
Before this patch Android A11Y implementation was missing
ValueChanged event handling. As a result, no update was given
when the element's value was changed.

Handling these events allows us to announce value changes on such
objects like Slider, SpinBox, etc...
This is a universal method of value-change announcement, so it
supports all sorts of A11Y gestures.

On the Java side a new function was introduced to announce the
values, because we need to use the actual element's *value*,
not its accessible name or description.

Task-number: QTBUG-93396
Pick-to: 6.3 6.2 5.15
Change-Id: Ic44abd5f01b9b6f5468962131466edaf6a49d498
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2022-02-15 17:51:33 +01:00
Viktor Arvidsson
7794421bea Windows QPA: Correct mistake when calculating minmaxinfo
Amends 46e9852a1d

The previous code would fail if the windows taskbars are placed
to the top or left on the screen. The mistake was missed because
Windows seems to adjust the window position automatically
in case the window handles WM_NCCALCSIZE and returns 0,
which was the case for me.

Task-number: QTBUG-51327
Pick-to: 5.15 6.2 6.3
Change-Id: I38ef974f7518be63a0bacf080f3359c219284078
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-02-14 23:48:23 +01:00
Andreas Buhr
d456102962 Make Droid Sans Mono available as fixed font for all Android styles
Fixes: QTBUG-87405
Change-Id: I54ebc06c82c32acd0383ea5fedf78acce4e11977
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-02-14 16:22:28 +01:00
Viktor Arvidsson
46e9852a1d Windows QPA: Fix frameless maximize on secondary screens
Frameless windows shouldn't cover the taskbar when maximized.
This has been fixed for the main screen in the past but did not
work for secondary screens. According to the code the MINMAXINFO
is only available for the main screen but I believe this is a
misunderstanding of the Windows documentation.  Besides
we use QScreen::availableGeometry() which seems to be correct.

Fixes: QTBUG-51327
Pick-to: 5.15 6.2 6.3
Change-Id: Ib2205c480359d1a870dcfcf0312fbe417f650e28
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-02-11 23:05:20 +01:00
Andreas Buhr
00f1bd00d0 Set Roboto as the default font on Android
Roboto is the default font on Android. So far, Helvetica
was used, which is usually unavailable on Android.

Task-number: QTBUG-87405
Change-Id: I53332403a43f6a005ce73ece68b8dddc41b4b58c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-02-10 15:43:00 +01:00
Allan Sandfeld Jensen
8d714c0c69 Fix compiling with C++20 on macOS
This code triggers warnings about mixing enums of different
types, which breaks compiling with warnings-are-errors.

'bitwise operation between different enumeration types is deprecated'

Pick-to: 6.3 6.2
Change-Id: Ib6c19f02f7c7593c9e22da5e648ea1f2f2ae757b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-10 12:54:36 +00:00
Sivan Nanthiran
cb9ef46c77 Change comparison data type to fix int overflow
Since the value returned by CGDisplaySerialNumber is uint32_t,
comparing it with a long data type can cause overflow when the
value is greater than or equal to 2^31. And since this is a serial
number, in some machine this value can be greater than 2^31.
In those machines, QScreen::name will be empty due to the failed
check here.

Pick-to: 6.3 6.2 5.15
Change-Id: Ia037ba9e7a6d8025cc4b41c1b428eba38455330d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-02-10 11:10:14 +00:00
Volker Hilsheimer
851143eff1 macOS: Prevent recursion when modifying the edit menu
Amends d42cfeb84f, which would result in
infinite recursion when the Edit menu was populated and added to the
menubar after the menubar has been shown.

Add a macOS-only test case that reproduces the crash without the fix.

Fixes: QTBUG-100441
Pick-to: 6.3
Change-Id: I018a7aa7f01558a3b9732b4d6d96a911dc7fbd19
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-02-09 18:19:57 +01:00
Ivan Solovev
e0c61193ea Android A11Y: execute C++ code on main Qt thread
The C++ code, which is called from Java, was executed on Java thread.
However Qt has its own main GUI thread, where all GUI elements and their
accessibility instances are created.
As a result we have threading issues when accessing A11Y objects from
Java thread.

This patch uses QMetaObject::invokeMethod calls to dispatch all the
critical parts of the C++ code to the main thread.
It uses BlockingQueuedConnection, so that Java thread can still use
these methods synchronously.
The proper context is based on the m_accessibilityContext object, which
is created as a child of the base accessibility QObject of the
application (which is the QGuiApplication instance in most cases).

Task-number: QTBUG-95764
Pick-to: 6.3 6.2 5.15
Change-Id: Iff4f3f2645657f6aca426fa19ccc86a2cbe4d4d0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
2022-02-09 16:48:26 +01:00
Ivan Solovev
6d00aac109 Android: extract parentId for hidden object in advance
This commit amends 850a7f1238.
We can't extract the parentId for the hidden object on Java side,
because the Java call is executed in a separate thread, so the
original hidden object can be destroyed somewhere in the middle of
parentId() call.
As a workaround, we get the parentId in advance, on C++ side, and pass
it as a parameter to JNI function.

Task-number: QTBUG-95764
Pick-to: 6.3 6.2 5.15
Change-Id: Ied2ab4ab39b947f3f582575cf77cc76fbac9e274
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-02-09 16:48:26 +01:00
Shawn Rutledge
49d3080155 xcb: Show valuator atom names properly in categorized logging
During a touch update, this looked questionable since I don't have any
barcode readers or buttonboxes attached:

XI2 touch event type 19 seq 1481 detail 193 pos  116.3,   77.8 root pos 6476.3, 2941.8 on window 3e00006
   valuator              BARCODE value 47796.365791 from range 0.000000 -> 65535.000000
   valuator            BUTTONBOX value 59504.858830 from range 0.000000 -> 65535.000000
   touchpoint  193  state  QEventPoint::Updated  pos norm  QPointF(0.729326,0.907986)  area  QRectF(...

After the fix it's like this:

XI2 touch event type 19 seq 1235 detail 201 pos  154.0,   64.3 root pos 6168.0, 2794.3 on window 5000006
    valuator    Abs MT Position X value 45520.589958 from range 0.000000 -> 65535.000000
    valuator    Abs MT Position Y value 56519.790001 from range 0.000000 -> 65535.000000
    touchpoint  201  state  QEventPoint::Updated  pos norm  QPointF(0.6946,0.862437)  area  QRectF(...

ValuatorClassInfo's QXcbAtom::Atom is a Qt enum, which has to be
converted to xcb_atom_t before we can call xcb_get_atom_name_name.
Originally in ce2fe90faa vci was of type
XIValuatorClassInfo; then 7499d4404f
changed it to our ValuatorClassInfo struct, but didn't add the lookup
indirection to this qCDebug.

Pick-to: 5.15 6.2 6.3
Change-Id: Ib6107f17d6c6c209573e3df54149d6cfffc0b8b6
Reviewed-by: Liang Qi <liang.qi@qt.io>
2022-02-09 06:47:19 +00:00
Viktor Arvidsson
31b8a7e5ed macOS: Use native resize cursors for diagonal resize
The diagonal resize cursors provided by Qt does not
quite look like the ones used everywhere else on macOS,
especially for scaled desktops. After some googling this
seems to be how everyone else uses the native versions
since they are private API.

Pick-to: 5.15 6.2 6.3
Change-Id: I3461d07638f4e49cd3e25ab65ef5aa65730bb3a6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-02-02 16:45:37 +01:00
Ilya Fedin
5a0849ed6b Handle glib optional components properly
Fixes: QTBUG-97929
Pick-to: 6.3
Change-Id: Ic73548cb10680a2ccd60faed2b0548c82892eaa1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-02-02 08:56:10 +04: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
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
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
Ilya Fedin
d13ee2dc1a Let QXcbGlxWindow::createVisual fallback to QXcbWindow::createVisual
When flatpak refused to install org.freedesktop.Platform.GL.default for
me, I got into a situation without GL drivers and Qt applications
stopped getting transparency windows.

They fallback to use root_visual and it doesn't provide sufaces with
alpha, I tried to add fallback to QXcbWindow::createVisual just like
QXcbEglWindow::createVisual does and voila, they got transparency.

Pick-to: 6.3 6.2 5.15
Change-Id: I9f401643b3ef231048c6e9e250121c96514101f5
Reviewed-by: Liang Qi <liang.qi@qt.io>
2022-01-28 16:15:28 +01:00
BogDan Vatra
c1a93b20ff [Android]: Handle the screen name, modes and refreshRate properly
Fixes: QTBUG-87136
Fixes: QTBUG-93823
Fixes: QTBUG-94959
Pick-to: 6.3 6.2 5.15
Change-Id: Id480e22611ec949b5e3ee780fc695fb502a5950c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-01-28 00:22:41 +01:00
Volker Hilsheimer
8359e44324 Offscreen: Fix implementation of QScreen::grabWindow
If id == 0, then we should grab the specified rect from the screen.

To do that, find all windows intersecting with the screen geometry, and
compose their backing store images into a screen-size pixmap.

Otherwise, find the respective backing store and grab only that.

Remove the old code respecting the desktop widget, which is no longer a
thing in Qt 6. The code was also wrongly grabbing only the first
containing - not intersecting - window's backing store into the screen
pixmap.

Enable the QScreen::grabImage test for the offscreen platform, where it
now passes.

Task-number: QTBUG-99962
Change-Id: I16eca7b082d65095a62c73624f86a4423e997a7a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-01-26 17:18:18 +01:00
Volker Hilsheimer
5d1bb2ed57 Offscreen: Implement QPlatformBackingStore::toImage
Re-applies 77895514d5419b77535de093b544aee30686cd22, which was
reverted after tests started to XPASS-fail in qtdeclarative. Those
tests are now get consistently QSKIP'ed, so reapply the change.

This makes testing of actually produced output easy in unit tests,
and makes a number of previously failing QtDeclarative tests pass.

Task-number: QTBUG-99962
Change-Id: I167b46b954dee18bdbf90c09c5e42a8c179a1fac
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-01-26 17:18:18 +01:00
Tatiana Borisova
b5124d9719 Fix run time failure for UI autotests (INTEGRITY)
- Add WFD resources release:
  It provides possibility to re-create native window on run time.
  It allows to run several Qt UI applications (one by one) without device reboot.

- Fix crash that found during window re-creation: ~QOpenGLCompositorBacking() calls
  QOpenGLCompositor::instance(). But compositor is deleted for that moment.

Task-number: QTBUG-99123
Pick-to: 6.2 6.3
Change-Id: I1e6dc9a012a166d1fd6cd1c24f9d2e9a8995fc00
Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-01-25 02:59:36 +02:00
Volker Hilsheimer
902087a090 Revert "Offscreen: Implement QPlatformBackingStore::toImage"
This reverts commit 77895514d5419b77535de093b544aee30686cd22, which
is in principle correct, but results in XPASS'ing tests in qtdeclarative
that we need to adapt first.

Originally reverted only for 6.3, but now also in dev given the amount of
tests that have a QEXPECT_FAIL for the offscreen platform in qtdeclarative.

Change-Id: Ic914655c737c3b279c14a66220775f3c7a6cdab8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 8498d1a14b5a8392ee6b50a87b82f9d85d13193e)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-22 11:30:13 +00:00
Volker Hilsheimer
d86a02b468 Windows XP style: Fix coding style violations
Fix various violations of the coding style or general inconsistencies.
No claim for completeness.

* indentation and line breaks
* consistent scopes for case statements where needed
* add curly-brackets for if-statements where needed
* removed {} where not needed
* const'ify a few obvious local variables
* remove random empty lines
* use auto when type is obvious from cast

Deliberately not touching nested if-statements that could be merged into
one.

Pick-to: 6.3
Change-Id: Ie22b36568f33e18d5f15c751c7fd76e1490133b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-01-20 22:57:45 +01:00