Commit Graph

63398 Commits

Author SHA1 Message Date
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
Piotr Wierciński
9468ef2cfb CI: Enable some tests under corelib/thread for Wasm platform
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>
2023-09-14 11:58:48 +02:00
Giuseppe D'Angelo
5ac97a38e8 QObject: do not copy a ConnectionList object
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>
2023-09-14 11:58:17 +02:00
Ievgenii Meshcheriakov
e49d8444dc QDBusArgumentPrivate: Disable copy and move, make constructor protected
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>
2023-09-14 11:50:46 +02:00
Ievgenii Meshcheriakov
37af09adf0 QtDBus: Resolve libdbus functions in a thread-safe way
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>
2023-09-14 11:50:28 +02:00
Ievgenii Meshcheriakov
bfdefa81f8 QDBusArgumentPrivate: Specify direction as argument to constructor
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>
2023-09-14 11:50:24 +02:00
Ievgenii Meshcheriakov
946992b9b0 QDBusArgumentPrivate: Use type-safe enum for flags
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>
2023-09-14 11:50:22 +02:00
Ievgenii Meshcheriakov
e4eabbf3e4 QDBusArgumentPrivate: Initialize member variables inline
For better readability and ease of modification.
Do the same for derived classes.

Change-Id: I9601f0b280feb5e3d0e71ed4a3405fdd9cca8dd2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-14 11:50:18 +02:00
Viktor Arvidsson
b2aeac9891 QTextFormat: Allow merging unset properties
There was no way to merge removal of properties which is required in
case you want to unset some property on the current selected text in a
text document. For example in case your text has font size set in pixels
and you want to change it to point size, that would be impossible before
this change. With this change you can set the font point size to what
you want and then set font pixel size to QVariant().

This is maybe not the most obvious way to do it but any other way I
could think of would require new api and quite some code duplication.

[ChangeLog][QtGui][Text] QTextFormat now allows setting properties to an
invalid QVariant to allow clearing properties via a merge. This changes
behavior slightly where code iterating over a QTextFormats properties
would never encounter invalid variants, which is now possible if
setProperty with an invalid variant was used instead of using the
clearProperty function to remove properties.

Change-Id: Ie8290088d457bf19d9c4785cfe91ae6a1de572c4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-09-14 00:44:49 +02:00
Albert Astals Cid
ae83f327cd ios: Fix crash when closing app while showing a native screen
Fixes: QTBUG-117021
Pick-to: 6.6 6.5
Change-Id: Icebae0e815b42c6e0bf39e727fd1a16db5752d78
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-09-13 22:09:54 +00:00
David Faure
549ed4fb24 QMimeType: simplify implementation of filterString
As suggested by Ahmad Samir

Change-Id: I7f3ef29436a7725b6dceab72bd0f8b01756bf930
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-13 23:27:44 +02:00
David Faure
071a9c9061 QMimeDatabase: introduce QMimeMagicResult to accumulate magic results
Better than two pointer parameters. However it can't be a return
value as we initially thought, it's an in/out parameter, in order to
compare the results in the current directory with those found in earlier
directories.

Change-Id: Ic6137f2627703f8d6930c3f7dd1a1102187eef30
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-13 23:27:44 +02:00
David Faure
1f0bc1ade3 QMimeDatabase: fix glob-deleteall support for the binary providers
This fixes the recently added QEXPECT_FAIL about glob-deleteall
in a local directory (with a binary cache). Before adding a glob match
we ask the more-local (higher-precedence) directories if they have
a glob-deleteall for that mimetype, and skip it then. This "asking"
is a virtual method, implemented for both XML and binary providers.

Change-Id: I6e4baf0120749f3331fd2d9254bea750a322b72d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-13 23:27:44 +02:00
Santhosh Kumar
42e164f5ad Update version for QPalette::accent API in documentation
Follow up patch to 3c391c159ce0e29a9a654edee45bd64bcde6ccd2.

Pick-to: 6.6
Change-Id: I23235ae8516a53cf09c00b0daedc054df2f0cfa8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-09-13 21:41:22 +02:00
Rym Bouabid
dcc0844056 Revamp Wait Conditions Example: Revisit the documentation
Change the title.

Remove the first \brief as there are two briefs in the document
so that the new title makes sense with the second brief in
"All Qt Examples" doc page.

Task-number: QTBUG-108860
Pick-to: 6.6 6.5
Change-Id: I1dec2ad107e3f9ff9b4203960ba54ae6d0d8c7b6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
2023-09-13 20:45:18 +02:00