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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
[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>
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>
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>
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>
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>
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>
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>
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>
Remove the empty destructor. Compiler-generated one is fine.
Change-Id: I1599b84a876ebd7ba22f63c545506feffc7b18bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
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>
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>
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>
This is part of our testing effort where we try enabling more tests for
Web Assembly platform on CI. Not all tests work out of box, so some of
them will require followup work.
This commmit also introduces a new mechanism of automatically renaming
files when they are added many times with the same filename to single
translation unit.
Change-Id: I620536494ea83aeb9b294c4a35ef72b51e85a38b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The semantics of copying a ConnectionList are not defined; the type
is copiable by accident. Use a reference to the list instead (like done
in other places in the code).
Change-Id: Ifbc5d3baca992f3eb13e3781378e79ed1feb4e1c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Disable copy and move for the class because it is polymorphic.
Make the constructor protected because instances of this
class are not supposed to be created directly.
Mark drived classes final.
Change-Id: Ia6f2d640f3642ad4a6ecb3830fba152155e237b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use atomic pointers.
While at it, declare the function type with `using` instead
of a typedef for better readability, do the declaration
locally so that less preprocessor concatenation is needed,
use reinterpret_cast instead of C-style cast.
Change-Id: I5ed0d35b7ddfdd62ef6c12403fe7052019453f34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This avoids having direction member uninitialized by mistake. Make the
member variable const as it is never modified.
While at it, make Direction and enum class.
Change-Id: I53814ae9e1d6bcf786433674619145a1ee61e063
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Declare flags as QDBusConnection::ConnectionCapabilities
instead of bare int. Do the same for derived classes
QDBusMarshaller and QDBusDemarshaller. Make the constructors
explicit, replacing useless `inline` where it was used.
Make flags argument default to empty flags.
Change-Id: I6caedde06b2ef41d725f15348ee780d1cc20b355
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>