Commit Graph

49267 Commits (2d2fae48637d0aaa77cdd7dd413c40efec27a8a5)

Author SHA1 Message Date
Tor Arne Vestbø 085d5db90d macOS: Send key press as QKeyEvent if input context doesn't consume it
If IM is enabled we send key events through the macOS text input system,
and we do this for all key pressed, including the ones with modifiers
pressed. The latter allows the input method to respond to shortcut
key combinations to switch its own mode or do more advanced operations
on the text.

We were relying on the IM to call doCommandBySelector with a noop
selector if the shortcut didn't match any of its own internal key
sequences, but this fails for key events with more than one modifier
pressed.

Instead of using [NSView interpretKeyEvents:] to pass the key event
to the system IM we now go directly to the NSInputContext, which the
former method is just a wrapper for. This allows us to use the result
of [NSInputContext handleEvent:] to determine if the system IM consumed
the event or not. For key events with multiple modifiers this will be
false, which we interpret to send the event as a regular QKeyEvent
instead.

Fixes: QTBUG-123848
Fixes: QTBUG-106516
Pick-to: 6.7 6.5 6.2
Change-Id: I14a43c2029149514515dd9ece881aed3f6500a4e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-04-08 22:31:21 +02:00
Mitch Curtis 3f720b8acf QGridLayoutEngine: print stringified layout item in warnings
This provides a way for the user to identify any items involved in
warnings we may print, as e.g. their objectName will be included.

Qt Quick's Layout types can use this to stringify the QQuickItem,
which will result in the type and objectName being printed.

Change-Id: I3d6b6ea0315df98629992afd29e4bf2aad847e22
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2024-04-08 10:17:46 +08:00
Zhao Yuhang d12490f661 QtCore: avoid unnecessary export in static build
We only need it to be exported in shared builds.
Without this change, there will always be an
exported symbol called "qt_startup_hook" for
executables that linked against QtCore statically,
this is absolutely not the Qt user would expect.

Change-Id: Icf19df09531e13184ea019aa708d6b93fa626f85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-06 13:14:52 +00:00
Zhao Yuhang 079578eadd QWidget: fix link error in static build
QtQuick also uses "lcFocus" as a category name, which
causes link errors in static builds when both QWidget
and QtQuick are linked in one executable.

Making it static is also a good solution, but here
adding a "Widget" prefix seems more consistent.

Change-Id: I0a6a02750bd347f62b67544b4044789612f0fa4d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-04-06 13:14:25 +00:00
Giuseppe D'Angelo dde96f0f47 QPixelLayout: fix convertCMYKToRGBA32F
The assignment to the output was missing.

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

Change-Id: Ibe33073b7e97597631a8dbb0035742693fef97f5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-04-06 13:49:11 +02:00
Allan Sandfeld Jensen 923c5145a8 Parse grayscale ICC profile as grayscale color spaces
Removes the old hack of parsing them as a compatible RGB color space.

Change-Id: I876d74ca5830b46decc15b20e8a3baa12d5e2713
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-04-06 09:05:14 +02:00
Mårten Nordheim 5eecb143bc QNetworkInterface[unix]: fixup some memcpys
There is an untested config for enabling null-strings, so technically
not supported. But if we ever want to make null mean null
then we should protect against it.

Also drop the explicit template argument for qMin. This means
we use the hetereogeneus version which will promote to
size_t. Which is the type that memcpy expects anyway.

Change-Id: I91e0a3b159b065b76e9e93605ef0e502f41af74f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-05 21:32:26 +02:00
Mårten Nordheim 4853a52943 Network: cleanliness
QT_NO_CAST_TO_ASCII
QT_NO_CAST_FROM_BYTEARRAY
QT_NO_URL_CAST_FROM_STRING

Change-Id: Ic77ed8ccbdb146b7e7b26123923795f9748d3a38
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-04-05 21:32:25 +02:00
Oliver Eftevaag 953f701799 Add AA_DontUsePopupWindows
We want QQuickPopup to open a top-level window in qt quick, by default.
But also allow users to opt out, and revert back to the old behavior.

It makes sense to have an application wide setting for this, in order
to allow application developer to opt out of the new default behavior,
without having to change a property for every instance of Popup.

While QCoreApplicationPrivate::attribs bearly has any available bits,
it appear that bit 30 is available, since
AA_DisableWindowContextHelpButton was commented out.

Task-number: QTBUG-121363
Change-Id: I6b2759d89b46aa5d08222c2611eaffe855cc425c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-04-05 20:27:14 +02:00
Allan Sandfeld Jensen 48d582e0b7 Handle chad elements in ICC profiles
Parse them, so we can change white-points correctly,
and write them as required by ICCv4

Change-Id: I6d28fb6a85585f80a9867df45864069efda956c5
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-04-05 18:40:47 +02: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
Mårten Nordheim a786404036 NetworkReply[wasm]: simplify some buffer passing
It was always passing a QByteArray to a const char * argument,
with the size along with it. That was immediately converted
back to a QByteArray. Instead, just pass the byte array
which anyway knows its size.

Needed for a followup commit

Change-Id: I821d419adcb600456826dde67fb92ecad11cb290
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-04-05 18:40:39 +02:00
Giuseppe D'Angelo eca0512b08 QImage: remove the last mentions of Format_CMYK32
Change-Id: I8ef63d7f3f14f16111a7e45e07734c10e448984c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-04-05 14:41:31 +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
Mark Brand 938bdccb89 QNetworkInfo[win]: Explicitly link with oleaut32 for MINGW too
Following up on 2 commits that fixed static linking for MSVC but left
out MINGW:
    230c53ad9d
    d9820b0207

Pick-to: 6.6 6.7
Fixes: QTBUG-114243
Change-Id: I12853355ffa1a62acce15ff660478f618c42e0a6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-04-05 13:52:28 +02:00
Mark Brand 7e5a0b54f0 SQL/ODBC: QODBCDriver::record Unable to allocate handle
Seems to have been left out by 874f5c1f463cad61f49e0ff7007852a73fd93e7c

Pick-to: 6.7
Fixes: QTBUG-123478
Change-Id: Ic028c3786203cbc1c3d7316c1ae22c12a928b170
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-04-05 07:59:42 +00:00
Tim Blechmann 93f87326f2 QLocale: silence fallthrough warning
clang doesn't seem to consider `Q_ASSERT(false)` as empty statement.

Pick-to: 6.7
Change-Id: If99c7d4874450d781182491ef3963f1ee96285a6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-04-05 02:17:42 +00:00
Pavel Dubsky 72a86dc0f8 Remove QWindowsComBase
QWindowsComBase is now replaced with QComObject, let's remove the
former since it's a duplication.

Change-Id: I7f911fa036c1f2eaaee168250b8294170430cc5d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-04-05 02:09:31 +01:00
Giuseppe D'Angelo 2dc78efbe4 QIcc: re-add an extra check in parseLutData
Change-Id: Ifce2dc720e4e4cae54a00147049edcf369ae8190
Done-by: Allan Sandfeld Jensen
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-04-04 23:11:50 +01:00
Christian Ehrlicher 9873f4b283 SQL/ODBC: don't escape a driver string
We must not try to escape a driver string, the user has to make sure
that everything is correctly escaped when passing a complete driver
string. This fixes a regression from QTBUG-122642.

Pick-to: 6.7
Fixes: QTBUG-123444
Change-Id: I43316c7a09060f5c8117fdc3c464d239e37d9cdf
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2024-04-04 23:43:02 +02:00
Christian Ehrlicher 5a03e5c51b SQL/ODBC: don't create temporary QStrings
... but use QStringView instead in setConnectionOptions() and the
dependent functions.
Also remove the (undocumented) ability to pass the connection options in
non-uppercase - this was never supported and all other plugins don't
support this either.

[ChangeLog][SQL][ODBC] All options must now be upper-cased as documented. Lower-cased options are no longer supported.

Change-Id: I822db1ddf205c22fe939299c4ab741bbe9b56d65
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-04 21:43:01 +00:00
Christian Ehrlicher 1dd3f46570 SQL/SQLite: use categorized logger
Use the categorized logger qt.sql.sqlite

Change-Id: I70880fca579df56500ddc94a72bc6c616c475e67
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-04 22:43:01 +01:00
Christian Ehrlicher d99d355e49 SQL/MySQL: use categorized logger
Use the categorized logger qt.sql.mysql

Change-Id: I7e6529025dceb81c47571c65b7aea9bd274814e2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-04 22:43:01 +01:00
Christian Ehrlicher efd26cdb2a SQL/ODBC: use categorized logger
Use the categorized logger qt.sql.odbc

Change-Id: I1411e80fa33582857bafdf77baee75b293df56af
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-04 22:43:01 +01:00
Tor Arne Vestbø 1bd755465e widgets: Invalidate RHI swapchain when window moves to new top level
When a QWidget with an associated RHI swapchain (via its QWindow) is
moved to a different top level window, that top level window has its
own backing store, and QBackingStoreRhiSupport, which doesn't know
anything about the fact that the window already has an associated
swap chain in the original top level window's QBackingStoreRhiSupport.

As having multiple swap chains for the same window is not supported
on all RHI backends (Vulkan and DX in particular), we need to throw
away the swap chain when detecting that the window is moved to a new
top level.

We do this by hooking into the existing WindowAboutToChangeInternal
event delivery to renderToTexture children, which now delivers the
event both to renderToTexture QWidget children as well as QWindows
in the hierarchy. The condition of when to deliver the event has
been updated to reflect whether the top level uses RHI for flushing,
instead of only including renderToTexture children, as the former
also includes setting QT_WIDGETS_RHI=1 explicitly.

The event is then caught by QBackingStoreRhiSupportWindowWatcher,
and handled the same way as for SurfaceAboutToBeDestroyed.

Renaming qSendWindowChangeToTextureChildrenRecursively would make
sense at this point, but to make cherry-picks easier we keep the
current name for now.

Fixes: QTBUG-120276
Pick-to: 6.7 6.5
Change-Id: Ic4c60e89be985f12a84e9f893c299e602b70851a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-04-04 21:42:14 +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
Shawn Rutledge 14610fb174 doc: Remove deprecation of the supported QTouchEvent ctor
Amends 111115bf88

Change-Id: Ibc557fdde9c894a3a58bb58835e11be9180e6e6d
Pick-to: 6.2 6.5 6.7
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2024-04-04 20:05:10 +02:00
Giuseppe D'Angelo a07519f51f QColorTRC: code tidies
* Unexport the class (it's fully defined inline)
* Use QFlags instead of "manual" math on an enum class.

The latter requires some extra minor syntax adjustements (making
the enumeration public, so that the operators can pick it up; and
explicitly wrap a couple of usages of the enumerators as
the operators on them are defined *after* the class itself).

Change-Id: I176558de2d5e75697d62790d8783c417997206a9
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-04-04 18:11:14 +01:00
Edward Welbourne 612ed28985 QCollatorSortKey: Rule of Five: add missing move constructor
It has move assign, so should have move-construct. This turns out to
need QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT() and
QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QCollatorSortKeyPrivate).

In the process, make the move assignment and constructor docs in
qcollator.cpp conform to the usual pattern.

Fixes: QTBUG-123326
Change-Id: I6fc9ed254dc396ff6130df09826b993e98dcf101
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-04-04 18:11:14 +01:00
Matthias Rauter 7d5646c02e Fix range-loop-detach warning in qhttp2connection.cpp
Pick-to: 6.7
Change-Id: I0b02e2f79ab7828858da3b4ca9840ad07d39a70a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-04-04 17:11:14 +00:00
Matthias Rauter 88f034e556 Remove unused variables in QHttp2Stream::internalSendDATA
Pick-to: 6.7
Change-Id: I13c546c7dc4cc3d15d8d92b62f053e438b5d6b64
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-04-04 17:11:14 +00:00
Matthias Rauter 5e19f4a8b2 Fix fully-qualified-moc-types clazy warnings in qhttp2connection_p.h
Pick-to: 6.7
Change-Id: Ia5cda794989757a501e83c15d1ad348a48ac4923
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-04-04 17:11:14 +00:00
Allan Sandfeld Jensen a07cb53c23 Fix a regression when painting CMYK over ARGB32_Premultiplied
With the introduction of CMYK32 the old logic of assuming depth
meant compatible alpha version no longer works. So change the logic
to more explicitly return compatible opaque or alpha versions and
remove the now invalid qt_maybeAlphaVersionWithSameDepth.

Change-Id: Ib1f7b76b0ce0eae7d49a0dfe369918a746bbe2b4
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-04-04 18:27:41 +02: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
Martin Storsjö adb49d65e0 QTypeInfo: Add a missing include
This header uses std::is_trivial_v, which requires including
the <type_traits> header.

When building with PCH enabled (which is the default), this
dependency does get satisfied via the PCH, so no issue is
visible.

This fixes building with recent version of libc++ when configured
with _LIBCPP_REMOVE_TRANSITIVE_INCLUDES (which removes unnecessary
transitive dependencies between the libc++ headers, a configuration
which may become the default in the future), with PCH disabled.

Pick-to: 6.7 6.5 6.2
Change-Id: I5e3ae20e366ed3028b1156cee05bcf2908d6e845
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-04-04 18:08:22 +03: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
Tinja Paavoseppä 02bab22fde Android/QtView: Move resizing of the QWindow to Qt thread
Since any window resize events originating from Qt side are ran in the
Qt thread, having the one originating from Android run in the Android
thread can lead to race conditions especially during orientation changes.

Pick-to: 6.7
Change-Id: Iebebec2fffdaf9181b01fc1e8f539c7bc232996d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-04-04 15:46:44 +02:00
Tinja Paavoseppä d45ce58778 Android/QtView: Set also x and y of the wrapped foreign QWindow
Previously, we have set the size of the QWindow to match the QtView.
Also set its x and y coordinate to match, just to keep the window and
the view in sync.

Pick-to: 6.7
Change-Id: I0ea89a11e4526a0a996e7b62ac126808358b6bc7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-04-04 15:46:44 +02:00
Tinja Paavoseppä e9edd3db52 Android/Embedding QML: Resize also parent window
The parent window created from the QtView had an
empty size. Also set its size when creating the window,
and when resizing the QtView. Replace parent window show()
call with showNormal() to avoid switching it to a fullscreen
window.

As a drive-by, use setGeometry() instead of setting the width
and height separately to trigger only one geometry update
for the platform window.

Pick-to: 6.7
Change-Id: I91e350c1748a9e76879faa8bfcab7575f6155f02
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-04-04 15:46:44 +02:00
Tinja Paavoseppä c4a98a7298 Android: Make QtView extend ViewGroup instead of QtLayout
QtView should only have one child, the QtWindow, and that should always
match the QtView's size, so the handling for absolute layout is
unnecessary.

Task-number: QTBUG-121516
Task-number: QTBUG-123306
Pick-to: 6.7
Change-Id: I77024ab9619e68ab98357518ad07535a2ff9614c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-04-04 15:46:44 +02:00
Tinja Paavoseppä b3685743f3 Android: Make QtLayout support MATCH_PARENT layout params
QtLayout did not properly handle resizing child views to the parent's
size when their layout params width or height were MATCH_PARENT. This
was mostly visible when embedding QML to a normal Android app, as
there the Android view hierarchy is responsible for setting the size,
instead of Qt setting it every time the QWindow size changes.

Task-number: QTBUG-123306
Pick-to: 6.7
Change-Id: I08cbfa8e352d0cb2ca5b6e5aa40e891a62b82eb4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-04-04 15:46:44 +02:00
Giuseppe D'Angelo 7eb69e0f7a QPdf: do not switch to file-backed storage if we can't open it
In case creation of the QTemporaryFile fails, keep the data in memory.

Change-Id: I9933571259a26ee990609010763a1ef57877338a
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2024-04-04 13:21:12 +01:00
Zhao Yuhang 90217f37ca QSqlField: fix missing deprecation macro
Change-Id: Ia544da629d495abdfdd0efe0e0991124a9f5d7ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-04-04 12:21:12 +00:00
Marc Mutz f67f63c2f3 Use properly-aligned float[4] as _mm_store_ps() output buffer
... not a QColorVector.

While cccda0e62d, successfully worked
around the problem that QColorVector does not fulfill the
_mm_store_ps() function's alignment requirement (by using the
unaligned version, _mm_storeu_ps()), it failed to address the problem
that the code writes into a QColorVector object's member variable
(float, a 32-bit storage location) when the function is asking for a
128-bit storage:

  /// Stores a 128-bit vector of [4 x float] into an aligned memory
  ///    location.
  ///
  /// \headerfile <x86intrin.h>
  ///
  /// This intrinsic corresponds to the <c> VMOVAPS / MOVAPS </c> instruction.
  ///
  /// \param __p
  ///    A pointer to a 128-bit memory location. The address of the memory
  ///    location has to be 16-byte aligned.
  /// \param __a
  ///    A 128-bit vector of [4 x float] containing the values to be stored.

The treatment of a struct { float x, y, z, w; } as a float[4] is not
allowed by C++, and even if it was, we'd have to pass the address of
the struct object, not that of its first member variable.

It seems like Coverity has recently learned about this kind of thing,
at least there are tons of such new issues listed in the March scan
and while I can't find a report about this particular instance in the
current build, that probably just means that the Coverity build simply
doesn't see this code path due to the #ifdef'ery.

To fix, replace the QColorVector with an over-aligned float[4].
Because we're over-aligning the float[4], we can go back to the
original _mm_store_ps(), which is, presumably, faster then the -u
variant. We don't lose any expressiveness here, either, because the old
code never used any of the member functions of the QColorVector object
used as a store target.

Amends f944651e3d.
Amends cccda0e62d.

Change-Id: Ia0f8202bf4266b8b19b3de897a897de58b7a6d94
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-04 12:24:19 +01:00
Giuseppe D'Angelo 62e91d0025 QBenchmark: abort if we can't open the output file
Change-Id: I6391bb8e6fb0a336d1df82c30eb07ec931cfc053
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-04-04 12:24:18 +01:00
Giuseppe D'Angelo 3c6598c359 Add CMYK image output support to QPdfWriter
If the user gives us a CMYK image, save it as such.

[ChangeLog][QtGui][QPdfWriter] QPdfWriter can now save images in CMYK
format directly.

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

Change-Id: I4e5ba93970a545987e38d9a3b2e15b0d64bb72b6
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-04-04 12:24:18 +01:00
Jaishree Vyas a3fae5faa0 Doc: Qt Data Types Documentation
Updated the list

Fixes: QTBUG-73386
Pick-to: 6.6 6.7
Change-Id: If913a26d32a39c71fb7fba815bdafa924da69457
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-04-04 11:24:18 +00:00
Giuseppe D'Angelo 7bd9aa191c QPdf: assert that we can load the files from the resources
These are files under our control, but still, may get moved/renamed/...
by accident. Assert that we can open them.

Change-Id: I46987f2f12e04a8d7292652eb6440fa0f345175a
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2024-04-04 10:49:23 +01:00
Giuseppe D'Angelo 0fb2e27710 QCupsPrintEngine: handle a possible failure to open the cups fd
I'm not familiar with CUPS APIs, so missing better judgment or a
code comment, handle the possibility for a failure.

Change-Id: I6f9afa9fdccaadbe199ce307f79e1d6050aa2939
Reviewed-by: Albert Astals Cid <aacid@kde.org>
2024-04-04 10:49:23 +01:00
Mitch Curtis d72d7945d4 QTest: expose API needed for Qt Quick Test to print crash backtraces
As discussed in QTQAINFRA-6146, there were two potential approaches to
enabling backtraces in Qt Quick tests:

- Either via a thorough refactoring of quicktest.cpp so that each
testcase is a Slot in a programmatically-created QObject-derived class,
which will be executed via QTest::qExec() similar to the documented
QTest way. This way the pre-existing code in QTest::qRun() will setup
the fatal signal handler.
- Or as a quick fix, modify quick_test_main_with_setup() to setup a
FatalSignalHandler class and invoke prepareStackTrace() like it's
already done in QTest::qRun(). This would require exporting these
symbols in the private header.

This patch enables the implementation of the latter, as it has a
fairly light footprint, is easily revertable (should we need to),
and allows us to immediately gain insight into crashes in CI.

Task-number: QTQAINFRA-6146
Change-Id: Iedffc968acb3e570214df34884ab0afcb6b30850
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-04-04 14:09:03 +08:00
Mitch Curtis c0014becca QTest: move crash-handling code out into qtestcrashhandler_p.h
In preparation for reusing it in Qt Quick, which currently doesn't
print backtraces upon crashes.

Task-number: QTQAINFRA-6146
Change-Id: Ib0384f514b348a398f53529ff3bcc7d4ac2daba7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-04-04 14:08:57 +08:00
Mitch Curtis baa44b9ddf Qt::ApplicationAttribute: static_assert that we don't go higher than 32
Because we can't support it on 32 bit operating systems.

Task-number: QTBUG-69558
Change-Id: I406ecccdf039d7d4f4c24268c92c91e367655cba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-04 11:31:51 +08: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 1752405f44 Font icon engines: reverse implementation to avoid pixmaps
Draw the glyph directly in the paint() override, and use that
from the scaledPixmap implementation. This avoids a pixmap
creation just for drawing an icon with an existing painter.

Pick-to: 6.7
Change-Id: Iece0083a3a9f3625d843bc6e9d836baf9b5d84f8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-04-04 01:51:46 +01:00
Volker Hilsheimer 9d8c5bc718 Apple icon engine: reverse implementation to avoid pixmaps
Instead of implementing scaledPixmap() to rasterize the
vector image we get from App/UIKit, and calling that from
paint, implement paint() to draw the vector image directly
through the painter, and use that in scaledPixmap.

Pick-to: 6.7
Change-Id: I2c62826f29406543bc8d8c7fa71199e91586d83b
Reviewed-by: Amr Elsayed <amr.elsayed@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-04-04 01:51:46 +01:00
Giuseppe D'Angelo 72c242c7a2 CMYK: remove unnecessary qPremultiply calls
Although the output of these functions is premultiplied ARGB, we know
the alpha is always going to be full (1.0) because the source is CMYK 32
bit (without alpha). We can therefore avoid calling qPremultiply.

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

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

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

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

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

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

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

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

Fixes: QTBUG-80167
Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: Ib5685de7ca2fd7cd7883a25bb7bc0255ea242d30
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-04-04 01:26:56 +02:00
Giuseppe D'Angelo 4285f0dfa4 QPdf: remove two unused functions
Never called from anywhere.

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

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

Amends ea6abe583f.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The two methods are not equivalent.

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

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

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

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

This commit reverts ade96ff644.

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

However, this is another fragmented feature.

- D3D11/12:

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

- Vulkan:

Not supported with Vulkan 1.0.

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

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

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

- OpenGL (not ES):

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

- OpenGL ES:

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

- Metal:

Should work.

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

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

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

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

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

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

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

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

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

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

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

Pick-to: 6.7 6.6
Change-Id: I84ef04ed26821b92ef7c5bcdf12b778e91450e0b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-04-03 16:17:12 +01:00
Friedemann Kleint fdac1e2205 Add support for using an inline namespaces for -qtnamespace
Inline namespaces serve the purpose for which the original
-qtnamespace option was added and allow for macro simplification (no
need for any using directives). This makes it possible to use
namespaced builds of Qt also for Qt for Python and similar use cases
which have issues with the additional namespace.

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

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

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

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

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

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

Pick-to: 6.7
Fixes: QTBUG-123875
Change-Id: If155a5b667b9e71d43dfac04ad19caee0ff23793
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-04-03 10:11:26 +02:00
Bartlomiej Moskal 229cadb7a3 Android: Choose correct icon for QMessageBox
QMessageBox contains an icon that can be set using icon type. Before
this commit, android.R.attr.alertDialogIcon was used regardless of the
expected icon type. Only if setting failed, the icon from
android.R.drawable was set (depending on the expected icon type).

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

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

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

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

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

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

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

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

This amends 8cd7a3d472.

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

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

Initialize it to zero.

Found by Coverity.

Amends df0e98d408.

Pick-to: 6.7 6.6 6.5 6.2
Coverity-Id: 444147
Change-Id: I398c9a1e99483f2f9887d768319b20ecc11e2c86
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-27 15:49:43 +00:00
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
Thiago Macieira 13d6d25c1a QLibrary/Unix: remove two unused, exported private functions
Commit 87362f3f58 added
qt_linux_find_symbol_sys(). Given the authors and reviewers, I'm
guessing that was used somewhere in qtdeclarative. Indeed, its use was
removed in qtdeclarative/67191c2b3213259c6eaf045154e9370faa085868
("Remove qqmlmemoryprofiler*").

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

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

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

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

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

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

Change-Id: I82d06cec43ece3b002c8f5dd414c68dc730909af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-27 06:56:09 +01:00
Allan Sandfeld Jensen cccda0e62d Fix potentially unaligned 128-bit store/loads
QColorVector is not forced to 128-bit alignment.

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

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

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

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

Amends e5ebb9022a

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

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

Task-number: QTBUG-48488
Pick-to: 6.7
Change-Id: I1c842340dd2faf2be6e64e0522f9e2b33547d3cf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-27 00:14:02 +01:00
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 3b186ceef8 QDbusTrayIcon: handle open() failure
QDbusTrayIcon has a convoluted workaround/hack that consists in putting
an icon file in /tmp/ and then using that path as the icon. Opening the
icon file may fail, so handle it.

Change-Id: I5d1c681e2fe3cfb23e93fd20f6758d4c83fe1578
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-03-26 21:31:53 +00:00
Giuseppe D'Angelo 9d118af92d QTextStream: discard+comment the possibility of file opening failure
The QTextStream(FILE*) constructor may fail to open the filehandle
through QFile (e.g. if the open mode is incompatible). However
QTextStream has no error report mechanism for this and still reports
status Ok. This is consistent for instance with the QIODevice*
constructor, where even passing a closed device sets the status to Ok.
Add a comment and discard the return of open().

Change-Id: I430b96fd26e0ebca15a4d9ee640b09895bdd0b03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-26 22:31:53 +01:00
Allan Sandfeld Jensen e2413660f5 Fix 8-bit mAB tables
We had no examples of this type, and didn't catch the table was parsed as
-0.5 to 0.5 instead of 0 to 1.

Change-Id: I904937a50deaeecfc89e271bf918eedc521bc8a2
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-26 22:31:53 +01:00
Marc Mutz 19aeb431cf QMainWindowLayout: rewrite validateToolBarArea() to return by value
Coverity complains that QToolBarAreaLayout's
addToolBarBreak(QInternal::DockPosition) could access
QToolBarAreaLayout::docks out of bounds if passed
QInternal::DockCount.

That is correct, but a valid pos seems to be a precondition for this
function, judging from its sister functions, e.g.
addToolBar(DockPosition, .) or insertItem(DockPosition, .), which also
don't validate `pos`. All in-module callers of addToolBarBreak() only
pass valid positions, and use validateToolBarArea() to ensure that. So
it seems that Coverity doesn't grok the pass-by-in/out -parameter used
by that function. That, or it doesn't track back far enough.

Before attempting more drastic measures, first try rewriting the
function to return-by-value instead, and see what Coverity has to say
afterwards.

As a drive-by, make validateToolBarArea() constexpr.

Pick-to: 6.7 6.6 6.5 6.2 5.15
Coverity-Id: 444141
Coverity-Id: 444135
Change-Id: I5fcc664c3cea608429036cad75c37f5c38059733
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-03-26 11:26:24 +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
Marc Mutz ae8031b5e7 QStorageInfo: fix use-after-move
Coverity complained about a use of the moved-from (in the first line
of the loop) `info` object in subsequent lines.

This specific instance is harmless, because the field being accesssed
is a scalar and the move SMFs are the default ones, so the field isn't
actually changed when the struct is moved from.

Still, to silence Coverity and to guide other attentive readers of the
code, take a copy of the field before moving from the struct, and use
the copy's value after the move.

Amends ddc39eb3a4.
Amends 3e330a79ec.

Pick-to: 6.7
Coverity-Id: 444199
Change-Id: I26ea8669f27124fb2567b16d803d47ab439f1e41
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-25 23:29:33 +01: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
Wladimir Leuschner f5d5a42dc3 QWindowsVistaStyle:Revert polishing of QAbstractScrollArea/QGraphicsView
Revert the polishing for QAbstractScrollArea and QGraphicsView
introduced in a1f12273b2

Fixes: QTBUG-123722
Pick-to: 6.7 6.7.0
Change-Id: I9db9079c672f4bf70ce3401382a5843855df2c4a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-03-25 19:00:36 +00:00
Morten Sørvig 7b018629c3 macdeployqt: wait forever for otool
The QProcess default wait time of 30s may be too short
in e.g. CI environments where processes may be blocked
for a longer time waiting for CPU or IO.

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

Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-25 20:00:36 +01:00
Morten Sørvig 6272dddadd Fix multiscreen menu popup positioning corner case
A QMenuBar may span multiple screens. Its menus will
then open on the screen which the bottom middle of
the action rect is at, and will snap to that screen's
geometry if needed.

However it can happen that the bottomLeft() of the action
rect is on a different screen from the selected popup
screen, in which case mapping this point to global
coordinates can give incorrect coordinates if the screens
have different scale factors.

The x value will be corrected by the screen snapping
if needed. Use the y from the screen test point, which
will be correct for the selected screen.

Task-number: QTBUG-73231
Change-Id: If9a39f6b832a64f2f701868f2be0d3a6468fe553
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-25 19:52:04 +01:00
Marc Mutz 7e8196510d QDebug: fix copy-instead-of-move issues
Coverity correctly complains that we're copying the QDebug object when
calling print*Container() when we could have moved it into the helper.

So do move it.

Pick-to: 6.7 6.6 6.5
Coverity-Id: 406803
Coverity-Id: 407406
Coverity-Id: 408523
Coverity-Id: 408562
Coverity-Id: 418431
Coverity-Id: 424788
Coverity-Id: 425106
Coverity-Id: 426537
Coverity-Id: 427163
Coverity-Id: 428925
Coverity-Id: 444463
Change-Id: Ic80247f315a09fffe9363577dff1d1c781859304
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-25 16:22:05 +01:00
Marc Mutz 73d00d0547 syncqt: remove dead code
Either the code in the try {} block

- doesn't throw, then the return within the try {} block exits the
  function, or it
- throws fileystem_error, then we rethrow in the catch, or it
- throws any other exception, then we leave the function by exception

In no case can control reach the trailing 'return {}'.

Found by Coverity.

Amends 7aecb189d5.

Pick-to: 6.7 6.6 6.5
Coverity-Id: 444466
Change-Id: I1c1bf752453076724c2fa9367ea5309e741d84ac
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-25 16:22:05 +01:00
Jøger Hansegård 32b0a27d56 QMap: Use qHash SFINAE workaround with MSVC
Fixes failure to find qHash functions when building Squish. Here, QMap
is used with custom types that do not have any associated qHash
functions. It should therefore not require a qHash function to be
usable with QMap.

There is no indication in the build output where the instantiation came from. There's nothing in the output about the function it should have
called, likely because no qHash functions exists.

Amends: e1f45ad818

Fixes: QTBUG-123310
Change-Id: Idb12fb6ffab06ce242c43f2c42ea7a105e8fa0f4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-03-24 22:12:39 +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
Alexandru Croitor b84e7a6bb0 CMake: Move various rcc generated files into .qt subdirectory
So we have a single central location for all generated files.

[ChangeLog][Build System] Generated resource files (and supporting
files) will now be placed into the .qt/rcc subdirectory of a project
build dir. The location is an implementation detail that might still
change in the future, so it should not be relied upon.

Pick-to: 6.7
Change-Id: Id21df22cac832b618e98c25e0e134f4cf70ed9bd
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-22 20:23:52 +01:00
Alexandru Croitor 51aa9c6163 CMake: Fix semicolon warnings for generated resource init code
Fixes clang warnings when -Wextra-semi-stmt is enabled.

Sample warning:

 warning: empty expression statement has no effect; remove
   unnecessary ';' to silence this warning [-Wextra-semi-stmt]
   resourceReferenceKeeper() { QT_KEEP_RESOURCE(qmake_foo); }

Amends 11259972a3

Pick-to: 6.7
Fixes: QTBUG-123588
Change-Id: I7ffc23cf00d8e2741e91c4d0b4056b0c89057dc2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-22 18:50:36 +01:00
Assam Boudjelthia 619570f23d Android: don't append slash for content paths under QAFE
content URI obtain permissions when selected by the Android file
provider, and the Android APIs will treat them as different URIs if
a slash is added and thus such paths will be unaccessible the same way.

Amends d89c32140a.

Change-Id: I8107c7d482dee75f4637e13400b8844b3d3ff804
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-22 19:50:36 +02:00
Timur Pocheptsov 128645d023 Clarify the priority in selecting TLS backends
In case a custom TLS plugin is provided, the order can be unclear
(next after OpenSSL is either Schannel on Windows, or Secure Transport
on Darwin, then a custom plugin, if any, and the last one is 'cert-only').

Pick-to: 6.7 6.6 6.5 6.2
Fixes: QTBUG-123092
Change-Id: I02bcc1fa5448f64846d561a72b2522af3286c66c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-22 16:28:12 +01:00
Alexey Edelev 018504f4f3 Move QtInstallPaths.cmake to the Qt6 package
QtInstallPaths needs to be loaded at early stages

Change-Id: Ie275ad2a8855b7555b110c35814ebadafe1817c6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-22 15:31:40 +01:00
Marc Mutz b4c5887939 QSignalSpy: inline verify(obj, func) into the only caller
First, realize that we don't need the isObjectValid() call, because
that's done by verify(QObject*,QMetaMethod) later.

That leaves said fromSignal() and verify(QObject*, QMetaMethod) calls,
which we can just inline into the (QObject*, Func) ctor, thus making
said constructor SCARY, having extracted all template-independent code
into other functions/ctors.

Task-number: QTBUG-123544
Change-Id: I6b8afc541f75936045e2d28cfde51a34f98a1fdd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-22 15:31:40 +01: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
Marc Mutz fa5cb84069 QSignalSpy: inline init() into its only caller
Following the verify() Extract Method refactorings, this function has
only one caller left, so it doesn't pull its weight anymore,
esp. considering that it'll be exported soon.

Task-number: QTBUG-123544
Change-Id: I1690b4b6e5a0e0c56fcc9c34544fca3b34e2f9a6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-03-22 15:31:39 +01:00
Marc Mutz 2f39027232 QSignalSpy: move signal verification from init() to verify()
... where it belongs.

Amends e68edd6a07.

Task-number: QTBUG-123544
Change-Id: Ic0e5128555465485b579607a61925cefa5f4716d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-22 15:31:39 +01:00
Liang Qi 2862cdb7ba xcb: try to repopulate xinput2 devices when needed
And try to not call Q_ASSERT() to avoid crash.

Fixes: QTBUG-123554
Pick-to: 6.7 6.6 6.5
Change-Id: I9443c5f0ab4ca7a858df9b328f517b48ab8f122d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-03-22 14:31:38 +00:00
Venugopal Shivashankar f3b73645a8 Doc: Remove table for listing images
Task-number: QTBUG-122580
Pick-to: 6.7 6.6
Change-Id: I7ca3d677262b48ce9e1d85bd9347ad5b15d1598f
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2024-03-22 14:15:54 +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
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
Marc Mutz e68edd6a07 QSignalSpy: share more code
Add per-ctor verify() functions that take care of the warnings for
invalid inputs, and return a struct { QObject*; QMetaMethod; } to feed
into a delegatee constructor.

This solves the problem that the varying parts between the ctors are
at the beginning, not the end, using another level of indirection, and
will eventually allow to make the `args` and `sig` members const, and
therefore remove the need to protect either with the mutex.

This patch tries to keep the diff minimal. I'm planning to de-inline
most of the class in a future commit, so it doesn't matter that
private and public sections are interleaved, that will be cleaned up
when the code is moved to a .cpp file later.

Task-number: QTBUG-123544
Change-Id: Idc628c927736880a8fd580089ed5177361c94ed9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-22 02:44:50 +01:00
Liang Qi 12a432c80f gui: fix build against gcc-14 (-Werror=calloc-transposed-args)
src/gui/painting/qpaintengine_raster.cpp:3811:42: error: ‘void* calloc(size_t, size_t)’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
     3811 |         m_clipLines = (ClipLine *)calloc(sizeof(ClipLine), clipSpanHeight);
          |                                          ^~~~~~~~~~~~~~~~
    src/gui/painting/qpaintengine_raster.cpp:3811:42: note: earlier argument should specify number of elements, later size of each element

Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: I41ec3dd5c439e5cd51dd917741125ce50659500e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-03-22 00:45:03 +00:00
Keith Kyzivat 0f77aff05f Don't accept QFileDialog when disabled item is activated
On macOS, entries that do not match the filter are shown in the
directory listing.

Do not accept the dialog when these entries are double-clicked
(activated).

Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-120768
Change-Id: If8ff6c56f1d21861b4e30051c212c9497042ed0f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-21 19:05:41 -04:00
Alexandru Croitor ecdbc40d40 CMake: Consider NO_UNSUPPORTED_PLATFORM_ERROR for non-bundle mac apps
Currently if qt6_generate_deploy_app_script is called on an executable
target that does not have the MACOSX_BUNDLE property set, it will
error out with a message about not supporting non-bundle apps.

This error is shown even if NO_UNSUPPORTED_PLATFORM_ERROR is passed
as an option which looks like an oversight.

Change the code not to show the error if NO_UNSUPPORTED_PLATFORM_ERROR
is passed. This means user projects can call
qt6_generate_deploy_app_script for non-bundle apps without having to
wrap the code in a if(NOT APPLE) check, and deployment will simply not
run for that target on macOS.

[ChangeLog][Build System] The qt6_generate_deploy_app_script
NO_UNSUPPORTED_PLATFORM_ERROR option will now have an effect when
calling the API on non-bundle macOS executable targets.

Pick-to: 6.7
Change-Id: I932d6bfa2d3c7e2aaf8be967fea1f682eacf0112
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-22 00:04:20 +01:00
Tatiana Borisova 2499de8874 QJsonArray: use new comparison helper macros
Replace public operators operator==(), operator!=() of
QJsonArray 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(QJsonArray, QJsonValue)
to the QJsonArray class, to support comparison between QJsonArray
and QJsonValue elements, see test-case fromToVariantConversions()

Task-number: QTBUG-120300
Change-Id: I8440ca0761bede8551ff792bfa7f22e47b56fa79
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-21 23:43:35 +01:00
Wladimir Leuschner 587003c3cc QWindows11Style: Add offset for decoration in QComboBoxPrivateContainer
Pick-to: 6.7.0 6.7
Change-Id: Ib9043e1b3041c88d757ddd5ada6c0edcf2bb6129
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-03-21 21:05:28 +01:00
Oliver Wolff 0cdeecf415 Make deployment of openssl plugin optional
Qt's openssl plugin is dependent on openssl libraries. Users should
make a conscious decision about deployment of the plugin and the
corresponing libraries so deployment of that functionality is now
opt in.

[ChangeLog][Tools][Windeployqt] Deployment of openssl plugins is now
optional. For proper deployment of openssl related functionality pass
in --openssl-root to make sure that openssl libraries are also deployed.

Fixes: QTBUG-117394
Change-Id: Iad43c7666b9af491f7695783b4e23a811256515b
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
2024-03-21 19:55:24 +01:00
Mårten Nordheim 505e7ec37d UDP: Protect call to UDP API based on feature
Fails to compile in some qtlite setup

Pick-to: 6.7 6.6 6.5
Change-Id: If04c1ca3f1b4eb59517902b8caab167f4627391b
Reviewed-by: Jari Helaakoski <jari.helaakoski@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-21 19:55:23 +01:00
Ahmad Samir 08cb919aa5 QFileInfo: checkAttribute should take lambdas by value
So that they are moved.

Pick-to: 6.7 6.6 6.5
Change-Id: I3d1767944200962be90d3eb8695c92a766c4c744
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-21 19:05:02 +02:00
Ahmad Samir fd295f4bf6 QAbstractFileEngine: remove member FileTime and use QFile::FileTime
This is probably a remnant from when QAbstractFileEngine was public API
since it's been changed to private API, just use QFile::FileTime.

Pick-to: 6.7
Change-Id: I60d3d4ff811f95434b81d5ca115f5d43cfff8b15
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-21 19:05:02 +02:00
Ahmad Samir 3c50ad8288 QFileSystemEngine: make factory functions return unique_ptr<QABFE>
This makes the ownership of the returned pointer clearer. It also
matches reality, some call sites were already storing the pointer in a
unique_ptr.

Also shorten the function name to "createLegacyEngine", you have to read
its docs anyway to figure out what it does.

Drive-by changes: less magic numbers; use sliced(); return nullptr
instead of `0`.

Change-Id: I637759b4160b28b15adf5f6548de336887338dab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-03-21 19:05:02 +02:00
Even Oscar Andersen 0737fca6b2 wasm: Qt::WA_ShowWithoutActivating was not respected
The Qt::WA_ShowWithoutActivating flag was not respected
Added test in the part of the code that calls
requestActivateWindow

Added selenium focus test

Fixes: QTBUG-122776
Change-Id: I1a248ed4352f86376d615a4cb7022e7ea095d4e7
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2024-03-21 17:50:00 +01:00
Marc Mutz edb8bac39b QSignalSpy: Extract Method init() from three ctors
Ideally, this wouldn't be a named function, but a delegatee
constructor, but the current structure of the three constructors
doesn't, yet, lend itself to extracting a delegatee constructor (the
tail is copied, not the head). To get there, we need more work (coming
up in follow-up commits).

Task-number: QTBUG-123544
Change-Id: I46dd030e314d67c2ab624279d669db76e58bc569
Reviewed-by: David Faure <david.faure@kdab.com>
2024-03-21 17:47:32 +01:00
Alexey Edelev 7aecb189d5 Add the error output for syncqt normilizedPath function
Task-number: QTBUG-123438
Pick-to: 6.5 6.6 6.7
Change-Id: If718d774daac2fd4a9e27ad4725a74362d1c78f3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-21 16:22:55 +01:00
Alexey Edelev df8c3d40c8 Use the correctly versioned variable when resolving ABI-specific cmake directory
Use the QT_CMAKE_EXPORT_NAMESPACE prefixed INSTALL_LIBS variable when
resolving the cmake path of the ABI-specific cmake directory.

Pick-to: 6.7 6.6 6.5
Change-Id: Ibc4a1b152135d840de104c15a183b13fca0739ea
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-21 12:50:22 +01:00
Anton Kudryavtsev f1b74f7b58 QHttpNetworkConnection: optimize startNextRequest
Use QVLA instead of QQueue to avoid allocations
and use QSpan to emulate queue behavior to avoid N^2

Change-Id: I333bc1af98a596fc041765996867a3d6449fcfde
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-21 14:43:33 +03:00
Marc Mutz d5d2688acb QSignalSpy::appendArgs(): move-append the QVariantList
Using the rvalue overload of append() is more efficient, since we skip
the alias check and the appendee's atomic ref-count ping-pong inside
lvalue append().

Pick-to: 6.7
Task-number: QTBUG-123544
Change-Id: Ia76fdf28cba13d524fbbe894658a86a45a1ebe79
Reviewed-by: David Faure <david.faure@kdab.com>
2024-03-21 11:20:49 +01:00
Marc Mutz 3a36fe91ab QSignalSpy: fix clazy-function-args-by-value
Clazy complains that QMetaMethod should be passed by value, so do
that.

Change-Id: I42afda5af6910eefc8783b1feac00fd11e1f017e
Reviewed-by: David Faure <david.faure@kdab.com>
2024-03-21 11:20:49 +01:00
Marc Mutz 78db468f48 QMetaMethod: document that fromSignal(nullptr) is ok
... and add a test.

Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: I907899d7c54349d2fc23ea5ab58a1e67826b622b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-21 11:20:49 +01:00
Marc Mutz c07a47cbf0 qtversionchecks.h: hide Q_OBJECT macro in C-style comment from automoc
Due to https://gitlab.kitware.com/cmake/cmake/-/issues/25770, the
presence of the Q_OBJECT macro here triggers automoc rule generation,
followed by moc's "No relevant classes found. No output generated."
warning.

Comment the macro out until the issue is fixed, leaving a comment to
avoid a helpful soul commenting the macro back in again.

Amends 32a1151245.

Task-number: QTBUG-123229
Pick-to: 6.7
Change-Id: I5387128f8fcd2793f0d4b9ff73a551999fea84b0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-21 06:08:58 +00:00
Marc Mutz 8e504bfeb7 QTest::qWaitFor(., int): remove superfluous static keyword
The static keyword prevents the linker from reusing the executable
code of one TU's instantiation of this function in other TUs.

There's no reason for this restriction, so remove it.

Amends 292cb12e02.

Pick-to: 6.7
Change-Id: Ide60ce0bf4b7118295fad98a25bd438fc1da2039
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-03-21 06:08:58 +00:00
Marc Mutz b97bcdd774 QSignalSpy: use NSDMI for m_waiting
One step closer to DRYing the ctors.

Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-123544
Change-Id: Iff73fe70e3d2de52548d10b2f38a7ba2bd7029cd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-21 02:00:19 +01:00
Marc Mutz a90c3cc3c7 QSignalSpy: fix indexed loop (int instead of qsizetype)
While a signal with more than 2Gi arguments is only a theoretical
possibility, still use the correct index variable for the indexed loop
over this QList<int>.

Pick-to: 6.7 6.6 6.5
Change-Id: I2ed33238c2cd9d2d1c39cd29c988a2adfd821897
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-20 21:23:39 +01:00
Marc Mutz 40714c1ddd QObjectPrivate::Signal: initialize all members
A recent change in that area triggered Clang-SA to rescan the code and
complain about this pre-existing bug: If receiver == nullptr, then the
`previous` member was never initialized.

Fix by null'ing it using NSDMI. This is a trivial type, the compiler
will be able to avoid the redundant write.

Amends ab92b9e40025dcf08c14232de762a268201a78b4(!).

Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: Ideed71f0f36d5f896fb6a4614f233757c1371ee3
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-03-20 21:21:06 +01:00
Ahmad Samir ceeaf1b657 QAbstractFileEngineIterator: add `bool advance()` virtual method
And remove hasNext/next() methods. This remodels QAFEI to be like
QFileSystemIterator. This better fits the logic in the newly added
QDirListing class (which uses STL-style iterators).

QFSFileEngineIterator:
Initialize the internal nativeIterator in the constructor; also replace
the advance() private method with an override for the advance() method
inherited from the base class.

QResourceFileEngineIterator:
Override currentFileInfo(), with a QResouces the QFileInfo is created
on demand if/when this method is called.

This is the backend/private API, and QDirListing is the public API that
can be used in a ranged-for to iterate over directory entries.

Change-Id: I93eb7bdd64823ac01eea2dcaaa6bcc8ad868b2c4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-20 21:49:59 +02:00
Tatiana Borisova cd5dd8b95b Xml: use new comparison helper macros
New comparison macros are used for following classes:
-QXmlStreamAttribute
-QXmlStreamNamespaceDeclaration
-QXmlStreamNotationDeclaration
-QXmlStreamEntityDeclaration

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

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

Add checkStreamNotationDeclarations()/checkStreamEntityDeclarations()
test-cases to test change.

Task-number: QTBUG-120300
Change-Id: I0b5642b2e23cc21ede7bc4888f0a9bddd6c08d07
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-20 19:50:01 +01:00
Paul Wicking c8fb376de5 Doc: Fix QDoc syntax in bindable properties overview
Drop the \c command when in front of \l commands as that doesn't work.

Pick-to: 6.7 6.6
Change-Id: I0aa092461807e068e9c2368f5d6f04e77b56c910
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: James DeLisle <james.delisle@qt.io>
2024-03-20 17:56:15 +01:00
Lucie Gérard 402e477456 Rename files for header generation
Pick-to: 6.7
Task-number: QTBUG-121039
Change-Id: I45eec26e93e5aa3e4a08ef4b326427338f63e3f2
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-03-20 15:24:07 +01:00
Isak Fyksen b1e8287b8d Extract method `bool QDomNodeListPrivate::maybeCreateList()`
Extract duplicated logic to own method, and call where previously used.
Also, make `QDomNodeListPrivate::[list|timestamp]` mutable, to allow
`maybeCreateList()` and `createList()` to be `const` methods, and avoid
`const_cast` in `QDomNodeListPrivate::length()`.

Task-number: QTBUG-115076
Change-Id: I4f3a27315da28082a12cc4f5653567039b4cb376
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-03-20 14:21:00 +00:00
Tatiana Borisova e5ebb9022a QCborMap: use new comparison helper macros
Replace public operators operator==(), operator!=(), operator<() of
QCborMap to friend methods comparesEqual() / compareThreeWay().

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

Delete #if 0 && __has_include(<compare>) blocks,
since they are not required anymore.

Add friend methods comparesEqual(QCborMap, QCborValue) and
compareThreeWay(QCborMap, QCborValue) to the QCborMap
class, to support comparison between QCborMap
and QCborValue elements, see test-case mapSelfAssign() ->
QT_TEST_EQUALITY_OPS(it.key(), QCborMap({{0, v}}), true);

Task-number: QTBUG-120300
Change-Id: I9e33df255d16484efd3124cf0632db859408fb5d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-03-20 15:21:00 +01:00
Tor Arne Vestbø b7eb73b1f0 iOS: Don't apply UIWindow safeAreInsets to available geometry on visionOS
There is no concept of a screen on visionOS, and hence no concept of
screen-relative system UI that we should keep top level windows away
from.

As UIWindow and UIScreen on visionOS report the exact same bounds, we
can't use the same code path we use for iOS/iPadOS to detect whether
to apply the safe area insets, so skip the logic entirely.

We still report the safe area insets on a QWindow level, so applications
can avoid rendering content close to UI elements such as the window
move and window close buttons.

Task-number: QTBUG-121781
Change-Id: I20ad02390564972a3715c27f351689b79ad579d8
Reviewed-by: Amr Elsayed <amr.elsayed@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-03-20 15:20:59 +01:00
Tor Arne Vestbø 17f6c62d97 iOS: Compute screen available geometry without UIScreen.applicationFrame
The API has been deprecated for a long time, and doesn't have the same
semantics as we want for modern iOS apps that may run in windowed mode
on iPad, macOS, or visionOS.

Instead we base the availableGeometry exclusively on the safeAreaInsets
of the screen's UIWindow. But we only do so if the UIWindow bounds match
the bounds of the UIScreen in each dimension. This means that iOS apps
that take up the entire screen, or run in Split View on iPad, will get
a smaller availableGeometry, but apps that run in Slide Over on iPad,
or windowed in Stage Manager on iPad, will get an availableGeometry that
matches the entire screen.

It's then up to the QWindow to take the safeAreaMargins into account
when rendering, to stay out of any UI elements that the OS may add.
We do this for QWidgets with layouts automatically, and the plan is
to do this for Qt Quick Controls as well. As the current situation
is quite broken anyways, we take the first step now, and then follow
up with the Quick changes later on.

Task-number: QTBUG-121781
Change-Id: I7728e117969474654fcccdb19a6c954bb0eea3f9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-03-20 14:20:59 +00:00
Vladimir Belyavsky 3924c945d1 QMovie: allow only one dimension to be used for scaledSize
In 4c21f72837 we did this for
QImageReader. So, to support the same for QMovie, we just need
to remove the custom (and very inefficient) scaling for frames.
This should be safe since the underlying QImageReader must ensure
that the returned image matches the scaled size.

[ChangeLog][QtGui][QMovie] Allow only one dimension (width
or height) to be set for the scaled size. In this case, the other
will be calculated automatically based on the original movie size
and maintaining the aspect ratio.

Fixes: QTBUG-115039
Change-Id: I50979a75970c79647dbb8c8b4b121266ba033a63
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-03-20 00:37:24 +00:00
Liang Qi 23a906335e xcb: Avoid recreating xcb window in QXcbWindow::requestActivateWindow()
12203e94f5 exposes the issue in xcb
qpa plugin.

We should not recreate xcb window via the call of focusWindow->winId().

Fixes: QTBUG-123032
Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: I6da4f3e64a9d7a92a2aab714591986c5d128fbd4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-19 23:31:41 +00:00
Tor Arne Vestbø 2da738f035 iOS: Use UIWindow bounds for fullscreen/maximized geometry on macOS
In modern iPad apps, windows can be moved between screens, just like
regular macOS apps, but we don't reflect this as changes to the QWindow's
screen, meaning the screen() is not reliable input when computing
a window's full screen or maximized geometry.

In addition, when running iOS apps on macOS as "Designed for iPad",
the system will scale the UI down by 77%, to better match metrics
(fonts, sizes) to the macOS environment. Classes like UIView and
UIWindow are oblivious to this scaling, and will think they are
larger than what they really are on the screen. However, UIScreen,
for some reason, reflects the actual screen size, instead of taking
part in the "inflated" view of the world.

As a result, even if screen() would reflect the correct screen the
window is on, we can't use the screen geometry for clamping the
window geometry, as the two have separate coordinate systems.

We could scale up the QScreen geometry accordingly to work around
this, but we don't know if the UIScreen behavior is a bug or not,
so instead we skip the screen() as input and use the UIWindow
bounds directly.

Task-number: QTBUG-121781
Fixes: QTBUG-106709
Pick-to: 6.7 6.6 6.5
Change-Id: Ie734fc477b37a7e39e6fb16d7738d3f69731a975
Reviewed-by: Amr Elsayed <amr.elsayed@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-03-19 23:04:46 +01:00
Ulf Hermann 4662e80755 Suppress bogus warning from gcc 12
It says:

/home/qt/qt6dev-src/qtbase/src/corelib/tools/qcontainertools_impl.h: In function ‘auto QtPrivate::sequential_erase_with_copy(Container&, const T&) [with Container = QList<void (*)()>; T = void (*)()]’:
/home/qt/qt6dev-src/qtbase/src/corelib/tools/qcontainertools_impl.h:383:14: error: ‘D.282000’ is used uninitialized [-Werror=uninitialized]
  383 |     const T &tCopy = CopyProxy(t);
      |              ^~~~~
cc1plus: all warnings being treated as errors

We can avoid storing the value into a const ref to silence this. Storing
a non-const pointer into a const reference is quite confusing anyway.

Fixes: QTBUG-123486
Pick-to: 6.5 6.6 6.7
Change-Id: I77fcd871724ce7f81b9567603dc5b4cb31f121c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-19 21:26:24 +00:00
David Faure 75d82afa0d QObjectPrivate: fix data race on ConnectionData contents
The atomic pointer "connections" is always populated under
mutex in QObjectPrivate::ensureConnectionData() but isn't necessarily
read under mutex protection (e.g. in maybeSignalConnected()).
This caused a data race, fixed by using storeRelease and loadAcquired.

Task-number: QTBUG-100336
Pick-to: 6.7 6.6 6.5
Change-Id: Ifd605e65122248eb08f49e036fdda6e6564226bc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-19 21:09:38 +01:00
David Faure e46f99fdaa QSignalSpy: make the mutex a member variable
The static inline was only a workaround for maintaining BC within
minor releases while backporting the fix. Since we don't promise BC for
QtTest between minor releases, we can make the mutex a proper member
variable for Qt 6.8.

Amends c837cd7593.

Change-Id: I0d6353bdd6a11daa4f927139abf9a867d8c9f95f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-03-19 20:09:37 +00:00
Marc Mutz 7565034aad QSignalSpy: fix C'n'P mistake in a qWarning()
The warning for the new-style signal constructor was copied from the
old-style signal constructor, but not adjusted to its new home. The
signal pointer passed here is not the signal "name", but a signal
"pointer" (-to-member-function, but no need to go into that much
detail).

Amends 6fc7d76e73, but not picking to
very strict LTS branches, just in case someone has a
QTest::ignoreMsg() installed on it.

Pick-to: 6.7 6.6 6.5
Change-Id: Ia1f6b7001f38202ac72f9945c4a822d81562cdbf
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-19 21:09:37 +01:00
Vladimir Belyavsky 4c21f72837 QImageReader: allow only one dimension to be used for scaledSize
If only one dimension (width or height) of the scaled size is set
by an user, let's try to calculate the second one, based on the
image original size and maintaining the aspect ratio.

[ChangeLog][QtGui][QImageReader] Allow only one dimension (width
or height) to be set for the scaled size. In this case, the other
will be calculated automatically based on the original image size
and maintaining the aspect ratio.

Task-number: QTBUG-115039
Change-Id: If1b13b1ead3cf788915c08bdb3ba8becd8bf8042
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-03-19 17:22:16 +00:00
Alexandru Croitor c90964788c CMake: Add option to allow skipping app deployment when building in CI
We would like to add deployment api calls to all our examples.
Doing that in the CI, where we build all examples, would mean running
the deployment tools for each example. This takes time and space.

Add the option to skip running deployment code by setting the
QT_INTERNAL_SKIP_DEPLOYMENT variable.
This can be set per-directory or at the root directory.
In that case we will generate an install script that does nothing.

With this option, we can ensure we run deployment for a few examples,
but skip it for the rest.

Also skip running the deployment api for non-prefix builds, because it
only partially works. In such a case, show a warning. The warning
can be hidden by setting the QT_INTERNAL_HIDE_NO_OP_DEPLOYMENT_WARNING
variable. This might be revisited in the future.

The newly introduced helper functions are also meant to be used in
qtdeclarative.
qtbase only uses one of them, because currently it does not contain
POST_BUILD deployment logic.

Pick-to: 6.7
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Task-number: QTBUG-102057
Change-Id: If5a4102137e9dfc4a8bfde7b26d511ed1700340e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-03-19 17:20:23 +01:00
Alexandru Croitor a6965441d7 CMake: Evaluate genexes for extra deploy file paths
Since d08fa86e63 we add extra deploy
files with target file information.

The file paths contain a $<CONFIG> genex to handle multi-config
builds. These were not evaluated in the DeploySupport file content.

Add a TARGET_GENEX_EVAL genex around the TARGET_PROPERTY genex, to
ensure they do get evaluated.

This avoids an error like:
 include could not find requested file:
   C:/Users/qt/work/qt/qtbase_build/.qt/QtDeployTargets-$.cmake

Amends d08fa86e63

Pick-to: 6.7
Task-number: QTBUG-117948
Task-number: QTBUG-118153
Change-Id: Ia3898c31d80b82bdb25fe733fc73b45c6d689ed0
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-19 16:48:58 +01:00
Tatiana Borisova 8ed8844343 QCborArray: use new comparison helper macros
Replace public operators operator==(), operator!=(), operator<() of
QCborArray to friend methods comparesEqual() / compareThreeWay().

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

Delete #if 0 && __has_include(<compare>) blocks,
since they are not required anymore.

Add friend methods comparesEqual(QCborArray, QCborValueConstRef)
and compareThreeWay(QCborArray, QCborValueConstRef) to QCborArray
to support comparison between QCborArray and
QCborValueRef/QCborValueConstRef, see test-case mapMutation().

Add QT_TEST_EQUALITY_OPS/QT_TEST_ALL_COMPARISON_OPS tests for QCborArray
test-cases.

Task-number: QTBUG-120300
Change-Id: Ifad1a04c61363618e8bba73cf7c87757552d722a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-19 14:38:11 +00:00
Tor Arne Vestbø 14ec2ab89f Add configure feature for Metal
Simplifies maintenance of code paths that rely on Metal.

Change-Id: I1d1f705fffc14dbafde346eeb555b43be6d5be54
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-19 14:52:48 +01:00
Tor Arne Vestbø e8e029e2a5 iOS: Replace deprecated UTType constants
Change-Id: Ia610d46cf36292327ef87645af7516754eb1c79c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-03-19 14:52:48 +01:00
Tor Arne Vestbø 317a519431 iOS: Remove support QClipboard::FindBuffer
The Find pasteboard has been unavailable on iOS since iOS 10.

Change-Id: I05d5ae49b3a733144ac5c35970ff4a3c62923650
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-03-19 14:52:48 +01:00
Mate Barany 282839ad41 Add a means to send a PUT request with an empty body
We have implemented the same functionality recently for POST, in this
patch implement it for PUT.

Task-number: QTBUG-108309
Change-Id: I34c41538054fec836d0d1d1dbb44fabab9bc0e9a
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-19 13:01:31 +01:00
Mate Barany e566a8a968 Add a means to send a POST request that has an empty body
Actually this has already worked if a nullptr was casted as a
QIODevice*. Add an overload with a nullptr_t type, that does
this behind the scenes.

Fixes: QTBUG-108309
Change-Id: I2d4b17ae94cf4de2c42257d471ef901c8994fee5
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-19 13:01:31 +01:00
Piotr Wierciński cd2e1b0b4b wasm: Fix minimum and default window sizes
Remove minimum window size restriction. User should be able to change
minimum window size if needed.
Set default size to 160x160 to match other platforms.

Change-Id: Ic199fc34982021ba38d631476fbb1c51370b2e8e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-19 11:51:00 +01:00
Ulf Hermann 476e503cfb QProperty: Use RefCounted as intended
You're not supposed to mess with the refcount directly. That's what the
addRef() and deref() methods are for.

Change-Id: I5cae946cef7ac72dd99b247ade95590d142c269e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-03-19 11:51:00 +01:00
Mitch Curtis ce9f06c157 Doc: explain how to check for the existence of a font family
bb6d68703b67e042e2a7254c2ca6a004a1441cc5 fixed warnings in the
Universal style by using a faster alternative. It's possible that users
will run into these warnings too, and they should be provided with
information to make a more informed choice about which approach they
can use.

Fixes: QTBUG-123360
Pick-to: 6.5 6.6 6.7
Change-Id: I4170e9ade40c4b54dbc2bd73d124b2ade4d8c939
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2024-03-19 12:31:31 +08:00
Tor Arne Vestbø a89a916377 iOS: Remove NSView.safeAreaInsets wrapper
The API is available on all iOS versions we support nowadays.

Pick-to: 6.7 6.6 6.5
Change-Id: Ia58c5ad1649e7e6b22f9c56a809e2455586a8e5a
Reviewed-by: Amr Elsayed <amr.elsayed@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
2024-03-19 01:52:29 +01:00
Yifan Zhu daa5f7bd5f qxkbcommon: fix isKeypad
This amends a34e81ab8b .

The previous range comparison doesn't work since XKB_KEY_KP_9 is 0xffb9
while XKB_KEY_KP_Equal is 0xffbd. Change to an explicit switch.

Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: I3a340bac61fb074eef505ef9b06300a6468877f1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2024-03-19 00:52:29 +00:00
David Faure c837cd7593 QSignalSpy: fix data race between wait() and emit from another thread
Detected by TSAN in tst_QThread::terminateAndPrematureDestruction()
but better have a dedicated unittest, with values emitted by the signal
and recorded in the spy.

Pick-to: 6.7 6.6 6.5
Change-Id: I141d47b0ea0b63188f8a4f9d056f72df3457bda5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-19 00:55:15 +01:00
Tatiana Borisova 2b2cd119e1 QCborValueConstRef/QCborValueRef: use new comparison helper macros
Replace public operators operator==() and operator!=() of
QCborValueConstRef and QCborValueRef classes
to friend methods comparesEqual().
Replace public operator<() of QCborValueConstRef and QCborValueRef
classes to friend methods compareThreeWay() respectively.

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

Delete #if 0 && __has_include(<compare>) blocks,
since they are not required anymore.

Add comparison() test-case for QCborValueConstRef/QCborValueRef
testing.

Add QCborValue::operator==()/QCborValue::operator!=()/
QCborValue::operator<() and QCborValueRef::operator==()/
QCborValueRef::operator!=()/QCborValueRef::operator<() operators
to the removed_api file.

Task-number: QTBUG-120300
Change-Id: I2e8e4e32b7b5b49da321364cc12986e9c64b5f37
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-19 00:48:23 +01:00
Thiago Macieira 5401a9a6cd QDBusArgument: disambiguate between QMap on std::pair and std::map
For QMap on a std::pair, QMap::iterator{}.operator->() would result in a
type that has "first" and "second" members: std::pair itself. But it
would be wrong to marshall and demarshall the first and second elements
thereof as the key and value, so give preference to the .key() and
.value() selection, which would store the std::pair as the type.

Fixes: QTBUG-123401
Pick-to: 6.5 6.6 6.7
Change-Id: I6818d78a57394e37857bfffd17bd69bb692dd03b
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-18 14:43:13 -07:00
Eskil Abrahamsen Blomfeldt 6ee5fcc456 Support foreground gradient in CSS parser and HTML generator
Qt supports some complex foreground brushes which we cannot
express using normal CSS, so we introduce a Qt-specific property
for this. We already had some support for background gradients
in widget style sheets, but this expands support to foreground
brushes of text when converting a QTextDocument from and to HTML.

It also adds an optional "coordinatemode" attribute to the
gradient functions so that this can be faithfully restored from HTML.

Task-number: QTBUG-123357
Change-Id: I3d6dd828f68272995c8525bec5a7b421fdbed670
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-03-18 20:28:36 +01:00
Eskil Abrahamsen Blomfeldt e205edfff6 Implement support for stroke color and width in CSS parser
CSS does not have text outline properties, instead different
browsers have custom properties for this. That currently means
that you can have a QTextDocument where you applied a stroke to
text and textEdit.setHtml(textEdit.toHtml()) will remove it.

Since a primary goal of the HTML support in QTextDocument is that
it can be used to save and faithfully restore its contents, we
implement qt specific properties for stroke.

Task-number: QTBUG-123357
Change-Id: Id9cf63abfabe2109ffb6fd74f9cb013304763ccb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-03-18 20:28:36 +01:00
Thiago Macieira 58796ac177 qfloat16: further disable the -Wfloat-conversion warning
It shows up in our headersclean mode.

Fixes: QTBUG-123374
Pick-to: 6.6 6.7
Change-Id: I6818d78a57394e37857bfffd17bcf9e350dc493c
Reviewed-by: Simo Fält <simo.falt@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-03-18 12:28:36 -07:00
Liang Qi 8a67504754 Fix dangling references - GCC 14
This amends 18def77d27 .

Pick-to: 6.7 6.6 6.5
Change-Id: Icadf46326f1fda1bdbcd40d101170581e510b87a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-18 20:28:36 +01:00
Øystein Heskestad 89467428f8 QHttp2Connection: Send error for CONTINUATION without preceding data
Send connection error type PROTOCOL_ERROR when receivng CONTINUATION
frames without any data received from previous HEADERS or PUSH_PROMISE
frames, instead of assert.

Task-number: QTBUG-122375
Pick-to: 6.7
Change-Id: Ib14e4610692dc4832b1f3e99dca497d9baf3d9d3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-18 20:28:36 +01:00
Tatiana Borisova 9377039fe5 QCborValue: use new comparison helper macros
Add qcborvalue.h header to removed_api.cpp file
Ammends from 15da9c75d0a05b7451a35b5b6a3c940f9cb85143

Task-number: QTBUG-120300
Change-Id: Ic33bf80298730f2c3fd408ffb45f0e1b32f531fc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-03-18 20:28:36 +01:00
Tor Arne Vestbø d04cf2c58b cmake: Rename QT_UIKIT_SDK to QT_APPLE_SDK
The SDK is relevant for all Apple systems, including macOS, iOS, tvOS,
watchOS, and visionOS.

We still pick up -DQT_UIKIT_SDK for iOS for compatibility.

[ChangeLog][CMake] The -sdk configure argument now maps
to the QT_APPLE_SDK CMake variable. QT_UIKIT_SDK is still
supported for iOS builds for compatibility.

Change-Id: I983a2f23c2414eb73cd35bb83738088defb45cbd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-18 19:04:14 +01:00
Ivan Solovev 09705c74b2 QByteArrayView: use new qdoc commands to document relational operators
Do not remove the existing documentation for now, because the new
commands do not contain any links to explain what the types of ordering
actually mean.

Fixes: QTBUG-108805
Change-Id: I1297c435d700d02968f0d7d3a922af78a61d7e45
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-03-18 16:42:19 +00:00
Mårten Nordheim 5ed736b053 Http/2: fix active streams counting
We were looking at all active streams, but that also includes promised
streams.

By the RFC the limitation that our peer specifies only applies to the
number of streams _we_ create, not the total amount of active streams.

More importantly, for the qhttp2protocolhandler it could mean that we
could end up having a few promised streams push the active stream count
over the limit, which could lead us to start more streams than intended
(then bounded by the number of queued requests).

The worst case in this scenario is that a **non-compliant** server
doesn't track how many connections we open and the user has queued
a ton of requests, so we open a ton of streams.

But on the upside: server-push is not widely used.

Pick-to: 6.7
Change-Id: I2a533472eb9127fd176bb99e9db0518f05c3fffe
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-18 17:42:19 +01:00
Mårten Nordheim b0b2b7d39d Http2: fix streamsToUse logic
The settings frame with the max streams might be received late
or be revised later, so we cannot assert something on the
relation with the max streams allowed.

Amends 22c99cf498

Pick-to: 6.7
Change-Id: I973dfcf91541becc8c3d6363f9065bb1b9183062
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-03-18 17:42:19 +01:00
Ulf Hermann 717dc9450f QProperty: Destroy binding when refcount is 0
This has to be done from all places where we deref it. Otherwise we leak
memory.

Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-116086
Change-Id: I57307ac746205578a920d2bb1e159b66ebd9b2cc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-03-18 17:42:19 +01:00
Ivan Solovev aab82ff367 tst_qstringapisymmetry: add qCompareThreeWay() checks
Check that all string-like types implement compareThreeWay() as a
(hidden) friend function.

This test revealed some problems: because QByteArrayView is implicitly
constructible from QLatin1StringView, the qCompareThreeWay() call
sometimes picked the compareThreeWay() overloads with QByteArrayView
instead of picking the "reversed" overloads that use QLatin1StringView.
This was leading to wrong results, because QByteArrayView is
interpreted as utf-8 data, not latin-1.

Explicitly add the missing compareThreeWay() and comparesEqual()
overloads.

Note that relational operators were never affected by this problem,
because in C++17 mode we explicitly generate the reversed versions,
and in C++20 mode the compiler does that for us.

Task-number: QTBUG-117661
Change-Id: Ia96af59c60ebf2fae6cf2a49231d6b6f401aceaa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-18 17:42:18 +01:00
Ivan Solovev fff6562f8c Rework QByteArrayView comparison helpers
Commit fb50ab7006 replaced relational
operators in QByteArrayView with comparison helper macros.

That commit had to implement the helper methods as static members
instead of hidden friends, because otherwise it broke the
construction of QByteArrayView from QLatin1StringView.

The reason for that is the conditional noexcept on the relational
operators. The noexcept(noexcept(comparesEqual)) check inside the
class declaration expands before the class is complete, and as a
result discards the QByteArrayView constructor, which is restricted
by the QtPrivate::IsContainerCompatibleWithQByteArrayView trait.

Back then I could not find a proper solution, so just decided to
declare the helper functions for QByteArrayView as private static
members.

Such approach has two drawbacks:
- all new helper functions for QBAV vs other type T relational
  operators should also be static member functions, because
  the compiler always prefers member functions over friend
  functions, even if the argument types do not match.
- QBAV helper functions cannot be used in generic code. Also,
  qCompareThreeWay() would not work for QBAV.

To fix the issue this patch explicitly adds a
QByteArrayView(QLatin1StringView) constructor which is not
restricted by any trait. To keep the constructor constexpr, we
have to move the actual definition into qlatin1stringview.h
header file.

Integrity compiler also complains about
QByteArrayView(QUtf8StringView) constructors, so the same approach
is used to enable them.

This allows to convert all the private static member helpers in
QByteArrayView to hidden friends.

The extended tests will be added in a follow-up commit, because
they require some more changes.

Amends fb50ab7006 and
a08bafc920.

This patch removes some exported methods and adds new ones, but
it is not BiC, because the aforementioned patches are only merged
into dev branch at this point.

Task-number: QTBUG-108805
Change-Id: Iee6526a71d859c4fcb2e95bf20fe84ddead6dfb0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-18 17:42:18 +01:00
Axel Spoerl 769f68b19b QGraphicsProxyWidget: 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.

Task-number: QTBUG-121478
Change-Id: I741e6875e686a9cfb4e6a113e7575c911a38e80c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-18 17:21:22 +01:00
Axel Spoerl 268fa11eef QApplication: use focus abstraction instead of QWidget::focus_next/prev
Focus abstraction in QWidgetPrivate makes direct access to
QWidget::focus_next and focus_prev an antipattern.

Remove usage.

Task-number: QTBUG-121478
Change-Id: Iaab97024c20b97a0d9850dce43816a432d4bc7a1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-18 17:21:22 +01:00
Eskil Abrahamsen Blomfeldt e7ddd490cf Fix default hinting with dpr scaling on Wayland
When high-dpi scaling is enabled, we default to HintNone
currently, since otherwise text layouts (and widget layouts
and anything depending on text size) will have to be updated
when the window is dragged onto a screen with a different dpr.

The check for whether scaling is enabled was based on
QHighDpiScaling::isActive(), which is technically incorrect
since this does not return whether there is a scale on the
painting, rather whether the coordinate system in Qt matches
the one of the platform.

Now that we support agreeing on fractional scale factors with
the Wayland compositor, this issue has become visible, since
QHighDpiScaling::isActive() will now return false for these
compositors, even for fractional scales. For integer scales,
the issue existed before as well, but the kerning issues are
less noticeable in that case.

Pick-to: 6.6 6.7
Fixes: QTBUG-122910
Change-Id: Ic82b07d57a06a351255619f9227dd60396903ade
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
2024-03-18 15:19:00 +01:00
Axel Spoerl f2b681dc59 Documentation: Clarify palette/font/stylesheet inheritance/propagation
Palette and font changes made by a style sheet are propagated to
existing widgets and their children at change time.

Palette and font changes made by setPalette() and setFont() are
inherited by all existing and future children of the widget to which the
call was made.

Clarify this in the documentation.

Fixes: QTBUG-122588
Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: Ic40d96fc1e5e4507f84a33138303b7193948d3fe
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-03-18 14:19:00 +00:00
Edward Welbourne 1618ff825c Condition inline fromString() definitions on datestring feature
Amends commit 41f84f3ddb - QDate and
QDateTime declare fromString() methods only when feature datestring is
enabled. So their inline implementations should also be conditioned on
that feature.

Pick-to: 6.7 6.7.0
Change-Id: I84fc877001d3fc97c6ca149864e4ad5a2dbabe87
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-18 14:59:26 +01:00
Edward Welbourne 4017bc5adc Introduce feature timezone_locale and begin implementing it
The feature remains disabled for now since its implementation is
incomplete. This facilitates introducing the various parts of it in
reviewable chunks, prior to actually plumbing it into the code that'll
end up using it and enabling it. Includes stubs of the files that
shall contain its source code.

Task-number: QTBUG-115158
Change-Id: Ie49251c0aaf5feaf1ff522e469479020e4c73065
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-18 14:59:26 +01:00
Øystein Heskestad 9b386127a0 QHttpConnection: Create new streams returns error when ids are exhausted
CreateStream returns a new error code, StreamIdsExhausted, when next
stream id counter exceeds max stream id instead of assert.

Task-number: QTBUG-122375
Pick-to: 6.7
Change-Id: I653b20c24c1429fe88d476beb1ca952aa1bbb320
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-18 13:17:19 +00:00
Piotr Wierciński 03bd62e7c7 wasm: Only raise top level windows upon activation
Change-Id: Ied0ccfdc7bdb41d008ea38a6ece1e5483c0eda25
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-03-18 14:17:19 +01:00
Eskil Abrahamsen Blomfeldt 4913511d3b Revert "Don't do font merging for PUA characters"
This reverts commit fc33fea999.

The change caused issues with system-wide PUA fallbacks on
platforms where this is supported. It needs to be replaced by
an approach which still falls back, but only for fonts which
are explicitly categorized as PUA fallbacks.

Pick-to: 6.5 6.6 6.7
Task-number: QTBUG-110502
Change-Id: I985a1f8076645593c50e81759872b4227d0fcd0d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-18 09:09:07 +01:00