Commit Graph

63412 Commits

Author SHA1 Message Date
Friedemann Kleint
6f8398c8eb hellogl2 example: Streamline code
- Shorten menu code, add keyboard shortcuts and a quit action.
- Avoid calls to setLayout().
- Pass a parent to message boxes.
- Use the current screen for size calculation and consider
  availableGeometry().
- Prevent closing by the Escape key in docked mode.
- Split the dockUndock() function into dock()/undock() for clarity

Pick-to: 6.6 6.5
Change-Id: I007da3bff86ee3f2dc8f87379e5d2ba2f0f6f3d7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-09-18 22:45:36 +02:00
Eskil Abrahamsen Blomfeldt
5641a5e1e5 Upgrade to Freetype 2.13.2
Task-number: QTBUG-117135
Pick-to: 5.15 6.2 6.5 6.5.3 6.6 6.6.0
Change-Id: I2485cf286f590eccee9c4be4bb19559631288fd5
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2023-09-18 20:26:55 +00:00
Laszlo Agocs
ffb857e9d0 Sync rhi backingstore prefer-software env.var with Quick
Behaving differently in QQuickWindow vs. a QRhi-based widget
window is not great for WebEngine. The env.var naming is not
the best (QSG prefix) but we already have some precedent for
this (recognizing QSG_INFO in QRhi), and there is no other
choice anyway.

Pick-to: 6.6 6.5 6.6.0 6.5.3
Task-number: QTBUG-116445
Change-Id: Ibfd495cbd1d42502441d6629325bdeb033e813f3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-09-18 20:26:22 +00:00
Ilya Fedin
12d6fc5229 xcb_egl: Prefer eglCreatePlatformWindowSurfaceEXT to eglCreateWindowSurface
Change-Id: I32de5b241cce786318434e7653ff979cf8e82f0e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-09-19 00:13:30 +04:00
Axel Spoerl
6f5136ef66 QMessageBox::about / aboutQt - use native modal dialog on iOS
The about / aboutQt statics in QMessageBox used a non-native, non-modal
dialog box on all operating systems. This creates a grid layout with
labels for heading, text and icon.

This has two unwanted side-effects on iOS:
- When the screen size is not sufficient to display all text, the text
is not rendered. On an iPhone SE for example, only the Qt icon is visible.
- When the screen height exceeds the minimum requirement, the informative
text is bottom-aligned.

=> Show about(Qt) message boxes in a modal, native dialog.
=> Update documentation.

This partly reverts aafed07dee.

[ChangeLog][iOS] QMessageBox::about(Qt) now shows native, modal dialog.

Fixes: QTBUG-115832
Pick-to: 6.6 6.5 6.2
Change-Id: I4cfbce416e7d2717058bef9a050a85d424b8a03d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-09-18 18:24:37 +02:00
Ivan Solovev
ab9f5a9a0b QAbstractAnimation: avoid spurious dependencies on the state property
The state property is read-only, meaning that it can only be modified
from the class internals. At the same time, the public start(), stop(),
pause(), and resume() methods, as well as a private setState() method
can be called from other property setters, thus creating an unwanted
dependency on state.

Fix it by using valueBypassingBindings() when reading the state.

Task-number: QTBUG-116346
Pick-to: 6.6 6.5
Change-Id: I404cd2141ea52b8ffed5edbb4261a535cd329ec2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-09-18 18:24:37 +02:00
Andy Shaw
4583d808ea SQLite: Update SQLite to v3.43.1
[ChangeLog][Third-Party Code] Updated SQLite to v3.43.1

Pick-to: 5.15 6.2 6.5 6.6 6.6.0
Fixes: QTBUG-117139
Change-Id: Id4f7d55adb317f009613245510c4eb26678ddc7a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-18 15:10:22 +00:00
Allan Sandfeld Jensen
cb42c94078 Compress UpdateLater events
Handle UpdateLater events in QApplication::compressEvents

Pick-to: 6.6
Change-Id: I0c63f88d8ed90fc56c093c534394461797d1336b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-18 15:50:43 +02:00
Ievgenii Meshcheriakov
178a5d15ef QDBusConnectionPrivate: Protect access to serverConnectionNames with mutex
This list is accessed by ~QDBusServerConnection in a user thead.

Task-number: QTBUG-116621
Change-Id: Ic115612b2a0f12fd9f69f38f4662dc36fffbf178
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-18 15:50:43 +02:00
Ievgenii Meshcheriakov
eacff46af4 QtDBus: Check if QDBusServer is destroyed before accessing it
Also lock before accessing serverObject member, it is cleared
by ~QDBusServer().

Task-number: QTBUG-116621
Change-Id: I14c96e34316a46fe43ecd929e44cd1800ba8b803
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-18 15:50:43 +02:00
Thiago Macieira
2156778184 QOperatingSystemVersion: Move the new OSes into a non-exported class
The solution from commit 3446313c7a didn't
work completely as expected. That commit the QOperatingSystemVersionBase
base class so we could add new static constexpr inline variables to
QOperatingSystemVersion in patch releases. We need a different base
class because you can't have constexpr variables of incomplete types and
the the type isn't complete inside its definition.

However, QOperatingSystemVersion is an exported class and there's an
unexpected interaction between __declspec(dllexport) / dllimport and
inline variables: they're imported from the DLL that exported them. For
Qt 7 we can remove this class's export, but not until then.

This commit adds to the fix by introducing a middle base class, so we
can add the static constexpr inline variables.

Pick-to: 6.6 6.6.0
Change-Id: Ifa1111900d6945ea8e05fffd177e0b696209c7af
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-18 12:58:26 +00:00
Vladimir Belyavsky
6b4cc9bf73 QNetworkConnectionEvents: fix potential nullptr access
Fix potential nullptr access in
QNetworkConnectionEvents::getNetworkConnectionFromAdapterGuid().
This can happen if for some reason the NetworkListManager instance
failed to be instantiated in QNetworkConnectionEvents constructor.

Fixes: QTBUG-117097
Pick-to: 6.6 6.5
Change-Id: If51ea383e22461a6c3124576c4e1be3f30dde1f6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-09-18 12:21:44 +00:00
Anton Kudryavtsev
1e25bf5f4d platforms/windows: use qimage rvalue overloads more
Change-Id: If827f0daa5036dbc9855c0209ec0621a9e8bf78e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-09-18 10:14:33 +03:00
Anton Kudryavtsev
0ed8db7800 QString::toHtmlEscaped: avoid unconditional copy
Let's find replaceable chars and then do copy

Change-Id: I2d365626218b0daf2023144dee7e901e8e99adc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-09-18 10:14:22 +03:00
Anton Kudryavtsev
bd5d313197 QString::replace: replace QList with QVLA
to reduce allocations

Change-Id: Iacc34e3a8825ca6425e8716f2b5e7b5dde2a5df7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-18 10:14:16 +03:00
Anton Kudryavtsev
48a44cdf65 QString: use first and last more
It's safe here, precondition is earlier

Change-Id: Ib2192fc729cd012d0983843678c546283a655bfd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-09-18 10:13:59 +03:00
Tor Arne Vestbø
34a0dbc3a9 qmake: Bump supported macOS SDK version to 14 (Sonoma)
Pick-to: 6.6 6.6.0 6.5 6.5.3
Change-Id: I49f97e844729f2b99af6efad00d024db13050ea1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-09-18 03:10:18 +02:00
Thiago Macieira
9edb835904 IPC: Move the legacy key to the QNativeIpcKey
This is needed to support passing it to other processes so they can
enable legacy, compatibility mode. Right now, there's no such code, but
I am 90% certain we'll need it soon in 6.6.x, if not for compatibility
changes in the future.

There's a bug in passing a QNativeIpcKey to another process that causes
QSharedMemory to use the wrong QSystemSemaphore for control (a feature
that should never have existed in the first place, but we're 15 years
too late on that). I have not yet investigated a fix for this, but it
will likely involve knowing the original legacy key.

Pick-to: 6.6 6.6.0
Change-Id: Idd5e1bb52be047d7b4fffffd1750b547013cb336
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-17 18:10:18 -07:00
Thiago Macieira
18867845eb IPC: disallow unknown queries in QNativeIpcKey string form
So we can add them in the future but cause older versions of Qt to
reject them if they don't know what they are.

Pick-to: 6.6 6.6.0
Change-Id: I512648fd617741199e67fffd1782b85935bb832a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-09-17 18:10:18 -07:00
Thiago Macieira
eb5c5a76cf IPC: Remove the "small" object optimization in QNativeIpcKey
The original design was supposed to be small, at a single pointer, but
that never made it through, with the "QString key" member. So the
anonymous union for typeAndFlags overlapping with the extension pointer
was just unnecessary headache.

So separate the two. This means QNativeIpcKey's size increases from 4
pointers to 40 bytes on 64-bit systems and to 24 bytes on 32-bit systems
(so we have 6 unused bytes on both architectures).

Fixes: QTBUG-116821
Pick-to: 6.6 6.6.0
Change-Id: I512648fd617741199e67fffd1782b7d5ba5ddd12
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-17 18:10:18 -07:00
Thiago Macieira
b5584ed224 IPC: make the two platformSafeKey functions return QNativeIpcKey
There's no need to return QString, only to create the QNativeIpcKey
elsewhere, when nothing uses this intermediary QString (those two
functions aren't used in unit tests any more, since the two "IPC: add
native key support" commits (2c286561bb
and 3ae052d3bb). Since they aren't used in
the tests, we can remove the Q_AUTOTEST_EXPORT macro too and the
unnecessary default argument.

I'll need the ability to return QNativeIpcKey to store the original,
legacy key inside of it.

Pick-to: 6.6 6.6.0
Change-Id: Idd5e1bb52be047d7b4fffffd17506c05e4f61f79
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-17 18:10:18 -07:00
Nicolas Fella
b2e5f70490 QDBusConnection: Print error from prepareHook
When the operation fails we print a warning, but that warning does not
include the error message that prepareHook internally collects but
ignores.

Printing the error is useful for debugging.

Pick-to: 6.6
Change-Id: I946c4781942115a17ffd43a79bff7676b6674be1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-17 23:39:04 +02:00
Giuseppe D'Angelo
2fd4a86dc5 QDataStream: prevent accidental streaming of pointers
It doesn't make sense to stream a pointer, but it can happen by
accident because ds << ptr will select the operator<<(bool) overload.
Disable the out-stream operator for pointers by having a better match.

Reading a pointer from a QDataStream doesn't work, as a pointer
can't bind to e.g. a bool non-const reference.

[ChangeLog][QtCore][QDataStream] Streaming of arbitrary pointers
using QDataStream has been disabled. Note that such streaming happened
through the streaming operator for bool.

Change-Id: I4c98a33b52aae85e441f5a096efd404fbbf1e95f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-17 18:33:47 +00:00
Vladimir Belyavsky
b0ba5c78ee QWindow: bail out early on resize() if size has not changed
On some platforms, like Windows and Linux, calling resize() may
unexpectedly reset window state even when the actual size has not
changed. So, bail out early on QWindow::resize() if new size is the
same.

Task-number: QTBUG-115699
Change-Id: I64ad611044008964b5201951a50f3866e2108b49
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-09-15 20:51:29 +00:00
Edward Welbourne
9c0def81e4 Warn on failure to construct valid system time zone object
Also move some docs from asBackendZone() to systemTimeZone(), making
clear that the system zone object is current at the time of creation
and won't be updated if the system is reconfigured. Adapt some tests
to fail and make clear that the system is misconfigured if no valid
system zone is found.

[ChangeLog][QtCore][QTimeZone] If systemTimeZone() is unable to
identify a valid system time zone, it now produces a warning the first
time it encounters the problem.

Task-number: QTBUG-116017
Change-Id: Ia437d8a03ff3cbf2b2cd98e8a8c3aebe50c1ee32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-15 21:53:36 +02:00
Edward Welbourne
59bf9160cc Fix warning on invalid time-zone lookup
Amends commit 569dc0de50 to still return
when no zone file is found with the given name, as the code did
before.  Attempting to continue past the error was provoking warnings
from QIODevice::read().

Pick-to: 6.6.0 6.6 6.5
Task-number: QTBUG-116017
Change-Id: I0e224a6b30a3f32cd925d87ffba4dcb24f9b8568
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-15 21:53:36 +02:00
Edward Welbourne
ccd59b2d4f Check input and output converters do support the relevant directions
It was previously possible to select an input-only converter for
output or an output-only converter for input. Also add a comment to
explain why failure to probe for the auto output converter isn't an
error, where failure to probe for the auto input converter is.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I17dfbbee7d8b5a9629e66d0e1a6a4014b01a7262
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-09-15 21:53:36 +02:00
Edward Welbourne
b9787a3985 Replace the image to illustrate the Serialization Converter
The old image wasted a log of space, was poorly legible and showed
little more than the cbordump example's illustration shows. Make
explicit that we get an initial CBOR file from savegame, show how it
can be converted to and from XML (idempotently) and still find space
to show the same thing as before. All more legibly and in a smaller
file.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Ifc599d0dd646f136ccd2860ca927186d478b0fb9
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
2023-09-15 21:53:36 +02:00
Edward Welbourne
781042efcb Implement some TODOs: make use of GLibc's tm_gmtoff and tm_zone
Save some complicated computations using struct tm and (effectively)
time_t used in working out local-time's UTC offset and updating the
local time's representation in terms of seconds (since a nominal local
epoch). GLibc gives us the offset for free, making computation of the
seconds easy.

Use the same extension to catch an opportunity for a seldom-needed
early return in one more case.

When determining a zone's abbreviation, we can use tm_zone as a
short-cut to save some mutex-locking.

Change-Id: Id2958f75c1d49ad4aed8f9c483ec13f4fe3a86c2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-15 21:53:36 +02:00
Edward Welbourne
b6761d098b Don't assume time-zone offsets at epoch were multiples of five minutes
Africa/Monrovia violates that assumption. We can replace the tests
that relied on it with another, but only when we know the offset from
UTC (to come in later commits).

Change-Id: Iccc4f03f4e0e4087530cb5ca0c7d26ee4177d01e
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-15 21:53:35 +02:00
Edward Welbourne
644ad1fa1a Rework resolution of local time
Ensure we do know about - and handle - transitions whenever one is
implicated. Make their handling more consistent between platforms
instead of depending on (and in some cases kludging around) quirks of
the underlying time_t functions.

Change-Id: Iefa8dda0d8da78b860e06cee895c9dd268d7a4e5
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-09-15 21:53:35 +02:00
Friedemann Kleint
98e0600c5a Add Python-specific note to QOpenGLContext::aboutToBeDestroyed() documentation
The signal is not received when emitted from the destructor.

Pick-to: 6.6 6.5
Fixes: PYSIDE-2460
Change-Id: Ic2273c5b9ef1f53bd58615b6982016e646aee326
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-09-15 21:47:44 +02:00
Giuseppe D'Angelo
1399b3ccce Apple event dispatcher: "clarify" copy semantics of ProcessEventsState
QEDCF::processEvents makes copies of ProcessEventsState, which contains
atomics. The memory ordering semantics when those atomics are used
are not clear at all -- given the lack of comments in the code around
them, and the lack of named operations (e.g. loadAcquire).
In principle, it looks like relaxed ordering could even suffice.

However, I'm not confident in making such a change. For now, avoid a
direct copy (assignment) of the atomics themselves (those operations
are meaningless), and use very conservative semantics when copying
ProcessEventsState.

Change-Id: I8584ff3fe9fef52385bd438235ee823bdbab8a42
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-09-15 21:47:44 +02:00
Santhosh Kumar
25c9f59546 Show command link button in respective color for windowsvista style
The command link button was shown in active color even when its disabled
while using windows vista style and the patch
e9cf618a9d further cause regression when
hovered over it.

This patch fixes it by setting color for corresponding color group in
windows vista style.

Pick-to: 6.6 6.5
Change-Id: I9a8f62f8c5895592571978ec7c9abccfc69e64a2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-15 21:47:44 +02:00
Giuseppe D'Angelo
cadae8b6e6 QWindowsFontDatabase: drop an usage of an atomic type
UniqueFontData has an atomic refcount internally. I guess this was
deemed necessary because font engines living in different threads may
call refUniqueFont / derefUniqueFont and the refcount has to be thread
safe. Those functions now are mutex protected (as they access the same
map), so we don't also need atomicity for the refcounter.

Change-Id: Ic223a12f4a61b7dcc567b3a5dcbe367eaa916004
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-09-15 19:44:33 +02:00
Bartlomiej Moskal
0f0ab90cf6 Android: Handle ImhNoTextHandles flag from InputMethodHints
[0]Qt::InputMethodHints has a flag ImhNoTextHandles that was not
handled. This flag should be considered when QAndroidInputContext is
updating Text handles position.
What is more, this flag can be used to fix the problem with visible
text cursor out of the text object.

[0]https://doc.qt.io/qt-6/qt.html#InputMethodHint-enum

Task-number: QTBUG-115005
Pick-to: 6.6 6.5
Change-Id: Ie50b77d7afbadfebe73f10137f09da9560aea1ba
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2023-09-15 13:36:15 +00:00
Volker Hilsheimer
fca11e0112 Doc: fix name of return argument in prototype
The documentation refers to it as \a ret, so call it ret rather than
just r.

Pick-to: 6.6 6.5
Fixes: QTBUG-116890
Change-Id: I12d8c3cfd33d5718d88794ca87bff996a27423ee
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-09-15 15:36:15 +02:00
Arno Rehn
ba2ebc24a1 QtFuture: Prevent whenAll()/whenAny() from creating reference cycles
whenAll() and whenAny() create a shared context object which is
referenced by the continuation lambda. The refcount of context is only
correctly managed when it is copied non-const to the lambda's
capture list.

Fixes: QTBUG-116731
Pick-to: 6.6 6.6.0
Change-Id: I8e79e1a0dc867f69bbacf1ed873f353a18f6ad38
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-15 13:36:15 +00:00
Joerg Bornemann
828770c60c CMake: Fix condition of the ipc_posix feature
The ipc_posix feature was OFF despite the following test values:
    TEST_posix_shm ON
    TEST_posix_sem ON
    TEST_sysv_shm OFF
    TEST_sysv_sem OFF

The 'NOT (TEST_sysv_shm AND TEST_sysv_sem)' part of the condition is not
correctly evaluated. Resolve the parentheses to work around this issue.

Pick-to: 6.6.0 6.6
Fixes: QTBUG-117052
Change-Id: Idac23d207f8dd644d059977ca41b6e32b17b3a49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-09-15 15:26:06 +02:00
Anton Kudryavtsev
b629bdc085 qmimedata: reduce allocations
use QBAV more

Change-Id: Id7fdf5dcb19cd4011317adf5c635a9d974d7d98a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-09-15 16:26:05 +03:00
Alexey Edelev
630d3328dd Iterate over all extraPrefixDirs when collecting "directories"
When collecting plugins required for the android application according
to linked targets we should take into account all prefix directories.
But not only the first one. Otherwise the order we use when adding
paths to extraPrefixDirs will affect collecting of the plugins. This
specifically leads to the issue if the user project builds custom Qt
plugins. The plugin directory from user project build tree will be
found first and all plugins from Qt installation directory are
discarded.

Pick-to: 6.6 6.5
Fixes: QTBUG-116920
Change-Id: Id94ebaf5ccd1a279a74b38b59ff535f45230e1b4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-09-15 12:48:57 +02:00
Eskil Abrahamsen Blomfeldt
9fe47cf2e1 Fix crash when reading corrupt font data
When loading the font data, we had some unprotected reads. To harden
this, we check everything against the length of the font data
before reading.

[ChangeLog][QtGui][Windows] Fixed a possible crash that could happen
when loading corrupted font data.

Fixes: QTBUG-116773
Pick-to: 5.15 6.2 6.5 6.6 6.6.0
Change-Id: I156df3b8833c9ed785fcc690821a7a74d9a51126
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-09-15 07:36:39 +02:00
Giuseppe D'Angelo
a1b55b1360 QWindowsFontDatabase: fix a data race
QRawFont::loadFromData can be called from any thread. It calls into
QPlatformFontDatabase::fontEngine. The code path may end up creating a
UniqueFontData and storing it a QWindowsFontDatabase member (a QMap).

Two threads calling loadFromData (on different QRawFont objects)
will therefore race on the mutation of the map.

Add the missing mutex protection.

Change-Id: Ib38c2b3539679c820d997a6548e4b397cbc2bb73
Pick-to: 6.2 6.5 6.6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-09-14 23:57:33 +02:00
Giuseppe D'Angelo
2bc475f94e QWindowsFontDatabase: avoid multiple map lookups
Use the iterator-based API, and avoid a quadruple (!) lookup into a
QMap.

I'm aggressively cherry-picking to avoid merge clashes with an upcoming
fix.

Pick-to: 6.2 6.5 6.6
Change-Id: I05968f4aec9e42f84f909a1103e43ba323a9544f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-14 23:57:33 +02:00
Giuseppe D'Angelo
284b1a5661 QUpdateLaterEvent: code tidies
Remove the empty destructor. Compiler-generated one is fine.

Change-Id: I1599b84a876ebd7ba22f63c545506feffc7b18bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-14 23:57:33 +02:00
Liang Qi
f7519a89d2 GUI: give more warning when can't load xcb since 6.5.0
normally because new depedency of xcb-cursor0 or libxcb-cursor0 is
missing.

Pick-to: 6.6 6.5
Task-number: QTBUG-108796
Change-Id: I040e9c0932bbf1f9026b365ded462c7373b219b5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-09-14 19:41:42 +02:00
Laszlo Agocs
737dd95950 rhi: Map DXGI_ADAPTER_FLAG_SOFTWARE onto the driverInfo's CpuDevice
Fixes: QTBUG-116756
Change-Id: I6218ea3f59716873853b8bf83b18e0a799eedcc3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-09-14 19:13:50 +02:00
Tor Arne Vestbø
5994e94fd1 macOS: Reset NSApp main menu temporarily when re-using top level menu
AppKit's built in logic for customizing menu entries, such as adding
text input (emoji, dictation) entries to the Edit menu, happens via
[NSApplication _customizeMainMenu], which is triggered either from
[NSApplication finishedLaunching], or [NSApplication setMainMenu:],
but in the latter case, only if the menu is different.

In our case, we might be re-using the same menu as before, but the
menu now has additional sub menus such as an Edit menu. In that case
we still want AppKit to do its magic, so we need to reset the main
menu temporarily to nil so that AppKit sees the menu as a "new" menu.

Pick-to: 6.6 6.5 6.6.0
Fixes: QTBUG-116903
Change-Id: Ibd9da72fb81b7cd1d707bd350a62d0c93356dbd4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-14 17:13:50 +00:00
Giuseppe D'Angelo
d184f4153c QDBusMarshall test: avoid an atomic assignment
There's no need for atomic semantics for a simple "scope value
rollback" (not sure why the code doesn't use the real thing).
There's also no semantics that make sense.
Extract the integer out of the atomic and store it back.

Change-Id: I8ba89216d1931a73ff22a8af7fd656c3f6948793
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-14 18:39:24 +02:00
Marc Mutz
16433a4a6e Long live Q_(U)INT128_C()!
Compilers that support 128-bit integer types usually don't have
support for 128-bit literals, so provide Q_(U)INT128_C macros and back
them with UDLs. This, of course, only works in C++, so until compilers
provide built-in literals that support C, too, that's all we get.

[ChangeLog][QtCore] Added Q_INT128_C() and Q_UINT128_C() macros to
create qint128 and quint128 literals in a platform-independent way.

Pick-to: 6.6 6.6.0
Fixes: QTBUG-116822
Change-Id: I4be645baf2e007ee1aa1a27f9b5166671806dc49
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-14 18:39:24 +02:00