Commit Graph

64539 Commits

Author SHA1 Message Date
Tasuku Suzuki
92a9df5d05 Fix build with -no-feature-menu
Change-Id: If207eac9a237986d51de4665b2f6749fb4e8e2d2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-16 11:31:15 +09:00
Tasuku Suzuki
d5dbafca1f Fix build with -no-feature-dockwidget
Pick-to: 6.6 6.5
Change-Id: Ie6d4e9a2dcfa6da5392bfb2507aafc57b6511ba3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-16 11:31:15 +09:00
Eskil Abrahamsen Blomfeldt
98ca28f7a6 Upgrade to Harfbuzz 8.3.0
Pick-to: 5.15 6.2 6.5 6.6 6.6.1
Fixes: QTBUG-119150
Change-Id: I80f21f6f27cce14a1e91e822c3681ec491491ff1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-16 02:55:10 +01:00
Volker Hilsheimer
f4c32f729c Cocoa: implement QScreen::orientation
Get the rotation value from the Core Graphics API, and map it to the
Qt::ScreenOrientation values.

Change-Id: I9bc9f37f34e00affee15e6ce0eace70d853eab0c
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-16 02:55:10 +01:00
Friedemann Kleint
cea33d7387 uic: Use fully qualified enum value for remaining cases
Task-number: PYSIDE-2492
Task-number: PYSIDE-1735
Task-number: QTBUG-118473
Change-Id: I4e5e328b0757145df2ceb550e2f90a64be91d5e9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-11-15 23:40:24 +01:00
Friedemann Kleint
effe9bd026 uic: Write fully qualified enum values for QMainWindow enumerations
Task-number: PYSIDE-2492
Task-number: PYSIDE-1735
Task-number: QTBUG-118473
Change-Id: Ief50914bae3cc8e55f61113e8c8b6d6d24fe2c0f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-11-15 23:40:24 +01:00
Marc Mutz
39ce0e3982 Fix \since of QWeakOrdering and QStrongOrdering
Amending c6fe64b17c, which (thankfully)
didn't make the 6.6 feature-freeze cut.

Change-Id: I6c206020af3ba752422cc9f1adaebd7bbbd96024
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-15 23:40:24 +01:00
Friedemann Kleint
2e82796022 uic: Prepare for encountering fully qualified enum values in new .ui files
This means checks have to be rewritten using endsWith().

It mainly affects the QSizePolicy handling whose values originate from
different sources, including numbers. To address this, refactor the
code to deal with unqualified enum value names and introduce a helper
function that fully qualifies the enumeration when writing out.

Pick-to: 6.6 6.5
Task-number: PYSIDE-2492
Task-number: PYSIDE-1735
Task-number: QTBUG-118473
Change-Id: Iccbb884777aa9c696fbf48f9d7329353ef945b0f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-11-15 23:40:24 +01:00
Marc Mutz
e6febd05d9 [doc] QBENCHMARK_ONCE: fix typos
... and remove a prematurely-ending parenthesized remark.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: If0a2f482c45128739ed6cea1d8385ea34f45b094
Reviewed-by: Isak Fyksen <isak.fyksen@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2023-11-15 23:40:24 +01:00
Marc Mutz
b08ba96fd0 QBENCHMARK: mark loop operations as noexcept
Tell the compiler that next() and isDone() cannot throw, so it doesn't
need to create exception handling code. This might yield more faithful
benchmark results for micro-benchmarks.

As a drive-by, mark isDone() as const, too.

Change-Id: Ifac3d9ee2f4df524e780fd07423e26bb5e87dab3
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Isak Fyksen <isak.fyksen@qt.io>
2023-11-15 23:40:24 +01:00
Morten Sørvig
6017695bfa Windows: Improve hidpi style drawing and metrics
Follow-up change from enabling DPI awareness, which
caused some style elements (for instance check boxes)
to be rendered incorrectly on non-primary displays,
when there is a difference in DPI between displays.

Use two approaches to get system metrics and themes:

* Use forDpi() API variants and query at 96 DPI for style
  metrics, that are in device independent pixels. These are
  metrics which are used for layout calculations.

* Get theme metrics at the target display DPI, and scale
  to device independent pixels when needed. This is used
  for OpenThemeData(), since this theme is used for drawing
  as well and needs to be in device pixels.

One approach is not used any more:

 * Get metrics for the main display, and scale by the ratio
   between the main and target display.

Change the theme cache to cache themes per window handle (HWND).
This is required since OpenThemeData() returns theme data for
a specific DPI, which means we can no longer use a shared
cache.

Clear the cache on theme change, DPI change, and when
the window is destroyed. This  handles cache invalidation
when the window is moved to a different screen, and also
when the DPI for a screen is changed.

Move the cache implementation to QWindowsStyleSupport
in QtGui, where it can be accessed by both the style and
windows platform plugins.

Task-number: QTBUG-110681
Change-Id: I5a4ff3a3753762bad8a51d08e51e8013bc7816a1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-15 21:52:24 +01:00
Assam Boudjelthia
d6861926a1 Android: set displayManager listener after QtLayout is initialized
the QtDisplayManager listener uses m_layout but it can be called
before m_layout is actually initialized, so set the listener after
the layout has been initialized.

Task-number: QTBUG-118077
Fixes: QTBUG-119007
Fixes: QTBUG-119134
Change-Id: Icebc350f09210c12dbd011f86ce88a90b6f27d12
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-15 22:52:23 +02:00
Axel Spoerl
2c96f51771 QDockAreaLayout: implement widget based add() and remove()
The item_list of a QDockAreaLayoutInfo has abstraction methods for
reading the item list. Adding to and removing from the item list is
done directly, by using the QList api.

Implement an abstraction, that takes a QWidget *.
The argument may either be a QDockWidgetGroupWindow or a QDockWidget.

Task-number: QTBUG-118578
Task-number: QTBUG-118579
Pick-to: 6.6 6.5
Change-Id: Ib2ccd7557a21a43b68f184fe4575018f2a97004b
Reviewed-by: David Faure <david.faure@kdab.com>
2023-11-15 21:52:23 +01:00
Axel Spoerl
1ab91b7bdb QDockWidget: call raise() when a dock widget starts to hover
When dock widget (1) starts to hover over another floating dock
widget (2), the latter animates a rubber band, to indicate to the user
that it is ready to accept a drop.

The creation of a QRubberBand moves (2) one position up in the Z order.
The consequence is a visual glitch: While
- the mouse cursor dragging (1) is still outside (2) and
- the visual rectangle of (1) starts overlapping (2)
(1) hides behind (2).
As soon as the mouse cursor enters (2), (1) suddenly comes on top and
(2) hides behind (1).

=> raise() 1 as soon as it starts hovering. That brings it on top of
the Z order, which is expected behavior.

Pick-to: 6.6 6.5
Change-Id: I1140fc6ff109c7a713e7e2617072698467375585
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2023-11-15 21:52:23 +01:00
Mårten Nordheim
5565ed24e1 qopenssl: fix accidental pessimization
The toLatin1 wasn't necessary, the argument should be QString.
The plugin isn't currently built with the ASCII ctors disabled,
so it passed through CI unnoticed.

Amends 3159b337f0

Pick-to: 6.6 6.5
Change-Id: Ib63ccaffacc46e5a313551f1e7c0e02ae09b1a01
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-15 18:25:04 +01:00
Tor Arne Vestbø
c3a1fe7bd7 Prevent reparenting of foreign window embedding container
A foreign window used to embed a Qt window into it should not end up
with changes to its own parent, as its only job is to give the embedded
Qt window a parent handle.

Pick-to: 6.6
Change-Id: If1bc89658fedf449d266bc0cc750c90b6a841a68
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-11-15 18:25:04 +01:00
Tor Arne Vestbø
0a0f7b864b macOS: Work around [NSApplication setWindowsMenu:] out of bound access
The implementation of [NSApplication setWindowsMenu:] seems to look
for the last item in the menu, but doesn't guard the check for the
menu having items. Instead it guards on another array being non-empty,
and in some situation this array has items of type NSWindowMenuItem
while our window menu is empty (FB13369198).

To work around this we insert a hidden dummy item into the menu.

Fixes: PYSIDE-2525
Pick-to: 6.5 6.6
Change-Id: Iaa9dbc9454249f4eb34f8a338d0cc23685f0025a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-15 18:25:04 +01:00
Tor Arne Vestbø
189f9873ae macOS: Take window mask into account when computing QCocoaScreen::topLevelAt
Although not explicitly documented, this is the behavior in practice
on XCB and Windows, and we rely on this behavior in our implementation
of QApplication::widgetAt(), where we punch a temporary hole in the
widget using a mask if it has Qt::WA_TransparentForMouseEvents set.

Pick-to: 6.5 6.6
Fixes: QTBUG-41696
Task-number: QTBUG-119092
Change-Id: Ie7abc31b6930ee6b56fcdf391befc625c1ddf502
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-15 18:25:04 +01:00
Ivan Solovev
6658ccf5a1 Add QCborValue(StringLike) constructor benchmark
... to test the impact of migrating the underlying implementation to
QAnyStringView.

As a drive-by: use [[maybe_unused]] instead of Q_UNUSED in the
benchmark for operator[].

Task-number: QTBUG-101707
Pick-to: 6.6 6.5 6.2
Change-Id: I4bae7deadbe9bbd6f267364d78e94ea4541c1339
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-11-15 19:25:04 +02:00
Mårten Nordheim
f3d074b6b0 QLocal8Bit::convertFromUnicode[win]: fix code unit pairing
When we restore a high surrogate from the state, we need to make sure
that the next code unit is a low surrogate. And if it is not then we
should at least not throw it away.

Amends d8d5922f16

Pick-to: 6.6 6.5
Task-number: QTBUG-118185
Task-number: QTBUG-105105
Change-Id: I64afa0d323d73422128e24e16755e648a8811523
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-15 12:18:14 +01:00
Mårten Nordheim
fe1b668861 http2: Fix authentication code and race
By attempting to get credentials and potentially emitting error
during header parsing we may not have gotten the DATA frames yet
which would leave us emitting error() and finished() without any
body.

Pick-to: 6.6 6.5 6.2
Change-Id: Ibc5fb78193af80ddabaca2c9e4149bbcac9789a1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-15 12:18:14 +01:00
Mårten Nordheim
f4c8e11ad7 tst_http2: increase testing for authenticationRequired
Make sure the reply is marked as finished and that the body is received
even if we didn't succeed.

In a real scenario that would include some text like Access Denied.

Also, no longer clear() the authenticationHeader in the server, since
that meant the server would not send the header again if the client
failed to authenticate. Luckily this wasn't actually causing any
problems before, since we only tested the expected www-authenticate
header.

As a drive-by: clang-tidy complained about not using const-ref for a
lambda.

Pick-to: 6.6 6.5 6.2
Change-Id: Ia4452fff7d9370d7d460433257d84eff0a6f469b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-15 13:18:13 +02:00
Mårten Nordheim
668ce80e9e Schannel: change UNREACHABLE into error-handling
Because it happens in some (unknown precondition) cases.

While it would be nice to know what the client is doing to trigger this,
it's not worth crashing over in the meantime.

Fixes: QTBUG-118458
Pick-to: 6.6 6.5 6.2
Change-Id: I261a17578e7cd3a95e591a3228b33561000fd336
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-15 13:18:09 +02:00
Tor Arne Vestbø
cc4834c0b9 macOS: Always place input panels at NSPopUpMenuWindowLevel or above
Implementing NSTextInputClient.windowLevel to return the level of the
current input client window is not sufficient, as there may be other
windows visible with a higher window level than that.

For example, QCompleter's completion is shown using a Qt::Popup
window, which has a NSPopUpMenuWindowLevel.

Ideally we'd hide the QCompleter's completion when the IM is
in the process of compositing, but as a first step, and as
safeguard for other similar scenarios, we now return a minimum
window level of NSPopUpMenuWindowLevel for our text input
client.

Fixes: QTBUG-102831
Pick-to: 6.6 6.5 6.2
Change-Id: Id74a6350595bd136027a9af470f6700ee90f52a7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-15 03:15:22 -08:00
Jøger Hansegård
80a14c86b2 Add QTest option for repeating the entire test execution
Repeated test execution can be useful, under a debugger, to catch an
intermittent failure or, under memory instrumentation, to make memory
leaks easier to recognize.

The new -repeat flag allows running the entire test suite multiple times
within the same process. It works by executing all tests sequentially
before repeating the execution again.

This switch is a developer tool, and is not intended for CI. It can only
be used with the plain text logger.

Change-Id: I2439462c5c44d1c8aa3d3b5656de3eef44898c68
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-15 11:07:09 +00:00
Michael Weghorn
f67499baab a11y uia: Report UIA_StrikethroughStyleAttributeId
Implement support for getting the strikethrough
style (UIA attribute UIA_StrikethroughStyleAttributeId [1])
by checking for the corresponding IAccessible2
text attribute "text-line-through-type" [2] and
mapping the value accordingly if set.

Only report those attributes from the
QAccessibleTextInterface::attributes return value,
if they apply for the whole range of the
QWindowsUiaTextRangeProvider.

With this in place, the NVDA screen reader on
Windows announces "strikethrough" as expected
when asked to report the formatting information
(e.g. via NVDA+f shortcut) for the QTBUG-118106 example.

[1] https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-textattribute-ids
[2] https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes

Task-number: QTBUG-118106
Change-Id: I2fa060bd3bf493227bba766385f34d224497784c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-11-15 12:06:27 +01:00
Michael Weghorn
d2bf45c6ed a11y: Report strikethrough via text attribute
Let `QAccessibleTextWidget::attributes`
report whether strikeout is applied to text
via the "text-line-through-type" IAccessible2 text
attribute [1].
Use a value of "single" when strikeout is applied,
and "none" otherwise.

A previous change already implemented bridging that to
the corresponding AT-SPI "strikethrough" attribute.

Update the existing test tst_QAccessibility::textAttributes_data
to take into account that this attribute is reported
as well now.

[1] https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes

Fixes: QTBUG-118106
Change-Id: I0416f00b1c11709d9cd0ca0ee38cc6df6caa6dcf
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-11-15 12:06:23 +01:00
Timur Pocheptsov
360152bdcd Cocoa plugin: make sure popups' collection behavior knows about spaces
It is possible to have several desktops on macOS, and even more - assign
an app to one particular desktop. Then, moving such an app to a different
desktop and using Qt's widgets like combobox may result in a strange
behavior: since it's not a native 'combo button', we create a popup
to show contents (list of items) of Qt's combobox and this popup
may open on a 'wrong' desktop (the one to which the app is assigned to).
To address this, combine the existing collection behavior for popups
with NSWindowCollectionBehaviorMoveToActiveSpace.

Pick-to: 6.6 6.5
Fixes: QTBUG-113507
Change-Id: Icbbc930fd1fc91089774340793e4bc452b939c1c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-15 11:02:42 +00:00
Jøger Hansegård
8d367dec15 Add QUniqueHandle - a general purpose RAII wrapper for non-memory types
When interfacing with C-style APIs, such as the Windows API, resources
are often represented using handle objects. Lifetime management of such
resources can be cumbersome and error prone, because typical handle
objects (ints) do not give any help to release resources, and to manage
ownership.

Although std::unique_ptr can be retro-fitted with a custom deleter, and
helps transfer of ownership, it is inherently a pointer type. It can
therefore be clumsy to use with C-style APIs, particularly if the
invalid (uninitialized) handle value is not a nullptr. Also, the
std::unique_ptr does not work well when an allocating function returns
the handle as a pointer argument.

The QUniqueHandle addresses these issues by providing a movable only
value type that is designed as a RAII handle wrapper.

A similar handle wrapper exists in the Windows SDK, as part of the WRL
library. Unfortunately, this is Microsoft specific, and is not supported
by MINGW.

Since the QUniqueHandle is platform independent, it can be used also
with non- Microsoft platforms, and can be useful with other C-style APIs
such as FFmpeg or SQLite.

Pick-to: 6.6 6.5
Change-Id: Ibfc0cec3f361ec004febea5f284ebf75e27c0054
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-15 05:01:51 +01:00
Michael Weghorn
bb6ed27b50 a11y uia: Map 3 more roles to UIA control type IDs
For QAccessible::Paragraph and QAccessible::Heading, use
UIA_TextControlTypeId as specified in the Core Accessibility
API Mappings specification [1] [2].

For QAccessible::WebDocument use UIA_DocumentControlTypeId.

[1] https://w3c.github.io/core-aam/#role-map-paragraph
[2] https://w3c.github.io/core-aam/#role-map-heading

Change-Id: Idae1e2da28b495d5d639df63c3de1260f2177142
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-11-15 03:28:36 +01:00
Michael Weghorn
56476947cf a11y atspi: Bridge IA2 strikeout text attrs to AT-SPI
When the text attributes an accessible interface reports
include one of the various "text-line-through-*"
IAccessible2 text attributes with a value that indicates
that strikethrough is applied [1], bridge that to the
AT-SPI layer via the "strikethrough" attribute with a
value of "true".

See also the ATK documentation [2] for the
`ATK_TEXT_ATTR_STRIKETHROUGH` text attribute.

This will not only be used by an upcoming change
that implements reporting that for Qt's own text
widgets, but is also needed for third-party applications.
Change for LibreOffice that makes use of this: [3]

[1] https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes
[2] https://gnome.pages.gitlab.gnome.org/atk/AtkText.html#AtkTextAttribute
[3] https://gerrit.libreoffice.org/c/core/+/157939

Task-number: QTBUG-118106
Change-Id: Ieb98584a3c6270d8db508d59994f9ba244e2bc64
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-11-15 01:17:00 +02:00
Christian Ehrlicher
6259f4e7b4 QGuiApplication: check return value of platformTheme::palette()
Under some circumstances (e.g. setDesktopSettingsAware(false) on
windows) it may happen that the call to platformTheme::palette() returns
a nullptr which is not checked before dereferencing the pointer.
Therefore add a check for this to avoid a crash.

Fixes: QTBUG-111527
Change-Id: I6443d5d1a9b813f499d8f65b4fee55b0b8299b16
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-14 20:24:58 +01:00
Ahmad Samir
6e8563fb2d QStandardItem: store Qt::UserRole-1 in a static constexpr var
Change-Id: I809135aed1883130891863e7c8650d0b3e7f3a35
Reviewed-by: David Faure <david.faure@kdab.com>
2023-11-14 21:23:50 +02:00
Ahmad Samir
85eebedb16 QStandardItem: add note about reimplementing data/setData() wrt. flags
Extend the unittests.

Drive-by change: add missing include, otherwise static analyzers
(clangd) complain.

Fixes: QTBUG-105150
Pick-to: 6.6 6.5 5.15
Change-Id: I312133d5b35119e2e51002dfefe0e141c0708e3d
Reviewed-by: David Faure <david.faure@kdab.com>
2023-11-14 21:23:45 +02:00
Wladimir Leuschner
77e0e7c414 Fix setting SysTrayIcon visible after explicitly hiding it
After hiding the QSystemTrayIcon explicitly with .setVisible(false)
resetting visibility with .setVisible(true) does not generate NIM_MODIFY
message and thus preventing the tray icon from being visible again.

Fixes: QTBUG-118133
Pick-to: 6.6 6.5
Change-Id: Ic2b1d0f293c92fec7ec697b2fe3d1da9fd0d0e44
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
2023-11-14 15:19:40 +00:00
Michal Klocek
b63045477e Fix android build
Fix qt namespace issues:

* qjniarray.h:339:30: error: no template named 'Traits';
* ld.lld: error: version script assignment of 'Qt_6' to symbol '_ZNTestQTNamespace114QReadWriteLock16destroyRecursiveEP21QReadWriteLockPrivate' failed: symbol not defined
* same for _ZN16QNetworkDatagram7destroyEP23QNetworkDatagramPrivate
* qtimezoneprivate_android.cpp:14:21: error: unknown type name 'TimeZone'
* qandroidplatformclipboard.h:13:1: error: no template named 'Object'

Change-Id: Ia5fc3990af4a4d762e194c7951727f8d5b10670e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-14 15:54:38 +01:00
Michael Weghorn
f035766b16 a11y atspi: Unescape commas in color text attribute
The IAccessible2 text attribute specification [1], which
is the applicable specification for text attributes in
Qt as well, says:

> These characters need to be escaped with a backslash:
> backslash, colon, comma, equals, and semicolon.

To adhere to this specification the commas in the
"rgb(0,0,0)" value strings need to be escaped.

However, AT-SPI does not expect those to be
escaped, s. for example the ATK text attribute
specification for ATK_TEXT_ATTR_FG_COLOR:

> The foreground color. The value is an RGB
> value of the format "u,u,u"

Therefore, replace any backslash-escaped comma
with just a comma in the AT-SPI adaptor.

The context where I ran into this is LibreOffice
change [3] (where LibreOffice's qt6 VCL plugin
is based on Qt, but the Windows variant
has its own IAccessible2-based a11y implementation).

[1] https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes#formatting
[2] https://gnome.pages.gitlab.gnome.org/atk/AtkText.html#AtkTextAttribute
[3] https://gerrit.libreoffice.org/c/core/+/157845

Change-Id: I0a9003ff891f1bfb180a6d16a1dff2afe4002b3e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-11-14 16:54:38 +02:00
Axel Spoerl
4c60a11d8f QDockWidget: Always show dock widgets with the main window
QMainWindow::show() also showed its dock widget children. When a main
window with dock widget children consumed a show event for another
reason, hidden dock widget children remained hidden.

If a dock widget application went to the background, e.g. because it
was hidden behind another application gaining focus, a klick on the
dock widget application's app icon would not show its dock widget
children. Unless the dock widget application provides shows them
explicitly, they can never been shown again by the user.

=> show all dock widget and group window children, when QMainWindow
consumes a show event.

Pick-to: 6.6 6.5
Change-Id: I7e8b59f021ec4ec5679d0d08d0eeda1e3225a385
Reviewed-by: David Faure <david.faure@kdab.com>
2023-11-14 15:05:19 +01:00
Axel Spoerl
0e435b7f13 QMainWindowLayout: remove redundant #ifdef'ry
Remove #if QT_CONFIG(dockwidget) nested within each other.

Pick-to: 6.6 6.5
Change-Id: I6c662909676ffada3ac52e41a9c2d8b9fd491689
Reviewed-by: David Faure <david.faure@kdab.com>
2023-11-14 15:05:19 +01:00
Alexey Edelev
0d07725f6b Fix the broken condition of -fno-reorder-blocks-and-partition flag in QtGui
The condition was wrongly converted while qmake-to-cmake porting.

Pick-to: 6.2 6.5 6.6
Change-Id: I8b8de7c9b2ca079609ed466cf91f1a3dd0d22aa9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-11-14 08:31:28 +01:00
Michael Weghorn
5db48d584e Don't reuse iterator var to avoid -D_GLIBCXX_DEBUG crash
For a CXXFLAGS='-D_GLIBCXX_DEBUG' build, running the
examples/corelib/ipc/sharedmemory/sharedmemory
example and clicking on the "Load Image from File..." button
would result in a crash:

> usr/include/c++/13/debug/safe_iterator.h:492:
> In function:
>     bool gnu_debug::operator!=(const
>     _Safe_iterator<std::_Rb_tree_const_iterator<std::pair<const
>     QSettingsKey, QVariant> >, std::debug::map<QSettingsKey, QVariant,
>     std::less<QSettingsKey>, std::allocator<std::pair<const QSettingsKey,
>     QVariant> > >, std::forward_iterator_tag>::_Self&, const
>     _Safe_iterator<std::_Rb_tree_const_iterator<std::pair<const
>     QSettingsKey, QVariant> >, std::debug::map<QSettingsKey, QVariant,
>     std::less<QSettingsKey>, std::allocator<std::pair<const QSettingsKey,
>     QVariant> > >, std::forward_iterator_tag>::_Self&)
>
> Error: attempt to compare a singular iterator to a
> singular (value-initialized) iterator.
>
> Objects involved in the operation:
>     iterator "lhs" @ 0x7ffe8e811550 {
>       type = std::_Rb_tree_const_iterator<std::pair<QSettingsKey const, QVariant> > (constant iterator);
>       state = singular;
>     }
>     iterator "rhs" @ 0x7ffe8e811670 {
>       type = std::_Rb_tree_const_iterator<std::pair<QSettingsKey const, QVariant> > (constant iterator);
>       state = singular (value-initialized);
>     }
> Aborted (core dumped)

This may be a libstdc++ bug, but still avoid/work around the issue
by just using two separate variables for the iterators here.

While at it, simplify the code a bit and replace the use
of const_cast and pointers with the use of const references.

Many thanks to Giuseppe D'Angelo for the analysis of
the underlying problem and reporting a bug for GCC/libstdc++ [1] !

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112477

Fixes: QTBUG-119044
Pick-to: 6.6 6.5
Change-Id: I00a8cc35033cf3ab4ba1f071cccabdef8ef52f9c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2023-11-14 00:26:44 +01:00
Volker Hilsheimer
536fd29bdf JNI: Add convenience overloads for registerNativeMethods
Add a template overload for the QJniEnvironment member function so that
a declared type can be used.

And add a static registerNativeMethods class member function to declared
types.

As a drive-by, document the initializer_list overloads. The
"template <typename Class>" convenience wrappers are currently all
undocumented, as we first need to document the QtJniTypes type system
and declaration macros.

Change-Id: I8ff9edc4e493694e6d2c26d4bc7b06bd8e05bf0c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-11-13 22:35:27 +01:00
Marcin Zdunek
c706011dc0 Add checking if using eglfs
We are using eglfs in VxWorks which make 3 few testcases fail, because eglfs windows are fullscreen by default.
This is the same solution as in qt5 in tag 5.12.6 from commit with hash 39027ef076c.

[...] EGLFS forces the first top-level window - either a QWidget or a QQuickView - to become fullscreen. [...]
from: https://doc.qt.io/qt-6/embedded-linux.html

Change-Id: I3ab3208b3c7c1b2e27d879bac1ee0679f48109e2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-11-13 18:42:01 +00:00
Marc Mutz
51c75ae2ff tst_qxp_is_virtual_base_of: disable all warnings for GCC < 10
The -Winaccessible-base switch was added for GCC 10. Older GCCs had no
way to suppress the warnings, and the existing suppression of
-Winaccessible-base caused a warning of its own:

  qcompilerdetection.h:1125:49: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
   1125 | #define QT_DO_PRAGMA(text)                      _Pragma(#text)
        |                                                 ^~~~~~~
  qcompilerdetection.h:1150:49: note: in expansion of macro ‘QT_DO_PRAGMA’
   1150 | #  define QT_WARNING_DISABLE_GCC(text)          QT_DO_PRAGMA(GCC diagnostic ignored text)
        |                                                 ^~~~~~~~~~~~
  tst_is_virtual_base_of.cpp:53:1: note: in expansion of macro ‘QT_WARNING_DISABLE_GCC’
     53 | QT_WARNING_DISABLE_GCC("-Winaccessible-base")
        | ^~~~~~~~~~~~~~~~~~~~~~

Since GCC 8 and 9 are slowly fading away as supported compilers, the
simplest fix to get a clean build is to suppress all warnings for the
test on these compilers, by passing -w, as suggested by
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90449.

Short of moving the affected code into a separate header file and
applying `#pragma GCC system_header` to it, there appears to be no
other way to get rid of the warning.

Amends a1bdee4697.

Change-Id: I12eb1f8d486b1e2413675991659bf9ad3a7869ae
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-11-13 18:42:01 +00:00
Marc Mutz
ddce99989f Improve tst_QStringConverter::encodingForName_data()
Add more tests and DRY the code using the usual row() lambda trick.

Pick-to: 6.6 6.5
Change-Id: I810fba0ab2a96e740e67392155f9507675fe57ae
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-11-13 19:42:01 +01:00
Marc Mutz
47325e01b7 Rename QImageReader benchmark to tst_bench_
Helps finding it, e.g. in QtCreator, as it's now disambiguated from
tst_QImageReader, the auto-test.

As a drive-by, remove all empty functions.

Pick-to: 6.6 6.5 6.2 5.15
Task-number: QTBUG-114253
Change-Id: Icb0a3627488bbf4cb0c9d6bc9890f31a88096afd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-13 19:42:00 +01:00
Marc Mutz
54c25c7c31 tst_QFactoryLoader: remove unused member variable
Commit 862f42e806 removed the last use
of the Android-only `directory` member, but didn't remove the member's
definition.

Remove it now, probably fixing a Clang -Wunused-private-field warning
on Android.

Pick-to: 6.6 6.5 6.2
Task-number: QTBUG-87438
Change-Id: I67a1d97f29a0dde20ff29fb9b5bbaa5611cb9e17
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-13 19:42:00 +01:00
Tor Arne Vestbø
df834fde52 tst_QWindow::setVisibleThenCreate(): Fix unused argument warning
Use the arguments to call the parent class implementation.

Pick-to: 6.5 6.6
Change-Id: I602a66447fb8681b3ec9ef8e2e281828612d178c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-13 18:16:50 +00:00
Eskil Abrahamsen Blomfeldt
c22ff83b2a Fix memory leak when resolving named instances in fonts
We need to free the memory allocated when getting the
info about the variable font.

Change-Id: I25c5f070a6d02468c904428ea2ae71efce1e847c
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2023-11-13 19:14:59 +01:00
André Klitzing
3bae65e7d6 Bump androix dependency to 1.12.0
This avoids linter warning like in 5dc9692e48:
       Obsolete Gradle Dependency

Pick-to: 6.6
Change-Id: I5850af3206f3eaf80850918a13705c59ac3fb4ea
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-11-13 19:14:59 +01:00