74548 Commits

Author SHA1 Message Date
Andreas Eliasson
f27588348b Doc: Add \note to QTest::qWait() to consider QTRY_*() macros instead
There seems to be a case that qWait() is a source of eventual pain.
Add \note to encourage the use of the QTRY_*() macros.

Fixes: QTBUG-136538
Pick-to: 6.10 6.9 6.8
Change-Id: I52daa8c38a55f8db66d8c941c7cbfff7b7060a5b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2025-06-02 14:40:54 +00:00
Tim Blechmann
e6dfd2e9b0 Cocoa: QNSView - fix memory leak of QContainerLayer
setLayer will increment the reference count, so QContainerLayer is
leaked, as it is not autoreleased.

Pick-to: 6.10
Change-Id: I43cef8bbf9ccb9b849322edfb1e7ab75f5ae9898
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-06-02 10:29:27 +00:00
Tim Blechmann
c8ebe2e5cd Cocoa: QNSView - fix memory leak of QNSViewMenuHelper
QNSViewMenuHelper is leaked, as dealloc did not nil it to decrement the
reference count.

Pick-to: 6.5 6.8 6.9 6.10
Fixes: QTBUG-131655
Fixes: QTBUG-137161
Change-Id: I783c400d1300046118ad3e12816e84709cc9d793
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-06-02 10:29:23 +00:00
Eskil Abrahamsen Blomfeldt
ab7a80a955 DirectWrite: Avoid infinite recursion with broken font data
If a font has an em square size of 0 it is not going to be useful.
However, if one was encountered we returned a default value to
avoid division by zero. The default implementation called ascent(),
which would depend on the em square size again and we would get an
infinite recursion for these fonts.

To avoid this, we simply return a default value of 16 in the case
of a broken font. (The Apple spec gives the range 64 .. 16384 for
the em square and the Microsoft spec says 16 .. 16384, so we use
the smallest of the two.)

Fixes: QTBUG-137277
Pick-to: 6.5 6.8 6.9
Change-Id: I63779e44c10c7021486787d1e1e818f4c6e47835
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2025-06-02 11:34:02 +02:00
Samuli Piippo
b23da37d71 CMake: qtwaylandscanner doesn't need Wayland::Client
Remove dependency to Wayland::Client as it's not needed and
prevents building qtwaylandscanner for Windows where Client
is not supported but scanner is needed for cross-compilations.

Change-Id: Ia38dda58c0800799673ae2d1e29626ce6b399f04
Reviewed-by: Liang Qi <liang.qi@qt.io>
2025-06-02 05:22:52 +00:00
Ahmad Samir
1f2863ae48 qdataurl: fix parsing parameter values with percent-encoded comma
Change-Id: I2faa8ce7c9932eb82a853421290c39a37ad91bcf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-01 19:39:59 +03:00
Ahmad Samir
c140d9ab8e qdataurl: modify the percent-decoded byte array directly
Parse the content-type first, then slice the byte array. This is useful
especially for large base64 payloads.

Drive-by, use QUrl::toEncoded(), it's the same result but more succinct
syntax; pointed out in code review. Also remove an old comment, it's not
relevant anymore since QUrl::encodedPath() isn't available any more in
Qt 6.0:
https://code.qt.io/cgit/qt/qt.git/commit/?id=c0d237b7aa6e0257e3c3eee7336deaed1cf68252

Change-Id: Id69345f315dab934d0f2867008bf4fe29d63cac9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-06-01 19:39:49 +03:00
Frédéric Lefebvre
4db3961ee1 Fix flaky tst_QFocusEvent::checkReason_ActiveWindow on openSUSE
tst_QFocusEvent::CheckReason_ActiveWindow is flaky on openSUSE where
the childFocusWidgetOne is unable to receive focus after d has been
hidden.

This is due to some asynchronicity when setActive is being called
while d is already active.

Remove the call to activateWindow on d as it is already active by
calling show.

Pick-to: 6.9 6.8 6.5
Change-Id: Id01c6704122df42982d65d28ddb94d184d00d9aa
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-06-01 14:07:43 +02:00
Frédéric Lefebvre
6c7f61f081 Fix flaky tst_QMdiArea::currentSubWindow()
tst_QMdiArea::currentSubWindow() is flaky and fails when the
dummyTopLevel window is not marked as active before verification.

Verify that the dummyTopLevel is active, before checking what is the
active topLevel window.

Fix the flakiness of tst_QMdiArea::currentSubWindow() on Ubuntu 24.

Pick-to: 6.9 6.8 6.5
Change-Id: If5b85713d0bfec40e2722c471f7c3ba5ac73171c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-06-01 14:07:29 +02:00
Marc Mutz
71842cfb89 QXdgDesktopPortalTheme: normalize SLOT argument
Non-normalized signatures passed to SIGNAL or SLOT macros require a
normalization step before the actual connection can be made, which
takes extra time and extra memory.

Also, a normalized signature is generally smaller than a
non-normalized one, so we save even in executable code size.

Amends a833d5682ac44571e13568336f2bd3ec7deb1d6d.

Task-number: QTBUG-116197
Pick-to: 6.9 6.8
Change-Id: I942f5ac262f05ca4486b2ed2a22654d1a12a3ef0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2025-05-31 15:43:22 +02:00
David Boddie
475c951d69 Doc: Fix auto-links to deprecated functions
Change-Id: Id4456eef3440734add2d804d186966e253335b7c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2025-05-31 06:41:36 +00:00
Eskil Abrahamsen Blomfeldt
6854ea6336 dwrite: Support additional font names for system fonts
Fonts have multiple name fields that users may expect to be able to
use for referring to them. In particular, on Windows it has become
common to use a legacy font family name which contains the sub-family
of the specific font, because of backwards-compatibility reasons.

This is not technically the family of the font, but native
applications will typically list them as such anyway, and Qt would
also do this prior to Qt 6.8 because the GDI backend prioritizes
these.

When we moved to DirectWrite as the new default, these legacy names
for system fonts disappeared from the families list, which is
perceived as a regression.

Now, there was already an implementation for getting the legacy names
for fonts for application fonts, but this had not been implemented
for system fonts when populating the font database.

We rectify this by sharing the code which gets the additional font
names and also calling this when populating system fonts.

[ChangeLog][Windows] Fixed an issue where legacy names such as
'Arial Narrow' would no longer be listed as separate font families.

Fixes: QTBUG-135817
Pick-to: 6.8 6.9
Change-Id: I2e1b42b7be926e3b5af7bb2aab3ebe5a1fbe29de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-05-31 08:41:18 +02:00
Tor Arne Vestbø
b490623b0c Remove note saying Qt::AA_ShareOpenGLContexts must be set before qGuiApp
Amends 4a7ccb65f0065e878c5762db05eca9c5cd6731e5.

Change-Id: I597713df2832406336486b683df1b5dd2bceb850
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2025-05-31 01:16:26 +02:00
Tor Arne Vestbø
e9dbdaa499 Make QOpenGLContext::globalShareContext() lazy creation thread-safe
We move the context to the main thread (or the thread of qGuiApp),
as that's where it will be deleted.

Amends 4a7ccb65f0065e878c5762db05eca9c5cd6731e5.

Caught-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Change-Id: I8e5dc512dce02d22980730a46474b2262684a713
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2025-05-31 01:16:23 +02:00
Alexey Edelev
11f149d987 Introduce qt_internal_set_module_transitive_properties
The function sets properties on target that then are propagated
transitively. This only works with Qt modules, but can be extended
for other Qt targets later. These transitive properties not necessarly
require Qt be built using CMake versions supporting transitive
properties(>= 3.30). Properties are stored and exported within the
Qt module unconditionally and can be used in user projects, if
CMake version allows this.

Change-Id: I1ff6f1099753784c721dc1e3cd972dcd9dafedc4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-05-31 00:44:07 +02:00
Alexey Edelev
c6f15f57cd Introduce Qt<Module>TransitiveExtras.cmake for Qt modules
This file sets the transitive module properties provided by
Qt Module that is built using CMake versions < 3.30. The idea
is to not limit user projects capabilities and allow using
transitive Qt Module properties if user CMake version allows it.

If Qt Modules are built using CMake versions >= 3.30 this code is noop,
since values are stored directly in the respective
INTERFACE_properties.

Change-Id: I5a0bc0aa4f79a04c81dfa0fee1d37cfee5935b0f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-05-31 00:44:07 +02:00
Michal Klocek
fb4c1257d8 Add run opengl tests feature
On Woa cross compile we want to compile with opengl feature,
however tests windows arm nodes do not have opengl installed
add a feature to skip the tests preventing the crash otherwise.

Note this is just temporary workaround and should be reverted
as soon as opengl libs land on windows arm vm nodes.

Task-number: COIN-1211
Change-Id: Iaae205b9cc10bd17e82152a44b2e976e4321d00d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-05-30 22:24:56 +00:00
Giuseppe D'Angelo
7c0a96785f Wayland: support adoption of native EGL contexts
QWaylandIntegration does not implement the
QNativeInterface::Private::QEGLIntegration interface. This means that
trying to create a QOpenGLContext from a native EGL context fails,
and QNativeInterface::QEGLContext::fromNative() always returns nullptr.

This commit makes QWaylandIntegration inherit from QEGLIntegration and
implement its interface. This in turn requires adding a new API to the
HW interfaces (implemented by both the EGL and the brcm-egl
integrations) to request adoption of a native context.

Fixes: QTBUG-110758
Change-Id: I81c08fcf1110b5e9e1d8739532df9ce78410d694
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-05-30 19:45:39 +02:00
Giuseppe D'Angelo
89ec9276fc EGL: undef X11 macros
Including egl.h may transitively include X headers which define a bunch
of macros that clash against our code. Undef these macros just after EGL
is included. This was already done locally in eglfs, but the same
problem appears in any code that uses qt_egl_p.h, like the Wayland
platform plugin.

Change-Id: I2fbd617f57de6ae7366795aabacd81c639903699
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-05-30 19:34:59 +02:00
Frédéric Lefebvre
f6126ccb1c Fix flaky tst_QScroller::overshoot on multiple Windows versions
tst_QScroller::overshoot is flaky on multiple versions of Windows 11.
The failure occurs in the part testing overshoot always off and slow,
where the result of the deltaPos and the startPos are equal to 0
instead of being smaller.

Slightly increase the value of touchEnd so that deltaPos is smaller.
As a drive-by, constify a local variable.

Fix the flakiness on Windows 11 24h2 mingw.

Fixes: QTBUG-137201
Change-Id: I6dacc7b5ac140f427fa6fbb8fddb5447ae14a233
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-05-30 17:34:59 +00:00
Mitch Curtis
c29868830c QtFlagHandlingHelpers.cmake: account for GCC when producing error
This changes the error message I get when configuring with
-DFEATURE_sanitize_thread=ON from:

    CMake Error at cmake/QtFlagHandlingHelpers.cmake:183 (message):
      Platform linker doesn't support erroring upon encountering undefined
      symbols.  Target:"Core".
    Call Stack (most recent call first):
      cmake/QtModuleHelpers.cmake:898 (qt_internal_add_link_flags_no_undefined)
      src/corelib/CMakeLists.txt:30 (qt_internal_add_module)

  to:

      ERROR: detected a std::atomic implementation that fails for function pointers. Please apply the patch corresponding to your Standard Library vendor, found in qtbase/config.tests/atomicfptr

    CMake Error at cmake/QtBuildInformation.cmake:240 (message):
      Check the configuration messages for an error that has occurred.
    Call Stack (most recent call first):
      cmake/QtBuildInformation.cmake:59 (qt_configure_print_summary)
      cmake/QtBuildRepoHelpers.cmake:393 (qt_print_feature_summary)
      cmake/QtBaseHelpers.cmake:287 (qt_build_repo_end)
      CMakeLists.txt:36 (qt_internal_qtbase_build_repo)

Pick-to: 6.8 6.9
Change-Id: If6243362521802d8b1348ae53d744c33add814f1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-05-31 00:16:41 +08:00
Morteza Jamshidi
c2bdf7636e Use WS_EX_NOACTIVATE to prevent window from getting focused
On top of handling ActivateWindowEvent,MouseActivateWindowEvent and
PointerActivateWindowEvent events and returning MA_NOACTIVATE we can
also set the window extended style to prevent windows from stealing
focus in special cases.
Also on top all those mentioned events, when the window is requested
to get keyboard focus, it should check if the window accepts focus
or not. If it does not, then it should inform the underlying system
that the window does not accept the focusIn event.
[ChangeLog][Windows] Windows with flag Qt::WindowDoesNotAcceptFocus
no longer have a taskbar entry.

Pick-to: 6.9
Fixes: QTBUG-131714
Change-Id: I79f767b1622449ba05b41f8b80bf390d8cecfff8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Zhao Yuhang <2546789017@qq.com>
2025-05-30 18:16:41 +02:00
Fabian Kosmale
e115c60b6d Q(ObjectBindable)Property: Properly support comparisons
Before, it was possible to do some comparisons due to the implicit
conversion to T. However, that does not work in all contexts.

Fix this by explicitly declaring the comparison operators. We need to
a) use the helper macro directly, as the operartors are only available
   if the underlying type has them and
b) mark the operator as noexcept(false), as capturing a property in a
   binding might allocate.

Fixes: QTBUG-134921
Change-Id: I2855964ba481b9e7778a4a7076528593549910fe
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-05-30 18:16:41 +02:00
Marc Mutz
dc45850c1e Mark QUrl* classes as security-critical
These classes, too, are usually in the first line of defense, handling
tainted data before anything else had the chance to verify it.

Amends 8df072fc8006510c9b743e8ffedaaf51a876883a.

QUIP: 23
Task-number: QTBUG-135187
Pick-to: 6.9 6.8
Change-Id: I21dbea39078a583f0bbf7737bd7151893fb98d17
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
2025-05-30 18:16:41 +02:00
Marc Mutz
e4f8601236 QMetaObject: extract helpers from indexOf*() methods
This makes the different functions more similar to each other, thus
facilitating adding a warning about non-normalized arguments to them
in the next step.

Task-number: QTBUG-135572
Pick-to: 6.9 6.8 6.5
Change-Id: Ia2b82928e9a24fb9d43b43933b9a9c5308fa2835
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-05-30 18:16:41 +02:00
Marc Mutz
3e98657898 QPainter: make Private::d_ptrs a QVLA<unique_ptr>
This way, we remove the impedance mismatch between QPainter::d_ptr
(which already is a unique_ptr) and Private::d_ptrs, which still dealt
in raw pointers, simplifying the code.

Since we're now owning the objects in d_ptrs, add an assertion that
d_ptrs is empty on QPainter destruction.

Coverity-Id: 425479
Change-Id: I849e80752b4bc5a71aef8d47663c6ffc9fdca9f7
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-05-30 18:16:40 +02:00
Venugopal Shivashankar
e670a6d77b Doc: Update the HTML tab config
- Added translat='no' attribute to input and style
- Added the missing linefeeds

Change-Id: I51ffe1bd0eb8d06bab7a7eedcd862e88fe794588
Pick-to: 6.9 6.8
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2025-05-30 18:16:40 +02:00
Aurélien Brooke
433360c6cd rhi: vulkan: make it easier to hunt VMA leaks
When leaking a RHI resource, the VMA asserts (VMA_ASSERT_LEAK) before
the RHI has a chance to list the leaks.

Plug the VMA leak output to the QDebug infrastructure, and give names to
the VmaAllocations so that we know exactly what leaked. This is only
enabled for debug builds or when QT_RHI_LEAK_CHECK is set.

Change-Id: Ief0e46cceaefb2e736542f9764264c29b0c28c64
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2025-05-30 12:23:09 +02:00
David Edmundson
70e75851bf wayland: Reset surface on QWindow type change
Changing the role between toplevel and popups is illegal on wayland even
if the window is not visible. We need to reset to the wl_surface.

This meant we cannot call setWindowFlags in the constructor.

QWindow::flags / QWindow::windowType changes after
QPlatformWindow::setFlags has finished, so we need to use our own flags
rather in XdgShell rather than pulling them from the QWindow.

Task-number: QTBUG-136110
Change-Id: I8b54b7ea8a768a539178395e53cc63a64fd80232
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2025-05-30 05:16:53 +00:00
Thiago Macieira
7838a57d29 QLocale: remove WhiteSpacesAllowed mode from qt_asciiToDouble()
It's no longer used. It was used by QByteArray{,View}::toDouble() but
that caused an all-space string to be considered a valid conversion. Now
that those functions do the trimming themselves, we don't need this
mode.

Pick-to: 6.9
Change-Id: I2c24d3011fd7969bcc92fffd802a5d78ca28c157
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2025-05-29 19:50:47 -07:00
Thiago Macieira
61b17127ae QByteArray: make toDouble() reject space-only strings
This does not affect leading and trailing spaces, which remain allowed.
This is only about a string containing only spaces, which used to be
rejected prior to Qt 5.9 and are rejected with QString (unit tests added
to confirm).

Drive-by indent one QString test row, which I've also reordered so null
comes before empty.

[ChangeLog][QtCore][QByteArray & QByteArrayView] Fixed an old regression
that caused toDouble() and toFloat() to return ok = true for a string
containing only whitespaces.

Pick-to: 6.9 6.8
Fixes: QTBUG-137038
Change-Id: Ia6f7714c5e289317de60fffd0f8aa6d2198a91ef
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-05-29 19:50:47 -07:00
MohammadHossein Qanbari
2fe9eed3fd QGnomeTheme, QGtk3Theme: Refactor and Simplify DBus Interactions
This patch refactors the DBus integration in both QGnomeTheme and
QGtk3Theme to centralize and simplify the portal and settings access
logic. Previously, the codebase contained duplicated and scattered DBus
logic for querying GNOME/GTK appearance settings, such as color scheme
and contrast, which were implemented separately in both QGnomeTheme and
QGtk3Theme.

The patch introduces a new QGnomePortalInterface class which
encapsulates all DBus interactions related to GNOME/GTK appearance
settings. The old DBus interface logic is removed from QGtk3Theme and
QGnomeTheme, and replaced with calls to the unified
QGnomePortalInterface. The update also ensures signal-based updates for
theme and appearance changes via the new interface.

Change-Id: I5440f7ac00f956b846b18bd890113af0044482f0
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2025-05-30 03:25:04 +02:00
MohammadHossein Qanbari
933338f947 Dbus: Enhance process of determining color scheme and contrast
The XDG portal has changed some interfaces since version 2. We already
support the changes in version 2. The DBus listener and GNOME theme do
not work properly if the machine uses version 1. This patch ensures
that the color scheme and contrast preferences work fine with the older
version.

Regarding contrast preference, the XDG desktop portal introduces the
`contrast` interface in version 2. This patch uses the GNOME settings
as a fallback method to determine the contrast preference in case the
XDG contrast interface is not accessible. The contrast value retrieved
from the DBus varies depending on the provider.

Regarding the color-scheme interface, the only difference between XDG
portal versions 1 and 2 is the method name. The method name to read the
color-scheme value from the portal setting changed to `ReadOne` from
`Read`. This is also used for reading the contrast value.

Change-Id: Id4d81ecf5465bbbab64c41e431a8d4d86e63849a
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2025-05-30 03:25:04 +02:00
David Edmundson
e9eba1ef0d wayland: Drop ShellIntegration::handleExpose
This was effectively deprecated when the virtual isExposed was added and
we moved towards a state based system.

The region of the exposed geometry is something we want to phase out and
is of no use to shells.

The other usage in XdgShell was for updating contentGeometry on first
show, but this is now an explicit call updated by QWaylandWindow
directly.

Change-Id: I09a083fcfcc69c444ca4270f425b591b046e0617
Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
2025-05-29 23:06:50 +03:00
David Edmundson
27283b02ca wayland: Make initial commit for surface state opt-in
After setting up the shell surface we setup the initial state and have
to commit the surface to apply the surface role in order to get a
configure event from the compositor.

This is not a requirement for subsurfaces, and can be skipped.

It is also problematic for some 3rd party shells, such as
ext-session-lock-v1, which has a different setup behaviour.

Task-number: QTBUG-136337
Change-Id: I9e7874ec2f4150e24eb4790384eacc4123f9552b
Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
2025-05-29 23:06:49 +03:00
Michael Weghorn
854d7021b8 a11y uia: Report locale via UIA_CulturePropertyId
Map QAccessible::Attribute::Locale to
UIA_CulturePropertyId [1] in the Windows UIA
accessibility bridge:

> Identifies the Culture property, which contains a
> locale identifier for the automation element (for
> example, 0x0409 for "en-US" or English (United States)).

In a test with 2 spinboxes whose locales were explicitly
set to

* QLocale(QLocale::English, QLocale::UnitedStates))
* QLocale(QLocale::Chinese, QLocale::China))

, retrieving the current value of UIA_CulturePropertyId (30015)
using NVDA's Python console gives the expected result:

With the spinbox whose locale is set to English/United States:

	>>> hex(focus.UIAElement.GetCurrentPropertyValue(30015))
	'0x409'

With the spinbox whose locale is set to Chinese/China:

	>>> hex(focus.UIAElement.GetCurrentPropertyValue(30015))
	'0x804'

as "[MS-LCID]: Windows Language Code Identifier (LCID) Reference" [2]
lists these identifiers as follows:

* 0x0409 en-US
* 0x0804 zh-CN

[1] https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-automation-element-propids
[2] https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f

Task-number: QTBUG-137144
Change-Id: I2b0cad9ab7ede9f01dee3d7f3efddb8c5335caaf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-05-29 21:59:26 +02:00
Michael Weghorn
bb2121551c a11y: Report QWidget locale
Implement support for QAccessible::Attribute::Locale
(newly introduced in a previous commit) for QWidget
by introducing QAccessibleWidgetV2 which subclasses
QAccessibleWidget and implements the
QAccessibleAttributesInterface to report the QWidget::locale
property for QAccessible::Attribute::Locale.
(Leave QAccessibleWidget unchanged for ABI compatibility.)

Switch QAccessibleWidget subclasses to subclass the
newly introduced QAccessibleWidgetV2.

Add a corresponding unit test.

Task-number: QTBUG-137144
Change-Id: I61385b17ee1272801ad769da5a807ca4e068cfb2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-05-29 21:59:26 +02:00
David Edmundson
e9e025a085 wayland: Move to synchronous expose events
Move to synchronous delivery for expose events.

One twist with this the expose event from geometry events. This event
normally comes from the display server, but in our case is synthesised
by the backend. This needs to be deferred, but we can do that
internally.

The move to synchronous events allows us to drop an old workaround for
renders finishing after a window is hidden.

The mInResizeFromApplyConfigure guard in geometry changes existed as all
configure events trigger their own expose event and we didn't want two.
Not the sending is deferred it's implicity handled by the
mLastExposeGeometry check.

Task-number: QTBUG-137021
Change-Id: I8758c083e4d44a04606ae72f1019f2bc577f51f6
Reviewed-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
2025-05-29 21:06:53 +03:00
MohammadHossein Qanbari
6a21e0e212 QGnomeTheme: Enhance system color scheme detection
Previously, QGnomeTheme relied on the theme name to determine the
system's color scheme when a "SettingChanged" signal was emitted via
dbus. However, this approach overlooked the "color-scheme" property in
the signal, which directly provides the updated light/dark mode
information.

This patch updates QGnomeTheme to use the "color-scheme" property from
the dbus signal, ensuring accurate detection of changes in the system's
color scheme. The theme name fallback is retained for scenarios where
"color-scheme" data is not provided.

See also the XDG Desktop Portal documentation:
https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Settings.html

Related to this commit: 4ac89dad78772ce90649b9846efa17319deba28f

Task-number: QTBUG-133595
Change-Id: I2c3982fd9871d76184f1b4233d95e7a5e0a34ad1
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2025-05-29 16:34:06 +02:00
Bartlomiej Moskal
393c294e10 Android: Avoid lazy initialization of QAndroidPlatformServices
In commit ff51ea5418d131248b07e327513b41dad1231f37, lazy initialization
was introduced for QPlatformServices, including
QAndroidPlatformServices. However, this approach causes a regression.
When QAndroidPlatformServices is lazily initialized, the intent listener
registration is delayed. As a result, handling custom URL schemes is
affected - especially those coming from external applications.

To address this issue, this commit removes lazy initialization for
QAndroidPlatformServices.

Fixes: QTBUG-135489
Pick-to: 6.9 6.8 6.5
Change-Id: I24becdf4ac573e7a2ca101cfbc27560d1eb4adef
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-05-29 08:01:13 +00:00
Dheerendra Purohit
d446df7599 QNetworkRequest: fix minor typo referencing non-existent method
Replaced incorrect setTimeout() with setTransferTimeout()

Pick-to: 6.9 6.8
Fixes: QTBUG-111993
Change-Id: I1eef02cda1be00d6ab99769f4a9b4406ac92d389
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2025-05-29 04:22:43 +00:00
Christian Ehrlicher
d34754ea81 QStyleSheetstyle: misc cleanup of QStyleSheetBorderImageData
Remove unused member 'image' from QStyleSheetBorderImageData and replace
c array with std::array<>.

Pick-to: 6.9
Change-Id: I149ef72e443027a6b6d30f25e8c7b1adf4138fc5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-05-28 21:54:52 +02:00
Michael Weghorn
da3422ca15 a11y: Introduce QAccessible::Attribute::Locale, bridge to AT-SPI
Introduce a new Locale value for the QAccessible::Attribute
enum class that can be used to specify the locale
of an accessible object.

Use this to implement support for the
"Locale" property of the AT-SPI Accessible interface. [1]

If no locale has explicitly been specified, report
the default locale in the AT-SPI adaptor, as is
already the case in the implementation of the
"GetLocale" method of the AT-SPI Application
interface.

Being able to explicitly specify a locale is of
particular interest when an application contains
objects whose locale differs from the default
application locale, e.g. documents or paragraphs
written in a different language.

Demo LibreOffice change making use of this
new API: [2]

Sample use case with the above-mentioned LibreOffice
change in place:

1) start LibreOffice Writer, using English UI
   and document language
2) type "Hello world" for the first paragraph
3) press Enter to create a new paragraph
4) copy-paste "你好世界" ("Hello world" in Chinese)
   into the new paragraph
5) start Accerciser
6) select the first paragraph in Accerciser's treeview
   of the LibreOffice a11y hierarchy
7) query locale in Accerciser's IPython console

    In [1]: acc.get_object_locale()
    Out[1]: 'en_GB'

8) select the second paragraph in Accerciser's treeview
   of the LibreOffice a11y hierarchy
9) query locale in Accerciser's IPython console

    In [2]: acc.get_object_locale()
    Out[2]: 'zh_CN'

For UIA on Windows, UIA_CulturePropertyId [3] seems
to be the equivalent property that the new attribute
could be mapped to (to be done separately, not implemented
in this commit).

[1] 2e65b0877d/xml/Accessible.xml (L55-67)
[2] https://gerrit.libreoffice.org/c/core/+/185709
[3] https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-automation-element-propids

[ChangeLog][QtGui][QAccessible::Attribute] Added new
Locale enum value that can be used to specify the
locale of an accessible object.

Fixes: QTBUG-137144
Change-Id: Ice11b9e45b512305dbb8195961b8b08e1389c69e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-05-28 21:44:13 +02:00
Ivan Solovev
ca50d72778 QtConcurrent: mark as security-significant
The QtConcurrent module applies user-provided map-, filter-, and reduce-
functions (or their combinations) to user-provided data.
It does not make any assumptions about the provided functions and
data, apart from input/return type validation. It also does not parse
the provided data and does not have any way to sanitize it.

Mark all the source and header files in the module with the default
security-significant score to confirm that the code was reviewed.

QUIP: 23
Fixes: QTBUG-135179
Pick-to: 6.9 6.8
Change-Id: I2c1b315b837111627c2f0ce6e2ade704415972e2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-05-28 18:00:36 +02:00
Joshua Goins
c50ede0b20 Add autotest for ensuring restoring cursor shapes doesn't regress
We now try to keep track of the cursor state for each window, but was
missing an autotest (modeled after QTBUG-133541.)

Pick-to: 6.8 6.9
Change-Id: I9d081f5a3cc8bdaa860d48beb5f105afa424f102
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2025-05-28 16:34:45 +02:00
Joerg Bornemann
286e309373 Revert "CMake: Make generated pkgconfig files relocatable"
This reverts commit 731d9a13956ef40e3f563f5ff5ff5c250b8d6d94.

Reason for revert: ${pcfiledir} cannot be used, because this
leads to wrong prefix values if PKG_CONFIG_SYSROOT_DIR is set.

See the comments of the associated task for instances of this
problem in other projects.

Pick-to: 6.8 6.9
Task-number: QTBUG-136210
Change-Id: I2a60946828f07866b931dacfe0ef81346f1aac9d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-05-28 14:34:45 +00:00
David Boddie
fbc6b0c6e6 Doc: Fix link to removed QFontMetrics::width function
The function was removed but documentation still referred to it.

Change-Id: I2fc1ef2ffc9cdc93e059dd1854816e6aa86dc972
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2025-05-28 12:05:57 +02:00
Alexandru Croitor
674a6dc5f6 CMake: Stop spamming CMP0156 debug messages
We set the CMP0156 policy to NEW for Apple platforms for each created
Qt target, but the debug message is generic, so we should only show it
once.

Amends c20d7bcb86361d0c9f8af3807dcad9db1a3a5ca0

Pick-to: 6.8 6.9
Task-number: QTBUG-135978
Change-Id: I332bd357999647df1d5f715d154fb568911889b1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-05-28 11:38:24 +02:00
Alexandru Croitor
c2f7004204 CMake: Prefer target arch qmltestrunner when searching for it
Currently qmltestrunner is built as a tool, instead of an app.

That means that for most cross-compiling platforms (aside from Yocto),
the build system will look for a host binary when referring to the
qmltestrunner target. We want to look for the target platform binary
instead.

Switch the code around to prefer looking for the target platform
binary via find_program, before falling back to referring to it by
target name.

In the future when we change qmltestrunner to be an app, and also
expose its target platform binary as a target name, this should not be
needed anymore, and we could rely solely on the target name.

Amends 9edcc4690665496c2b6f15876b3979487dbad22a

Task-number: COIN-1211
Task-number: QTBUG-137005
Change-Id: If2eb93d8832a17aae3d0648d1d0f5997805796fa
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-05-28 11:35:07 +02:00
Edward Welbourne
6f8431b930 Modernize string usage in corelib/time/ tests
This incidentally lets me turn on QT_NO_CAST_{FROM,TO}_ASCII for them.

In the process, convert some test-cases to addRow() and use plain QBA
in place of newRow((QString arithmetic).toLocal8Bit().constData()),

Change-Id: I0117338dd927fc4eee74688ac86975508fa43b51
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-05-28 11:28:10 +02:00