Commit Graph

66503 Commits (72c242c7a21d28d652cea082fa08efc7b419bc20)

Author SHA1 Message Date
Giuseppe D'Angelo 72c242c7a2 CMYK: remove unnecessary qPremultiply calls
Although the output of these functions is premultiplied ARGB, we know
the alpha is always going to be full (1.0) because the source is CMYK 32
bit (without alpha). We can therefore avoid calling qPremultiply.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: I129b601f5c93a1c444ab06c3325f946d2bcc6efc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-04-04 01:51:46 +01:00
Tor Arne Vestbø 697e1b0397 Decouple rate-limiting of paint-on-screen widgets from top level widget
As part of eacd58d4e7, a mechanism was
added to prevent posting redundant UpdateRequest events to the top
level widget, managed by QWidgetRepaintManager. The mechanism relied
on a boolean that was set when posting an update request event, and
reset when processing the event for the top level widget, as part
of QWidgetRepaintManager::sync().

However, for paint-on-screen widgets, we don't post an update request
to the top level, we post it to the paint-on-screen widget directly.
And when processing that event, we don't paint the widget though the
normal QWidgetRepaintManager machinery, but instead call the paint
event via QWidgetPrivate::paintOnScreen().

As a result, an update() on a paint-on-screen widget would result
in never receiving updates for non-paint-on-screen widgets, as
we assumed there was no reason to send further update requests.

We could fix this by clearing the updateRequestSent flag as part
of the paintOnScreen() code path, but that's incorrect as the flag
represents whether the top level QWidgetRepaintManager needs an
update request event or not, and would lead to missed updates
to normal widgets until the paint-on-screen widget finishes its
update.

Instead, we only set updateRequestSent if we're posting update
requests for non-paint-on-screen widgets, which in practice
means the top level widget.

The paint on screen logic in QWidgetRepaintManager::markDirty
still takes care of rate-limiting the update requests to the
paint-on-screen widget, by comparing the dirty area of the
widget.

There is definite room for improvement here, especially in the
direction of handling update requests via QWindow::requestUpdate
instead of manually posted events, but for now this will have to
do.

Fixes: QTBUG-80167
Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: Ib5685de7ca2fd7cd7883a25bb7bc0255ea242d30
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-04-04 01:26:56 +02:00
Tor Arne Vestbø 2e97906593 cmake: Selectively enable -no_warn_duplicate_libraries for Xcode 15+
We can't make the choice of whether to enable no_warn_duplicate_libraries
or not based on the Xcode version Qt was built with, as the target flags
will propagate to our cmake integration tests, which we run on platforms
where we don't have Xcode 15.

Pick-to: 6.7
Change-Id: I241a950a3d2e70652a3a6386e5dd86c681d1c13f
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>
2024-04-04 01:26:56 +02:00
Giuseppe D'Angelo 58ff4e22f7 tst_qnetworkreply: verify we can open the local file for comparison
... except for bigfile.

Change-Id: Ide04a9c80b438272e868a6d2b410a507c76d6239
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-04-03 23:57:45 +01:00
Giuseppe D'Angelo 4285f0dfa4 QPdf: remove two unused functions
Never called from anywhere.

Change-Id: I76480586b5eca6b450a6cd36429cdc6e264849cc
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-04-03 23:57:45 +01:00
Thiago Macieira 73003f3b41 QStorageInfo/Linux: remove dependency on linux/mount.h
It was introduced in December 2018, which is apparently too recent for
some Linux distributions. So remove the dependency that was there only
to give us MS_RDONLY and revert to the old statfs.h / sys/vfs.h flag.

We still don't include <sys/vfs.h> because it is absent on some old
Android versions.

Amends ea6abe583f.

Pick-to: 6.7
Fixes: QTBUG-123932
Change-Id: If1bf59ecbe014b569ba1fffd17c29cc448d16358
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-04-03 14:15:43 -07:00
Thiago Macieira ce2585d0e9 QObject: add check for Q_OBJECT macro to findChild(ren)
We can't fix the underlying reported problem, but we can warn that the
user has made a mistake.

[ChangeLog][QtCore][QObject] The class template parameter passed to
QObject::findChild() or findChildren() is now required to have the
Q_OBJECT macro. Forgetting to add it could result in finding children of
the nearest ancestor class that has the macro.

Pick-to: 6.7
Fixes: QTBUG-105023
Change-Id: I5f663c2f9f4149af84fefffd17c008f027241b56
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-04-03 14:15:43 -07:00
Thiago Macieira 43cefd882e XCB: remove dependency on QtOpenGLPrivate
We don't use that in the XCB library or plugin anywhere.

Pick-to: 6.7
Change-Id: I5f663c2f9f4149af84fefffd17be8c7f3bd7bd14
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-04-03 14:15:43 -07:00
Thiago Macieira 60417a265a QLibrary: fake RLTD_NODELETE by not calling dlclose()
On systems without the RTLD_NODELETE flag, simply don't call dlclose()
and leak the handle. Amends ef5ab6e006.

Pick-to: 6.7
Change-Id: I01ec3c774d9943adb903fffd17b76673562daa8a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-04-03 13:15:43 -08:00
Giuseppe D'Angelo 9828ddadfb JPEG plugin: CMYK code tidies
Remove unused code.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: I3db7705b3963d7a7669f8c9b284d3d35a2a7da92
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-04-03 22:15:43 +01:00
Giuseppe D'Angelo 3fb3d95c33 Add support for CMYK file I/O in JPEG
JPEG part 6 defines CMYK support. This commit adds such support to the
JPEG plugin.

A *very* interesting discovery is the fact that Photoshop inverts the
meaning of the CMYK color channels when saving into JPEG: 0 means "full
ink", and 255 means "no ink". Most other image viewers/editors follow
the same interpretation, I imagine for compatibility.

But others, like Adobe Reader, don't (???) -- a PDF expects a DCT
encoding with 0 meaning "no ink". I am adding a SubType to the image I/O
handler to let the user choose what they want, defaulting to Photoshop
behavior.

Also, turns out that Qt was already loading CMYK files and converting
them to RGB. I don't think we should do automatic, lossy conversions (we
were not taking into account an eventual colorspace...), so I'm changing
that loading to yield a CMYK QImage.

Finally: save the colorspace, even if it's a CMYK image.

QColorSpace doesn't support anything but RGB matrix-based colorspaces.
Yet, it can load an arbitrary ICC profile, and will store it even if
it's unable to use it. We can use this fact to preserve the colorspace
embedded in CMYK images, or let users set an arbitrary ICC profile on
them through Qt APIs, and then saving the result in JPEG.
[ChangeLog][QtGui][JPEG] Added support for loading and saving of JPEG
files in 8-bit CMYK format. When loading a CMYK JPEG file, Qt used to
convert it automatically to a RGB image; now instead it's kept as-is.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: Ibdbfa16aa35814f5dba28c2df89577175162b731
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-04-03 22:15:42 +01:00
Giuseppe D'Angelo e68b57e2e0 Windows: use MSG timestamps for input events
Input events have a timestamp. When dispatching an event through QPA, a
platform plugin can either provide it, or QPA will use an internal
QElapsedTimer to provide a timestamp.

Windows input messages do come with a timestamp already, so we can use
that instead of the QPA.

The two methods are not equivalent.

For instance: for various reasons, Qt does not honor Windows' "double
clicked" message, but uses the delta between two mouse events to
establish if the second click is actually a double click.

Now suppose that the user double clicks on a widget. On the first click,
the application does something that freezes it for a bit (e.g. some
heavy repainting or whatever). Does the second click register as a
double click or not?

* If we're using Qt's own timer, the answer is NO; the event is pulled
  from the WM queue after the freeze, given a timestamp far away from
  the last click, and so it will be deemed another single click
* If we use the OS' timestamps, then the second click will be seen as
  "close" to the first click, and correctly registered as second click.

This reasoning can be extended to many other QPA events, but looks like
the APIs for some are missing (e.g. enter events), so I'm not tackling
them here.

This commit reverts ade96ff644.

Task-number: QTBUG-109833
Task-number: QTBUG-122226
Change-Id: I5f3fba029b44c618ef622bacdc4bcc3928e04867
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
2024-04-03 21:29:41 +01:00
Laszlo Agocs e36c1a8d84 rhi: Add support for resolving depth-stencil
Add setDepthResolveTexture(). Should work similarly to the color
attachments' resolveTexture, but for depth or depth-stencil.

However, this is another fragmented feature.

- D3D11/12:

Not supported. AFAICS multisample resolve (ResolveSubresource) is just
not supported for depth or depth-stencil formats.

- Vulkan:

Not supported with Vulkan 1.0.

Supported with Vulkan 1.1 and the two extensions.
(VK_KHR_depth_stencil_resolve which in turn requires
VK_KHR_create_renderpass2 since the 1.0 structs are not extensible, so
now need to use VkRenderPassCreateInfo2 and all the '2' structs)

In Vulkan 1.2 the above are in core, without the KHR suffix, but we
cannot just use that because our main target, the Quest 3 (Android) is
Vulkan 1.1.  So 1.2 and up is ignored for now and we always look for
the 1.1 KHR extensions.

The depth resolve filter is forced for SAMPLE_0. AVG seems to be
supported on desktop (NVIDIA) at least, but that's not guaranteed, so
would need physical device support checks. On the Quest 3 it does not
seem to be supported. And in any case, other APIs such as Metal do not
have an AVG filter mode at all, so just use SAMPLE_0 always.

- OpenGL (not ES):

Should work, both when the multisample data is a renderbuffer and a
texture. Relies on glBlitFramebuffer with filter NEAREST. What it does
internally, with regards to the depth/stencil resolve mode, is not under
our control.

- OpenGL ES:

Should work when the multisample buffer is a texture. But it will not
work when a multisample renderbuffer (setDepthStencilBuffer, not
setDepthTexture) is used because the GLES-only multisample extensions
(GL_EXT_multisampled_render_to_texture,
GL_OVR_multiview_multisampled_render_to_texture, which we prefer over
the explicit resolve-based approach) work with textures only.

- Metal:

Should work.

Task-number: QTBUG-122292
Change-Id: Ifa7ca5e1be78227bd6bd7546dde3a62f7fdbc95e
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2024-04-03 22:14:21 +02:00
Tatiana Borisova faaee82129 Add equality comparison between QJsonObject and QJsonValueConstRef
- amends 839cffd521

Fixes: QTBUG-123927
Change-Id: I9174e747478937d4c9ed6522dd603fea50daf203
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-04-03 17:31:36 +00:00
Giuseppe D'Angelo f62a6ac874 QLogging: exclude QInternalMessageLogContext from backtraces
"Just in case" -- as the comment says,
QInternalMessageLogContext's constructor is usually inlined, but
we can't be sure if it has been.

Change-Id: I4da2f0875d9fd9f7bd6d79447b4761fda329c7fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-03 18:31:36 +01:00
Giuseppe D'Angelo 2a54229f90 GUI: add CMYK painting support
This commit adds a CMYK 8bpp format to QImage. The idea is to enable the
transport of CMYK images inside Qt, for instance to be loaded/saved from
files or painted on CMYK capable paint devices (e.g. PDF).

Also, rasterization support *from* a CMYK image is added (on top of a
RGB surface), as well as CMYK image scaling/conversion.

Conversion and rasterization between CMYK and RGB isn't particularly
optimized nor it honors any colorspaces yet. The overall idea is to
match 1:1 the existing behavior of CMYK QColor (which get naively
changed to RGB; there isn't colorspace support in QPainter yet).

There are no plans to add rasterization *towards* CMYK.

Image save/load in native CMYK formats will be added in future commits.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

[ChangeLog][QtGui] Support for 8-bit CMYK images has been added.

Change-Id: I4b024cd4c15119c669b6ddd450418a9e425587f8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-04-03 18:31:36 +01:00
Fredrik Ålund 9a92e26dcd Invalid cast when setting parameter index in MimerGet/SetXXX
Change the invalid static_cast<std::int16_t>(i)+1
to the correct static_cast<std::int16_t>(i+1).

Change-Id: I5d3e17d29deb2a70fa0d7d7838531a3dc80b4e45
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-04-03 16:17:12 +01:00
Fredrik Ålund ad84754b58 Fix data() with long datatype for Mimer SQL
Calling data() for parameters of the type bigint
failed in combination with stored procedures with
output parameters. Cast the result to qlonglong to
fix it.

Pick-to: 6.7 6.6
Change-Id: I84ef04ed26821b92ef7c5bcdf12b778e91450e0b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-04-03 16:17:12 +01:00
Tim Blechmann 95dabd0696 CMake: fix unity builds of darwin's permission helper
CMake-3.29 supports unity-building of objc/objcpp. This patch fixes
darwin's permission helper, which includes a source under a preprocessor
define.

Change-Id: I62e2d291c40ad7b1dbb5243eaee9bf8625473041
Pack-to: 6.7 6.6 6.5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-04-03 15:17:12 +00:00
Friedemann Kleint fdac1e2205 Add support for using an inline namespaces for -qtnamespace
Inline namespaces serve the purpose for which the original
-qtnamespace option was added and allow for macro simplification (no
need for any using directives). This makes it possible to use
namespaced builds of Qt also for Qt for Python and similar use cases
which have issues with the additional namespace.

[ChangeLog][QtCore] It is now possible to use an inline namespace for
-qtnamespace (option -qtinlinenamespace).

Task-number: PYSIDE-2590
Change-Id: Ia0cecf041321933a2e02d1fd8ae0e9cda699cd1e
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-04-03 17:17:11 +02:00
Tor Arne Vestbø e23ea6a5d3 cmake: Propagate Qt's CMAKE_OSX_SYSROOT to user projects by SDK name
CMake will transform the CMAKE_OSX_SYSROOT into a path as part of
Darwin-initialize.cmake, as non-Xcode generators rely on it to
be a path when setting -isysroot.

When propagating the CMAKE_OSX_SYSROOT to consumers of Qt, we need
to propagate it by its original SDK name, so that CMake's Xcode
generator can write it by name into the SDKROOT Xcode setting by
name, and so that we don't lock the user into using the exact
same SDK path (and version) as we did when building Qt.

The QT_APPLE_SDK code path has been removed, as setting QT_APPLE_SDK
will always set the CMAKE_OSX_SYSROOT as well.

Change-Id: Ib1ef19b9dc375dddf76a2629ee790990c0722f75
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-04-03 17:17:11 +02:00
Tor Arne Vestbø e3b36b6542 qmake: Improve Xcode projects for single SDK builds on Apple platforms
Xcode expects the base SDK to always be the device SDK, so we can't
pass QMAKE_MAC_SDK on directly.

We use the Xcode SUPPORTED_PLATFORMS setting to inform Xcode about
which targets we can actually build and run for.

Change-Id: I32f474a9f2016fb410225cfef1fecc6598ac6c82
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-04-03 17:17:11 +02:00
Tor Arne Vestbø 8bb93bf8ee macOS: Remove popup mouse and app activation monitors on app shutdown
We're not guaranteed to get into any of the code paths that call
removePopupMonitor() before the app goes away. In a plugin-scenario,
this may cause crashes when our monitor then gets a callback and
we try to access QGuiApplicationPrivate::instance().

Pick-to: 6.7 6.6 6.5 6.2
Fixes: QTBUG-123959
Change-Id: I287b91ff261a8aab74adbbad8c63a042daf944d5
Reviewed-by: Doris Verria <doris.verria@qt.io>
2024-04-03 17:17:11 +02:00
Albert Astals Cid 699ddcb15b Use ifdef instead of if for __cpp_lib_span
Like the other times it's used in this file

This is causing compilation errors in projects that use -Werror=undef

Fixes: QTBUG-123937
Pick-to: 6.7
Change-Id: I0cdd2910755dc9079890011dd8dbc27a6e64793e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-03 12:53:53 +02:00
Mårten Nordheim f2159d7131 QRestAccessManager: fix syncqt generation
Apparently it has trouble with multiple attributes between the
class keyword and the class name, looking only for the EXPORT
macros.

As a quick band-aid we can add the #pragma to tell syncqt
to generate the header explicitly.

Pick-to: 6.7
Fixes: QTBUG-123875
Change-Id: If155a5b667b9e71d43dfac04ad19caee0ff23793
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-04-03 10:11:26 +02:00
Piotr Wiercinski b058a9c712 wasm: Disable failing selenium test temporarily
Task-number: QTBUG-123942
Change-Id: I89ee1ce70fba69c9b2d6109669186a06a92da039
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-04-03 10:11:09 +02:00
Bartlomiej Moskal 229cadb7a3 Android: Choose correct icon for QMessageBox
QMessageBox contains an icon that can be set using icon type. Before
this commit, android.R.attr.alertDialogIcon was used regardless of the
expected icon type. Only if setting failed, the icon from
android.R.drawable was set (depending on the expected icon type).

Previously, usage of android.R.attr.alertDialogIcon was the way to
consider Theme in choosing icon view. Since
31a0d99fa5 commit, getDrawable(id, theme)
is used with second parameter: Resources.Theme.

Because of that we can start to use only icons from android.R.drawable
and remove usage of android.R.attr.alertDialogIcon

Fixes: QTBUG-123334
Pick-to: 6.7 6.6 6.5
Change-Id: I6cfdaf30aea5d132e38ba5d78054089b51cf5f13
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-04-03 09:46:24 +02:00
Thiago Macieira 710276ed85 Logging: capture the backtrace closer to the user's entry point
Instead of deep inside the processing of the message pattern tokens.
This reduces the number of uninlineable functions in release builds to
2. Experimentation shows that even in debug mode our overhead to
backtrace() is just 2, despite the debugger's backtrace showing 3 frames
-- the debugger is using QtCore's debug symbols and does know about the
inlined function.

As a nice side-effect, we capture the backtrace only once per message,
not once per %{backtrace} token in the QT_MESSAGE_PATTERN.

Change-Id: I01ec3c774d9943adb903fffd17b7d6de09167620
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-27 13:47:54 -07:00
Thiago Macieira d9f7104166 Logging: introduce QInternalMessageLogContext to hold current context
QMessageLogContext is a primitive type that may be extended in the
future with more fields (it has been at version 2 since commit
6d166c8822, though that did not extend the
struct's size). This introduces a QInternalMessageLogContext which is
used in before all our calls to qt_message_output().

Currently there's no difference and no way to tell that the internal
version is used.

Change-Id: I01ec3c774d9943adb903fffd17b7d5abc0052207
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-27 13:47:53 -07:00
Axel Spoerl 7aedcdefb8 QMenu: clear popup screen after exec()
8cd7a3d472 remembered the current screen
in QMenuPrivate::popupScreen. This QPointer member is not reset, after
QMenu:exec(), which makes a re-used menu remember the wrong screen, if
its next usage happens on another screen.

Reset the member variable at the end of QMenuPrivate::exec().

This amends 8cd7a3d472.

Fixes: QTBUG-118434
Pick-to: 6.7 6.6 6.5
Change-Id: I7457ca72166346f01cf71b2706ebc20ecd71173c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-03-27 20:26:01 +01:00
Alexey Edelev 32e2386b15 Add the note about data size to QByteArray::operator=(const char*)
Add the note about the way the str size is determined when using
QByteArray::operator=(const char*).

Pick-to: 6.7 6.6 6.5
Change-Id: I39b2d0fc2967832622fbf0c11b3ff6c7ff99b8f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2024-03-27 16:59:36 +01:00
Marc Mutz 2913e7de51 QRhiVulkan: fix random values in pipelineCacheData() result
The QVkPipelineCacheDataHeader::reserved field wasn't initializaed by
the code, but then memcpy()ed with the struct into the result
QByteArray. At best, this contains random data, at worst, it leaks
information.

Initialize it to zero.

Found by Coverity.

Amends df0e98d408.

Pick-to: 6.7 6.6 6.5 6.2
Coverity-Id: 444147
Change-Id: I398c9a1e99483f2f9887d768319b20ecc11e2c86
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-27 15:49:43 +00:00
Giuseppe D'Angelo 6aec89c5fb Hardening: fix _LIBCPP_HARDENING_MODE
It seems we ended up passing "_LIBCPP_HARDENING_MODE_EXTENSIVE"
(quoted), not just _LIBCPP_HARDENING_MODE_EXTENSIVE. Remove the
quoting.

Amends 9ff1e6d80b

Change-Id: Ia396b0ef638d656a9ea947a378d5623c11e5a544
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-27 16:41:54 +01:00
Alexey Edelev 4fcf6f5164 Set the CMP0159 to NEW where applicable
The policy controls the file(STRING ... REGEX) behavior. This
suppresses warnings produced by  CMake versions >= 3.29.

Pick-to: 6.5 6.6 6.7
Change-Id: I6067bb719b7d35aa2464a91ed198399ff9b1c9af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-27 16:06:29 +01:00
Miguel Costa d25d9f2c26 Clean up windows accessibility backend
What was done:

 * Removed headers in src/gui/accessible/windows/apisupport: as of
   v13.1.0, MinGW supports most of the definitions in these headers.
   Including uiautomation.h should be enough.

 * Removed the QWindowsUiaWrapper class: it's not meant to be extended
   or itself instantiated, is an "ultra-thin" layer (it even preserves
   the "all-caps" Win types of function args), and is in effect only a
   MinGW-bound "kludge". Instead of this class, use the UI Automation
   API directly, with the assumption that it's available and fully
   functional, as specified in the MS docs. Any gaps between this
   assumption and what is delivered by MinGW are bridged with specific
   (and explicit) temporary "kludges".

 * Implemented said specific "kludges" in qwindowsuiautomation. For
   Windows builds, the header just includes uiautomation.h, and the
   .cpp is empty. For MinGW, the header contains definitions still
   missing from uiautomation.h, and the .cpp implements functions
   of the UI Automation core library through imports from the
   uiautomationcore DLL.

 * Windows plugins (and tst_qaccessibility): use the UI Automation API
   definitions directly, instead of the "ultra-thin" wrapper.

 * Windows plugin builds: use uiautomationcore library, if found.

What's intended:

 * Unburden Gui of the Windows UI Automation COM interfaces and other
   definitions that are copied in the uia*.h headers.

 * Make the Windows plugins independent of MinGW shortcomings.

 * Remove the QWindowsUiaWrapper class that essentially only hides these
   shortcomings and the "kludge" code needed to overcome them.

 * As MinGW adds further support to the UI Automation API over time,
   make it noticeable which workarounds are no longer needed. The
   current approach of hiding "kludges" in a wrapper class will also
   hide the fact that they're no longer needed, if/when that time comes.

Change-Id: I0070636817d5de81d0b106e9179e2d0442362e2a
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-03-27 15:35:15 +01:00
Alexey Edelev 967732f7f7 Consider INSTALL_LIBDIR when calculating various cmake paths
Task-number: QTBUG-123039
Change-Id: I111cd612afe64a4f8456ab05d6ff3caf828c4712
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-27 10:37:16 +01:00
Thiago Macieira 13d6d25c1a QLibrary/Unix: remove two unused, exported private functions
Commit 87362f3f58 added
qt_linux_find_symbol_sys(). Given the authors and reviewers, I'm
guessing that was used somewhere in qtdeclarative. Indeed, its use was
removed in qtdeclarative/67191c2b3213259c6eaf045154e9370faa085868
("Remove qqmlmemoryprofiler*").

qt_mac_resolve_sys() was never used in the public repository, as far as
I can tell.

Change-Id: I6818d78a57394e37857bfffd17bbf1fae8688b1a
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-27 02:37:03 -07:00
Joerg Bornemann 6e12a298f4 configure: Fix -system-zlib and -system-sqlite options
These options are declared with TYPE enum and a MAPPING that's supposed
to control the feature 'system-zlib' or 'system-sqlite'. Since only
inputs of type boolean control features now, we need to somehow declare
that this non-boolean input controls a feature.

We do this by adding the keyword CONTROLS_FEATURE to
qt_commandline_option. For example,

    qt_commandline_option(zlib
        CONTROLS_FEATURE
        TYPE enum
        NAME system-zlib
        MAPPING system yes qt no
    )

declares
- commandline option "zlib" sets the input "system-zlib",
  because of the "NAME system-zlib" argument
- accepted input values are "system" and "qt", because
  we have "TYPE enum" and the odd values of MAPPING
- those values are translated to yes/no, because of the
  even values of MAPPING
- CONTROLS_FEATURE forces the translated input's type
  to boolean, and with that it will set the corresponding
  feature 'system-zlib'

Luckily, only qtbase has command line options with MAPPING declared.

Change-Id: I82d06cec43ece3b002c8f5dd414c68dc730909af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-27 06:56:09 +01:00
Joerg Bornemann 52c7357fce CMake: Bail out on configuration with FEATURE_cxx20 and MSVC 2019
45fd36f148 triggers internal
compiler errors in MSVC2019 when configuring Qt with -c++std c++20. Bail
out early when trying to configure a C++20 build with MSVC 2019.

Change-Id: Ic0a49c43e08d3d46221c5c060c0b92628898e26e
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-27 06:55:35 +01:00
Morten Sørvig c1ce543fb2 macdeployqt: wait forever for otool
The QProcess default wait time of 30s may be too short
in e.g. CI environments where processes may be blocked
for a longer time waiting for CPU or IO.

Task-number: QTBUG-117598
Change-Id: I27dbe83ddbe811ae4ff28767de67cb0ceaab267e

Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-27 06:41:24 +01:00
Giuseppe D'Angelo a0a990863f QMake: make it error out if it cannot open output files
Change-Id: I02c979e31f4208cbf9d590e043cf7f03eb4a39d6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-03-27 04:24:11 +01:00
Giuseppe D'Angelo 8414a0aa2c Tests: check the output of QFile::open
Wrap the call in QVERIFY.

tst_QTextStream::read0d0d0a was also faulty as it *never* opened
the file because of a broken path. Fix it with QFINDTESTDATA.

Change-Id: I61a8f83beddf098d37fda13cb3bfb4aaa4913fc5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-27 04:24:11 +01:00
Allan Sandfeld Jensen cccda0e62d Fix potentially unaligned 128-bit store/loads
QColorVector is not forced to 128-bit alignment.

Change-Id: Ifacc171296ddddda742d49745372b47585e40802
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-27 02:13:27 +01:00
Allan Sandfeld Jensen d89063646e Add QColorSpace::isValidTarget
To indicate color spaces that can not be used as a target,
but only as a source.

Change-Id: Iae79e3533599c112872d171a2f45178029be89dc
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-27 02:13:27 +01:00
Thiago Macieira 58f93994d9 qHash: fix compilation of SipHash64 on 32-bit: shift >= 32
Amends aadf1d447c because size_t on 32-bit
platforms is 32-bit.

qhash.cpp:331:15: error: left shift count >= width of type [-Werror=shift-count-overflow]

Change-Id: I5f663c2f9f4149af84fefffd17c0567b17f832ce
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-03-26 16:14:55 -07:00
Thiago Macieira facb6f9477 QCborMap: add missing comparator to QCborValueConstRef
And ensure all combination of CBOR types are tested.

Amends e5ebb9022a

Change-Id: I5f663c2f9f4149af84fefffd17c02d352cd41f3f
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2024-03-26 16:14:55 -07:00
Thiago Macieira a30912b906 QString::arg: apply the Qt 7 Unicode digit semantics to the bootstrap
Change-Id: I01ec3c774d9943adb903fffd17b7ef0a106944ca
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-26 15:14:55 -08:00
David Faure 30225da91f qErrnoWarning: downgrade from critical to warning
The name says it's a warning, it's pretty unexpected that it should
lead to a critical message.

One case where this is a problem is QTBUG-48488
where merely printing with "Microsoft Print To PDF" and canceling
the file dialog leads to "QWin32PrintEngine::begin: StartDoc failed"
as a *critical* message. Some Windows applications have a message
handler that shows a msgbox in case of a critical message,
and getting such a msgbox after canceling the file dialog seems very
wrong.

Task-number: QTBUG-48488
Pick-to: 6.7
Change-Id: I1c842340dd2faf2be6e64e0522f9e2b33547d3cf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-27 00:14:02 +01:00
Joerg Bornemann c11beb8d32 configure: Fix -c++std and -sanitize options
This amends commit 110f656da9.

Command line options with a TYPE that denotes a custom command line
argument handler cannot set a feature "foo" anymore by just setting
INPUT_foo to "yes". Instead, they must use the newly introduced
functions qtConfCommandlineEnableFeature and
qtConfCommandlineDisableFeature.

These functions will set INPUT_foo and augment the input with the
information "this input is of boolean type". This information is used
when deciding whether to use this input as feature switch.

Change-Id: I83c691cc57424159148f059c2a1c8cd72e39ee63
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-27 00:14:02 +01:00
Joerg Bornemann e685bfe764 configure: Remove the -W argument
This did nothing since the port to CMake, it's undocumented, and we
didn't receive any complaints about its brokenness.

Use CMAKE_CXX_FLAGS to pass arguments like -Wall to the compiler when
building Qt.

Change-Id: Id9976167013607a88959416f789754186a7ed121
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-27 00:14:02 +01:00