Currently, the Qt::CursorShape enum can accommodate only two new shapes
because Qt::LastCursor must be less than Qt::BitmapCursor.
The cursor shapes change rarely but it would be nice to keep them open
for extension in order to be able to react to new UI/UX ideas if needed.
Change-Id: I53ed9d742a09bb06bab73a906643c62a77a207b0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We already handle both cases of pre and post Android R APIs, so we can
safely suppress the code using older API after extracting it to its own
method.
Change-Id: I3f5d6dab480c5fb32d35f615db719a4a0eb3f45d
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
We changed the default in 6.8. It was documented in the changelog but
not in docs. Amends 09ea47f8113bdce437253b19a91f739aeef7a333
Pick-to: 6.8 6.9
Fixes: QTBUG-132173
Change-Id: I1b6bf69931ba12025cf95e80c12a5073a94af598
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
We don't need to use the heap, because this array won't get too big.
This commit raises the limit from 4096 logical processors on Linux to
1048576 (i.e., the square). 4096 is less than one system I've had access
to since I wrote this code in 2021 (64 sockets of hyperthreaded 60-core
Intel 4th Generation Xeon Scalable processors = 7680 logical
processors). The 4096 limit would also be reached by a "mere" 16 sockets
of 288-core Intel Xeon 6E processors.
I've also made it grow slightly faster by multiplying by 4 instead of 2.
Change-Id: I7c0d8b5e7809faba72c2fffdf99500868dfd7db4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
So the array itself is also const.
Amends a94731c2ad85f9dd40050a780f67c911bf12668e.
Pick-to: 6.9
Change-Id: Ic4d78d3d059dd47f776ffffdd0971b1aa35a69e9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
An application may need to load shortcuts from the settings at startup,
so QKeySequence::fromString() should be fast enough if there is a lot of
shortcuts.
This change adds a QKeySequence::fromString() benchmark so one could get
partial insight in its performance.
Change-Id: I9e15c0e9a199787189d5076a41154f127d2930a3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
QAbstractFileIconEngine stores the generated pixmap in a QPixmapCache
with the size as key. This is wrong as the size is multiplied by the
current devicePixelRatio so this has to be done also for the key.
Pick-to: 6.9 6.8
Change-Id: I6d8ceedc950d23abf9c4d79d92e86848b9508c9b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Amends 729c0960b84183bcf9576f974cb5e3b3c3fdc6ef.
Found in Qt 6.9 API review.
Pick-to: 6.9
Change-Id: Ieb81fe000e61fef54a003f52789fa1475aac5239
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The unconstrained implementation was removed, so qdoc was not able to
find a proper function. Provide a fake definition that matches what
qdoc expects. In this case the users shouldn't really care about the
constraints that the actual implementation has.
Amends 0c707c6ebece18677deaccccdfec5d48c587106f.
Found in Qt 6.9 API review.
Pick-to: 6.9
Change-Id: I6207b491fa94cc62d217af7dc7687923dc6971a4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
So that it allows overloading.
Also move the type T declaration into the function scope, as it
could never be used as a constraint anyway, and we do not want
users to pass custom type there.
Amends 0c707c6ebece18677deaccccdfec5d48c587106f.
Found in 6.9 API review.
Pick-to: 6.9
Change-Id: I086d65bdef7be2f9e0e67e96cc8a9ac76eaa5b0f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Those APIs are already guarded with an API check, so we can silent
javac warnings about them.
Change-Id: I98dc12520e25c513ed97d750446f188dcf084362
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Those values are only used to calculate the final value for the screen
size, which means we can simply do the calculation first and pass the
final values anyway and avoid carrying those params and making things
harder to read, and since those values are tied to the screen, we can
deffer calculating the physical size to the screen itself.
Dpi values are at least DisplayMetrics.DENSITY_LOW, if the xdpi/ydpi
returned metrics values are below that.
Task-number: QTBUG-132720
Change-Id: Idd6a4db24a460aeb66e626cd93d52b87566ce69c
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
The default screen size and physical size are not needed, since
QAndroidPlatformScreen constructor calculates that shortly after we
assign it a default value. As for the default available geometry,
we need to keep that, but we can move that to live directly under
QAndroidPlatformScreen class, with that we can reduce the chained
calls from androidjnimain.cpp to the platform integration to the
platform screen.
Task-number: QTBUG-132720
Change-Id: Icd2db91ab36a68cd53c3dfb702f41f6b519e476b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
As it makes more sense that they belong there.
Task-number: QTBUG-132716
Change-Id: I1bc44ee046c470e40767b1e8f098241eb9bbafee
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Instead of doing it every time under setDisplayMetrics().
Task-number: QTBUG-132716
Change-Id: I0887c086d7f653b0170e107a86cb0115582bbc89
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
We don't need to re-assign the surface each time it's changed,
instead the assignment needs to be done only when creating or
destroying the surface.
Task-number: QTBUG-132721
Change-Id: I72c8c81a692b9e739af0e0a7b0f934b69a9a0fa8
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
As requested in code review.
utf16() guarantees that the string will always be \0-terminated which
could mean allocating behind the scenes. On the other hand
nullTerminate{,d}() makes it obvious that the data may be deep-copied.
For QByteArray, this partially reverts
e0206fe9d47bfbf18a0d4c2e5e780504305f72e7. Adding the same method to
QByteArray was requested in code review for API symmetry.
[ChangeLog][QtCore][QString] Added nullTerminate() and nullTerminated()
methods (like chop() and chopped()), which are useful for strings
constructed with fromRawData() when calling methods that expect
\0-terminated strings.
[ChangeLog][QtCore][QByteArray] Added nullTerminate() and
nullTerminated() methods, which are useful for byte arrays constructed
with fromRawData() when calling methods that expect \0-terminated data.
Change-Id: Iec33b889a9ab62460b7a0df8f9b2189f3f794a54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Version 47264b57765919188b9f4144de8d95cf77e1b6dc, fetched on
2025-01-22.
[ChangeLog][Third-Party Code] Updated the public suffix list to upstream
SHA 47264b57765919188b9f4144de8d95cf77e1b6dc.
Pick-to: 6.9 6.8 6.5 6.2 5.15
Task-number: QTBUG-132851
Change-Id: Iba19f5006e8cb60505505c96a4e4649b075cae6e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Also add a comment to publicsuffix-list's entry that the update is
done by a script that should be updated whenever this file's contents
change.
Amends 36dca3c04f759449f74008a3e79021a179b0f35e.
Pick-to: 6.9 6.8 6.5
Change-Id: I1a0e51568e6d4300197c09f759ad3d82277a74d1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Set horizontal and vertical chroma subsampling factors to 1 when quality
exceeds 90 to preserve color details in high-quality JPEG images.
Fixes: QTBUG-109856
Change-Id: Id5f6a2bbd07cb07991fed44a79498c505db3f3ba
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Like window state and visibility, the window position should also
remain the same after the window is recreated.
Fixes: QTBUG-128790
Change-Id: Iad8599da7ef83eff6a93f7f071e6b452491a0d87
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If the objcopy call parameter is in quotations marks it fails the call
and prevents separate debug info builds for QNX.
Fixes: QTBUG-132801
Pick-to: 6.8 6.9
Change-Id: Ifadf57f80eb5c354aedeb8985bc7a0c9b79dc62e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This avoids the need to run qt-cmake-standalone-test and then import
the test, as described in QTCREATORBUG-25389.
Pick-to: 6.9 6.8
Change-Id: I010d6613debb2e34ef3809d2da78ca33ade4d602
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The previous attempt to escape invalid characters for username/password
did not work for e.g. '}' or '{'. The msdn documentation is somewhat
inconsitent here but after testing it looks like putting the
username/password inside '{' and '}' no matter if needed or not is the
easiest way. We have to escape '}' by doubling it though.
No need to escape the DSN - testing on windows revealed that ';' is not
allowed in there and '\'' and '"' at the start of the DSN is perfectly
fine without any escaping.
Pick-to: 6.9 6.8
Fixes: QTBUG-122642
Change-Id: I04d007d343dd65eb0dbc0252518843eb43cd9ab8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Amends commit df2e07549e6edd1d271cce1d86cadd4a33dfd8fc which removed
this file from the bootstrap build.
Drive-by remove pre-thread_local content, which isn't needed in 2025.
Change-Id: I406c748a5f0aedb5a846fffde5a2f5eb5f875f14
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
By moving one of the #if, we can remove the other.
Change-Id: I167cf466ef965758e5e8fffd94f8f8169599e3c6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Simple cases, all local const containers.
tst_QHash: rename the template parameter to "Str". My eyes saw
"QList<String>", but my brain somehow assumed QList<*Q*String>. You
could argue that I am a bit slow, but it has tricked someone else in
code review, so just rename it for the sake of clarity.
Drive-by, remove braces from one-line for-loop-block.
Task-number: QTBUG-115839
Change-Id: Ia1a56bea7b931efb377ba8c04ee8933561abf341
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
we have no access to system devices, so no need for discovery
or framebuffer.
Change-Id: Ie697f4b24b3a38efeff67fc670549a055da57745
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We do not support printing and sql, so best not to build and
shipping them.
Change-Id: Ibc929b127fd8416aa3d3b784a6ed0c2ce86db80d
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We have weaned ourselves off of qExchange(), which, however, has C++23
semantics (is constexpr and noexcept), while we only require C++17 atm.
At the same time, we have more and more uses of a constexpr exchange(),
iow: the C++20 extension.
We have the qNN namespaces for this, so let's use it: Add
q20::exchange(), with C++20 semantics (constexpr, not noexcept), and
use it to port the only remaining qExchange() user (since ported to
2×std::move() to make the header compatible with QT_NO_QEXCHANGE),
QScopedValueRollback.
No user requires the C++23 noexcept on the function (compilers will
figure it out, because the std::exchange is fully inline), and we
can't provide a q23::exchange() even if we needed to, because the
author of P2401 forgot to ask to update the value of
__cpp_lib_exchange_function...
Fixes: QTBUG-133038
Pick-to: 6.9 6.8
Change-Id: I003df445001d1c5ab02402119c5e5106aa156263
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This adds the typical end*() call to match the beginFilterChange() call
introduced by 00ce45efe16ff440651746a94c62e0d5c1f6e435. Pairing those
calls is necessary to make sure that the model can keep track of changes
between the old to the new filtering and emit the correct signals.
By deprecating the invalidateFilter() functions, we also make it clear
that existing code needs to be ported to the new API calls to avoid the
potentially incorrect or missing signal emissions.
Introduce a new FilterDirection enum with flag type FilterDirections
to indicate whether a row- or column-filter (or a filter impacting both
directions) changed. Replace the internal Directions enum with that,
it's no longer necessary.
Task-number: QTBUG-115717
Change-Id: I31c43ba846d665ef26c8a013d064421484f006cb
Reviewed-by: David Faure <david.faure@kdab.com>
The messages said "This test crashes on Android" bu tit appears the
problem is not a crash, but that the executable can't be executed. The
file appears to be present and yet execve() is producing ENOENT (No such
file or directory). That probably means it's the interpreter stored in
the ELF header's dynamic section that is not found.
Fixing that is SEP[1].
[1] https://en.wikipedia.org/wiki/Somebody_else%27s_problem
Pick-to: 6.9
Change-Id: I3025825c5e00f47a5a40fffd53c47131db3676dc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
If qtbase is configured with -debug-and-release -force-debug-info,
which maps to '-GNinja Multi-Config'
'-DCMAKE_CONFIGURATION_TYPES=RelWIthDebInfo;Debug'
and then qtopcua is configured with -GNinja -DCMAKE_BUILD_TYPE=Release
building the 'all' target would not build executables or tools.
That's because the targets have their EXCLUDE_FROM_ALL property set to
exclude any non-first multi-config, and Release doesn't match
RelWithDebInfo.
Such a scenario can happen for our multi-config windows builds, when
someone tries to build a repo not with qt-configure-module but rather
with cmake directly. They would then not specify the same build types
or generator, which can happen when opening in an IDE like Qt Creator.
Make sure to also check if the current generator is a multi-config
one, in addition to whether QT_FEATURE_debug_and_release is ON, before
adding the genex to the EXCLUDE_FROM_ALL property.
This allows building and installing executables and tools in such a
scenario, because in a single config build, the genex would not be
added, even if QT_FEATURE_debug_and_release is ON.
Pick-to: 6.8 6.9
Fixes: QTBUG-132609
Task-number: QTBUG-132338
Change-Id: Iaee1a0afb19df97ee1263dbaf27c8e29fc127831
Reviewed-by: Jannis Völker <jannis.voelker@basyskom.com>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The serialization code did stream out a function pointer as an integer,
and then tried to set it back -- effectively, it has *never* worked
since the beginning of public history, unless
serialization/deserialization were done within the same process.
While we cannot support streaming custom easing functions, we can
recover the non-custom functions from the type, which was also streamed
out; setType will take care of that, and we'll just ignore the
subsequent field in the stream.
If one tries to stream out a QEasingCurve with a custom curve, what do
we do? I've decided to just print a warning and stream _something_ out,
so I can keep some degree of behavioral compatibility and aggressively
cherrypick this patch.
AFAIK, there's no support for such a scenario in QDataStream: all
out-stream operators have a wide contract, and there's no Status flag
that meaningfully represents this case (and I doubt anyone checks QDS'
status while writing into it).
Change-Id: Ifa80cf3a9003cab074ddf112022c09b364497007
Fixes: QTBUG-132575
Pick-to: 6.9 6.8 6.5 6.2 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Created a list and added Android to the existing mention of iOS.
Fixes: QTBUG-132742
Pick-to: 6.9 6.8
Change-Id: I6e906980d28b54daf18c019eb9299a9d67daef3d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Nothing has changed in the headers we use, aside from the version
number, since v3.23.0, so we may as well declare ourselves up to
date.
[ChangeLog][Third-Party Code][QtTest] Valgrind headers are up to date
with Valgrind v3.24.0.
Pick-to: 6.9 6.8
Task-number: QTBUG-132871
Change-Id: Ib2ad8d73e662535a014d241b46cc50214b45f50b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Include each of an entry's truncations right after the entry if its
script (or, where absent, the one implied via likely subtag rules)
matches and there is no later entry that it should appear after. This
is a compromise between prefering strictly equivalent matches to
potentially incompatible ones and prefering candidates derived from
earlier entries in the original list. Defer to QLocaleSelector (see
QTBUG-112765) the addition of options to give the caller control over
how to make that compromise.
Pick-to: 6.9
Fixes: QTBUG-131894
Change-Id: I8750f4f40530c94638853388f47fcae1008db8d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We were including, for each entry we got from CLDR or the system,
minimal and maximal additions from CLDR's likely-subtag rules, plus
versions with script omitted and possibly also territory added, when
likely-equivalent to the original. Include also the converse, with
territory omitted and possibly also script added when
likely-equivalent, so as to control order when these entries also show
up by truncation of others.
Pick-to: 6.9
Task-number: QTBUG-131894
Change-Id: I363bfe31867be43807fe3b4942dafa186b8d2e94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Skip duplicates as a separate step, to save some complications. Other
than that, achieve the same results by post-processing the list,
instead of trying to integrate the finding of fallbacks into the main
iteration. This makes the code easier to think about and cope with
further complications as we come to them.
Pick-to: 6.9
Change-Id: If06eae5fd1e91e88b52b3d32ccaba8cbb8e3c8af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>