Commit Graph

16402 Commits (a35f57d4290c898cda686fccfa7a7a3e08beffd6)

Author SHA1 Message Date
Edward Welbourne b68f100918 Pass QVariant to QSystemLocale::query() as rvalue reference
QVariant is rather big for passing by value; and no caller has any
further use for the QVariant it's passing in.

Pick-to: 6.7 6.5
Task-number: QTBUG-122619
Change-Id: I2751745e715aacfa8982ac97b4ae777fde5e88de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-09 16:41:27 +02:00
Edward Welbourne 21ef6d930a QSystemLocale(): disable copy and move
Axivion (SV546) points out (based on a clazy "rule of three" that
might be rule of five by now) the lack of move and copy assignment and
construction. We don't want those anyway, so tell the compiler not to
create them.

Pick-to: 6.7 6.5
Task-number: QTBUG-122619
Change-Id: Ie951a2c3d60d76ad3448310d3f9bbda22190015b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-09 16:41:27 +02:00
Thiago Macieira 84b2982c6e tst_QCborValue: merge sorting() and comparison() tests
Drive-by add NaN value for testing.

Change-Id: I5f663c2f9f4149af84fefffd17c035f099d01d55
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-04-08 13:31:21 -07:00
Thiago Macieira 394788c68e QCborValue: fix sorting of UTF8-to-UTF16 strings
We must compare the raw string length in UTF-8, not the UTF-16 one.

[ChangeLog][QtCore][QCborValue] Fixed a bug that caused certain
non-US-ASCII string comparisons to produce results not in line with the
CBOR specifications.

Pick-to: 6.5 6.6 6.7
Change-Id: I5f663c2f9f4149af84fefffd17c05d1c0f1bbc3a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-04-08 13:31:21 -07:00
Assam Boudjelthia 5994def6ab Revert "Android: skip vulkan tests for tst_qrhiwidget"
Amends feff219aad which didn't really
do the revert for some reason.

This reverts commit bba26d7220.

Reason for revert: Latest emulator update fixed the issue.

Change-Id: I0bc4263eae36c3ff81f235dcfe3bad9b30afd5d8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2024-04-08 18:44:35 +03:00
Assam Boudjelthia 772fd609c6 Revert "Android: SKIP cases failing on Android 12 CI with 16GB RAM"
This partially reverts commit eb0d7b5dcf.
Leaving tst_QRhi::tessellation() skipped because it still fails.

Reason for revert: The latest emulator fixed the issue.

Fixes: QTBUG-111235
Fixes: QTBUG-111236
Task-number: QTQAINFRA-5971
Pick-to: 6.7 6.6 6.5
Change-Id: I9a624be6ba219a4175c0e84ba68d882953422cba
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2024-04-05 20:31:07 +00:00
Assam Boudjelthia 471098918d Revert "Skip Vulkan on Android in QRhi autotest"
This reverts commit 0d413506a1.

Reason for revert: Latest emulator fixed the issue.

Task-number: QTBUG-118220
Task-number: QTQAINFRA-5971
Pick-to: 6.7
Change-Id: I0d4792ef68a3ad840c8c353f55cb96d0be7cd66e
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2024-04-05 20:31:07 +00:00
Assam Boudjelthia 4244b4194c Revert "Skip QVulkan autotests on Android"
This reverts commit c6138bf9de.

Reason for revert: latest emulator version fixed the issue.

Task-number: QTBUG-118234
Task-number: QTQAINFRA-5971
Pick-to: 6.7
Change-Id: I7137851baf2b71e760af4bfab7726d761b7f59ff
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2024-04-05 20:31:06 +00:00
Allan Sandfeld Jensen 04e5b86f9e Make QColorTrcLut more flexible
Make it possible to generate one way QColorTrcLut tables, and make it
easier test out different table size,

Change-Id: I953c68d772699de87fdddbf15ce196e6ba8b9898
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-04-05 18:40:47 +02:00
Allan Sandfeld Jensen 05b8467304 Add color space model, making gray color spaces explicit
This also adds image conversion of both format and color space, which
will also  be required later for conversions to CMYK formats and color
spaces.

Change-Id: I578c0a010ffcdb4df4cf9080c0621fac8bc342bf
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-04-05 18:40:47 +02:00
Piotr Wierciński 157c9eef48 Revert "wasm: Proxy emscripten_fetch() to the main thread"
This reverts commit f2f2b6ef18.

Reason for revert: There are couple of issues introduced. Lets revert to base revision and go with fixes from there.

Pick-to: 6.5 6.6 6.7
Change-Id: I8341de42ef3e4a609bfbffdb763dd5c28794473c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
2024-04-05 14:41:23 +02:00
Assam Boudjelthia 0a45996376 JNI: check for pending exception first in getCleanJniObject()
returning early if the object is null will not clear pending exceptions
from the previous failed JNI call, and that will crash the app on the
next jni call if an explicit exception clearing is not done, wish mostly
the case. Checking and clearing for exceptions has to always be done
under this call.

Pick-to: 6.7
Fixes: QTBUG-122135
Change-Id: I0d42d012a4d1305fa07147fd22860d7c005f9b83
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2024-04-04 19:12:55 +00:00
Giuseppe D'Angelo 7f72a93e87 Port QImage::Format_CMYK32 to CMYK8888
Follow the established convention that byte-oriented image formats
have the "8888" suffix, not "32". The old enum name is temporarily
left to help port other submodules.

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

Change-Id: I4b6f10cb22312b614cb9cf4b0ac439907276c538
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-04-04 16:08:22 +01:00
Axel Spoerl 58d5d4b7c2 Abstract QWidget focus chain management
The focus chain in widgets is implemented as a double-linked list,
using QWidgetPrivate::focus_next and focus_prev as pointers to the
next/previous widget in the focus chain.

These pointers are manipulated directly at many places, which is error
prone and difficult to read.

Build an abstraction layer and remove direct usage of focus_next and
focus_prev. Provide functions to insert and remove widgets to/from the
focus chain.

Add a test function to tst_QWidget.

Task-number: QTBUG-121478
Change-Id: Ide6379c0197137e420352a2976912f2de8a8b338
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-04-04 16:13:29 +02:00
Axel Spoerl f7a809ab73 Stabilize tst_QComboBox:popupPositionAfterStyleChange()
Wait 2x double click interval, to make sure a double click is safely
avoided.

Use QTRY_COMPARE at the end of the function, to cover cases where a
synchronously delivered mouse click causes posted events.

Wrap the test implementation in #ifndef QT_NO_STYLE_FUSION, as is the
declaration.

Skip the test on QNX.

Fixes: QTBUG-123798
Pick-to: 6.7 6.6 6.5
Change-Id: I73f4acb241a8c77a542152288c65f3d07582e075
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-04-04 16:13:28 +02:00
Mitch Curtis 907181cb21 Fix Qt::AA_DontUseNativeMenuWindows being unsettable on 32 bit systems
f1bb9cfbf6 added this value, but it was
only when a test in qtdeclarative tried to use it that it was
discovered that it couldn't be set on 32 bit operating systems (armv7,
AKA imx7) due to overflow as a result of the bit shifting that is done.

Fix it by using an old, deprecated value. If any old codebase using
that older flag tries to build against a newer Qt with this change, it
shouldn't affect it, as setting the flag does nothing in Widgets, and
native menus didn't exist in earlier versions.

Task-number: QTBUG-69558
Change-Id: I520154d02e9ccf007ebd73807685212a19fbee1b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-04 11:31:51 +08:00
Volker Hilsheimer 8424a64014 Fix warning: remove unused parameter
Pick-to: 6.7 6.6 6.5
Change-Id: I5794e38e1e9871f14c9a8df6483e57c1922dace2
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
2024-04-04 00:51:46 +00: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
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 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
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 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
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
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
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
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 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 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 1ebee8980b QPolygonF: delegate QDataStream marshalling to QList
Like the QPolygon code. This fixes a mistake in failing to clear the
list before de-marshalling in operator>>.

Updated most of the QDataStream tests to have data in the objects
they're streaming into, to ensure that the stream overwrites everything.

Fixes: QTBUG-122684
Task-number: QTBUG-122704
Pick-to: 5.15 6.5 6.6 6.7
Change-Id: I01ec3c774d9943adb903fffd17b6920c72f5042b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-26 15:20:31 -07:00
Tatiana Borisova e766735771 QJsonArray iterators: use new comparison helper macros
New comparison macros are used for following classes:
- QJsonArray::iterator
- QJsonArray::const_iterator

Replace public operators operator==(), operator!=(), operator!<(), etc
of classes to friend methods comparesEqual(), compareThreeWay();

Use *_helper methods to have an access to protected members of
QCborValueConstRef class from friend functions.

Task-number: QTBUG-120300
Change-Id: I9b41b619107ce69d8b6dab4938232fab841aab51
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-26 23:11:09 +01:00
Giuseppe D'Angelo c24dcef97e Remove a duplicated call to QFile::open
File was opened on the previous line.

Change-Id: I418d616a2f82d9241c37224e4c1a0fb12894eb40
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-03-26 20:43:50 +01:00
Shawn Rutledge 0281005a71 QTextMarkdownWriter: escape all backslashes
A literal backslash needs to be doubled so that the parser doesn't treat
it as escaping the following character when the markdown is read back.
In ca4774131b we tried to limit it to
backslashes that were not already escaped. In case someone really needs
a longer series of backslashes, it's more correct to escape them all;
but this comes with the risk that if they do not get un-escaped by the
markdown parser in some scenario, repeated round-trip saving and loading
could multiply them excessively. So we also add a lot of tests to try
to verify that this is safe.

Task-number: QTBUG-96051
Fixes: QTBUG-122083
Pick-to: 6.7
Change-Id: I64f610d24e99f67ebdc30d5ab5c6cf3985aec5ec
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-26 00:47:37 -07:00
Tatiana Borisova 25652c2819 QJsonObject: use new comparison helper macros
Replace public operators operator==(), operator!=() of
QJsonObject to friend methods comparesEqual().

Use QT_CORE_REMOVED_SINCE and removed_api.cpp to get rid of current
comparison methods and replace them with a friend.

Add friend method comparesEqual(QJsonObject, QJsonValue)
to the QJsonObject class, to support comparison between QJsonObject
and QJsonValue elements, see test-case valueEquals().

Task-number: QTBUG-120300
Change-Id: Ibab0b4b39966205447e31c41e94e7e1a4e31e553
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-03-25 23:29:31 +01:00
Frédéric Lefebvre 36e65785ec tst_QWidget::reverseTabOrder remove QApplicationPrivate::setActiveWindo
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Ifd2c5dcd1cc3d13f689ffd6400ffec0fcc3a6b93
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-25 19:16:19 +01:00
Axel Spoerl c0511410e5 tst_QWidget: use focus abstraction instead of focus_next/prev
Focus abstraction in QWidgetPrivate makes direct access to
QWidget::focus_next and focus_prev an antipattern.
Remove usage.

Add object names for better diagnostics when debugging focus issues.

Task-number: QTBUG-121478
Change-Id: Iecd3bdc824bf77c519951f8f7801eb50b29a6e00
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-22 22:42:16 +00:00
Tatiana Borisova 839cffd521 QJsonValue: use new comparison helper macros
Replace public operators operator==(), operator!=() of
QJsonValue/QJsonValueConstRef/QJsonValueRef classes to friend
methods comparesEqual().

Use QT_CORE_REMOVED_SINCE and removed_api.cpp to get rid of current
comparison methods and replace them with a friend.

Delete non-exported public operators operator==(), operator!=()
for QJsonValueConstRef/QJsonValueRef classes.

Add comparison check to auto-test.

Task-number: QTBUG-120300
Change-Id: I01434af4ce5a7589733db4a9b14f54ad42e852ed
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-03-22 21:01:59 +01:00
Frédéric Lefebvre e73295f908 tst_QWidget::tabOrderWithProxy remove QApplicationPrivate::setActiveWind
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Id3b9967ddaa7dbb87eef9faaf4681d7cb014ba8c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-22 20:23:53 +01:00
Frédéric Lefebvre 3cbb6e0e5f tst_QWidget::tabOrderWithProxyDisabled() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I88d39def0e85e147b3621d98d150ee65463be94f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-22 20:23:53 +01:00
Frédéric Lefebvre e4dcebc19b tst_QWidget::tabOrderWithCompoundWidgets() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: If805bc0e021625b94edc83d7abccc435c1880bea
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-22 20:23:53 +01:00
Frédéric Lefebvre 6d5880d81b tst_QWidget::tabOrderWithProxyOutOfOrder() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I7a4b21018216c2b7cced8d4aa5084c527b694f4a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-22 20:23:52 +01:00
Frédéric Lefebvre 84dc1f2123 tst_QWidget::tabOrderWithCompoundWidgetsNoFocusPolicy remove setActiveW
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Ieb516cc4fd02230c0ec6bb189da049c3741358dd
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-22 20:23:52 +01:00
Frédéric Lefebvre fbcd223507 tst_QWidget::defaultTabOrder() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I2faaf575a04652a395956c7d790ac18d9f3ec9e6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-22 14:54:48 +00:00
Tor Arne Vestbø da51b957c0 Revert "QTypeInfo: add detection for Clang's __is_trivially_relocatable"
This reverts commit f4bac3ca17.

It broke builds with Xcode 15

Change-Id: Iee232658ede3dfb09d65f3f6a95410c069941421
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-22 14:31:39 +00:00
Marc Mutz d2dbe2d7f7 QSignalSpy: separate messages for invalid and non-signal meta-methods
If a signal was invalid, the code still called messageSignature(),
which returns a null QByteArray, and passed its constData() to
qWarning("%s"). That probably worked in our implementation, because it
falls back to QString::asprintf(), but it raised eyebrows, so avoid
calling messageSignature() on invalid QMetaMethod.

This changes the warning output, so adjust the test.

Task-number: QTBUG-123544
Change-Id: I41bc6650de091f61354ff91ee45659668f0e0223
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-22 15:31:39 +01:00
Tatiana Borisova e2bd247081 QJsonDocument: use new comparison helper macros
Replace public operators operator==(), operator!=() of
QJsonDocument to friend methods comparesEqual().

Use QT_CORE_REMOVED_SINCE and removed_api.cpp to get rid of current
comparison methods and replace them with a friend.

Task-number: QTBUG-120300
Change-Id: I7b61765c34406b7a9fb7dd8b1fc554c87af6a3f3
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-22 14:15:54 +01:00
Even Oscar Andersen 043ceca40f wasm: Document and test OpenGLContext limitations
There is a limit in WebGL that OpenGL context sharing is not supported.

There is a proposal from 2013
(https://www.khronos.org/webgl/wiki/SharedResouces), but it seems that
it never was implemented.

There is an additional limit in that there is exactly one WebGL context
for each canvas (i.e. window).

A part of the problem here is that the identifier for an OpenGL context
is essentially a surface-thread-context triplet. And the thread part
might be more difficult to handle in a javascript setting.

Regardless of why, we need to have an opinion about what the
consequences are, and what we support to what extent.

As such this commit:

1) Adds a comment on the QOpenGLContext describing the limitations
2) Adds a qWarning() on the first activation of a shared context.

The second item is not complete. We will have problems with multiple
individual contexts also, It is just not possible to warn for these
cases. The second item covers, maybe, the most common case.

Change-Id: I51550a6acb0a7f6f6fa5e9e2c3da080a1d2b498f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-03-22 13:51:33 +01:00
Frédéric Lefebvre a5b9ba15e2 tst_QWidget::explicitTabOrderWithComplexWidget remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I0271f3baf718ca5ae03464bbd415cd0feaa9087d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-22 13:51:33 +01:00
Liang Qi 91079e64d8 tests: skip tst_QApplication::abortQuitOnShow() on Wayland
The test started to "crash" since 576c9160b1.

Task-number: QTBUG-123172
Change-Id: I16c78f517f718510aa22a2e24ed3d502edae52e5
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2024-03-22 09:53:06 +01:00
Giuseppe D'Angelo f4bac3ca17 QTypeInfo: add detection for Clang's __is_trivially_relocatable
Types marked with [[clang::trivial_abi]] are considered to be trivially
relocatable for Clang. This is ABI compatible, since in Qt 6 we can
change the value of QTypeInfo::IsRelocatable "after the fact" -- it
simply means that code that doesn't get recompiled is pessimized.

Change-Id: I32e52bfb212c7919b2ebcf7832ede4404358330f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-22 02:54:15 +01:00