Commit Graph

75985 Commits

Author SHA1 Message Date
liulinsong ac2004e55b
Merge ecf7fbea15 into c7b3cb5f2a 2025-09-15 19:35:40 +00:00
Mårten Nordheim c7b3cb5f2a testlib: fileno is also deprecated in UCRT
The non-standard name was made to have a leading underscore.
Apply same #define trick to it as was done for isatty.

Amends 8fd8dd0492

Change-Id: I5d465e32b2fa0caf1d6fb68fa6fe2da8c36b7fc6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-09-15 21:00:00 +02:00
Antti Määttä 2eefeff364 tracegen: Handle enum class in lttng backend
Add casting to the enumerations so that enum class doesn't
cause compiler error.

Task-number: QTBUG-140048
Change-Id: Ib2ffee5b511913700e64ce114583f7aaa939d75d
Reviewed-by: Sami Varanka <sami.varanka@qt.io>
Reviewed-by: Janne Roine <janne.roine@qt.io>
2025-09-15 19:01:19 +03:00
Antti Määttä 69c7d2eff4 Tracepointgen: Handle enum class and enum struct
Adds handling for enum class and enum struct.

Task-number: QTBUG-140048
Change-Id: Ib330ff961a158b5bff05523b3ee38a56698bca2b
Reviewed-by: Janne Roine <janne.roine@qt.io>
Reviewed-by: Sami Varanka <sami.varanka@qt.io>
2025-09-15 19:01:19 +03:00
Tor Arne Vestbø 7a272c2900 Don't report/enable safe areas for graphics-view proxied widgets
We don't handle the safe area mapping for proxied widgets.

Task-number: QTBUG-140133
Pick-to: 6.10 6.9
Change-Id: I87b666f5364b7ad89be77e84054eb2d653933b61
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2025-09-15 16:01:19 +00:00
Ivan Solovev 65b7217ae7 Add QRandomAccessAsyncFile and QIOOperation
For now, as a private API.

The QRandomAccessAsyncFile class is supposed to handle async read
and write operations. Note that some operations (e.g. open() and
size()) are synchronous, because the tests showed that they
normally would not block even if the file is not actually downloaded
(e.g. stored on a MS OneDrive).

The implementation for async calls is inspired by QNetworkAccessManager
and QNetworkReply. The request for an async read or write returns a
pointer to a QIOOperation object. That object will emit a finished()
signal when the operation is complete, and an errorOccurred() signal,
if there was any error. The user has to connect to these signals to
handle the results. The typical usecase would be:

  QRandomAccessAsyncFile file;
  file.open(path, mode);
  auto op = file.read(offset, maxSize);
  connect(op, &QIOOperation::finished, &file, [op] {
    if (op->error() != QIOOperation::Error::None)
      // handle error
    // handle the data
    op->deleteLater();
  });

Similarly to QNetworkReply, the user has to call deleteLater() in the
callback that is connected to the signal.

The API provides two types of methods:
* owning methods that take ownership of the provided data-to-write or
  read into a buffer that is allocated internally. These are
  QRAAF::read() and QRAAF::write(). They exist for simplicity and user
  convenience.
* non-owning methods that rely on the user to keep the provided buffers
  alive as long as the operation in not completed. These are
  QRAAF::readInto() and QRAAF::writeFrom(). They have overloads taking
  span-of-spans, which should allow to implement vectored IO.

QIOOperation should become a public class at some point.
This means that its APIs should be easy to use, and also extensible.
It should not be limited to only Read and Write.

The hierarchy of IO operations is represented by QIOOperation and its
derived classes. The base class can be used when the user is not
interested in the data of the operation, or if the operation should
only report success of failure.
The derived classes implement data() methods with various return
types. The classes that represent Read and Write operations also
additionally provide offset() and numBytesProcessed() methods.

The patch also introduces QtPrivate::QIOOperationDataStorage that
holds a std::variant of all possible values that the operation can
contain. If needed, this variant can be extended to hold a QVariant
in order to store an arbitrary value.

This patch also provides the fallback QThreadpool-based implementation
that simply executes the requests on the dedicated threadpool using
QFuture. For simplicity, this implementation uses QFSFileEngine to
provide all operations.

The implementations for various backends should be added in follow-up
patches.

Task-number: QTBUG-136763
Change-Id: I8f34f9e78d91aa35756352de7fbe6544b58de23e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-09-15 13:22:47 +02:00
Marc Mutz cc16e9e403 QTextBoundaryFinder: squash the bitfield member
This is in the way of adding an inline member-swap() (can't take
references to bit-fields), and therefore move-assignment.

We can always redistribute the bits in freeBuffer later, if needed:
there are (and, since 6.0, were) no inline users of this member.

This should even improve codegen, as the compiler doesn't have to deal
with bit-fields anymore. There's no need to pessimize the code for
that kind of flexibility until another user actually surfaces.

Amends the start of the public history.

Task-number: QTBUG-138659
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I47eb96da87bf4e3f1052e9f455943d9dea3121d1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-09-14 18:42:19 +02:00
Tim Blechmann 901ccf7608 expected: do not include qconfig.h
qconfig.h does not have inclusion guards, so it should no be included
directly: it can break code as qcompilerdetection.h undef-ines its
symbols.

Pick-to: 6.10
Fixes: QTBUG-140149
Task-number: QTBUG-140150
Change-Id: Ic655a87ebeccd3cbc66286fd92279da8ca11cad3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-09-14 19:20:24 +08:00
Tim Blechmann 0e4ea3969c CMake: remove no_core_dep relic
Bundled zlib is linked transitively from QtCore when usid from any
consumer library. However there is an "AND NOT no_core_dep" condition,
though no_core_dep does not seem to be defined anywhere and seems to be
legacy.
Removing to make the code easier reason about.

Pick-to: 6.10
Change-Id: If413a9c9ff9a816e49a32d70f9d1bae16e11ed25
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-09-14 14:35:25 +08:00
Eskil Abrahamsen Blomfeldt 9cc32c2490 Update Freetype to 2.14.0
[ChangeLog][Third-Party Code] Updated bundled Freetype to
2.14.0.

Task-number: QTBUG-140079
Pick-to: 6.10 6.9 6.8 6.5 5.15
Change-Id: I6b72136a77d2870bc9618ca5dac84f875023d2f7
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 47975226ac)
2025-09-13 19:36:22 +02:00
Julian Greilich d6cc756268 a11y iOS: Do not set UIAccessibilityTraitAdjustable for ProgressBar
The ProgressBar does implement the ValueInterface to represent the
current progress, but the progress is readonly.

With the UIAccessibilityTraitAdjustable set, iOS would announce the
value of the ProgressBar as "adjustable" and give instruction to
swipe to change the value.

Task-number: QTBUG-139712
Pick-to: 6.10 6.9 6.8
Change-Id: Ife4ef14b2db58217c94c3cc4edb8cd69496245fa
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-09-13 07:29:53 +02:00
Volker Hilsheimer a4ae63f7c1 QRM: don't flag items as editable if we don't implement setData
Check for isMutable in the flags() implementation before checking type
specific attributes. We bail out of setData() and setItemData()
immediately if isMutable() returns false, so this produces a consistent
behavior.

Explicitly verify in the test that the ItemIsEditable flag is only set
when it should be.

Pick-to: 6.10 6.10.0
Change-Id: I0bb4ebcf5870b59fec12f84861d772be5d68735b
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
2025-09-13 07:29:46 +02:00
Assam Boudjelthia 14b3f3da3c Fix typo in qtestcase docs argument expectedVal
Pick-to: 6.10 6.10.0 6.9 6.8
Change-Id: I40015a403ae578de1b14f13935d5d58d6d7abc9a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2025-09-12 22:54:45 +00:00
Tor Arne Vestbø c4f8fa83db cmake: Don't create framework header directories unless we have headers
qt_copy_framework_headers was unconditionally creating all the private,
qpa, rhi, and ssg header subdirectories, even if we didn't have any
headers to put in them, which doesn't match how we structure the
normal include directories.

Pick-to: 6.10 6.9 6.8
Change-Id: I9efe2fd9c4f6d10f57e30ffcba2b912dae35a2c4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-09-12 15:13:38 +02:00
Ivan Solovev 13c4f7c5ff Fix corelib snippet compilation
The src_corelib_thread_qexception.cpp snippet was added twice:
* first time - unconditionally
* second time - properly guarded by QT_FEATURE_concurrent

Keep only the second addition of this file, which is properly guarded.

Amends c1889bd953.

Change-Id: I1efcbd266e8b6d355d8083b2f74346af667d3b8b
Reviewed-by: Oleksii Zbykovskyi <Oleksii.Zbykovskyi@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-09-12 14:40:35 +02:00
Dmitry Kazakov b5147dca11 Add QWaylandApplication::xkbContext()
It is necessary for the apps that want to manually parse the stream of events
from wl_keyborad.

Change-Id: I8229ae6e43640d0e7b9597f5f7b35cba59db0f64
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2025-09-12 13:59:48 +02:00
Assam Boudjelthia 1b4abf645a Android: check for camera cutout at runtime under safe margins test
Instead of hardcoding whether a device has camera cutout or not,
detect that at runtime, this can then allow running the test
on phones and tablets. Android 9 and 10 emualators are buggy
so as usual they are the exception to the rule.

Pick-to: 6.10 6.10.0 6.9
Change-Id: I3257dd86893c584bddd5525865f9c7a861428ff5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-09-12 14:19:10 +03:00
Assam Boudjelthia ca17c91c4a Android: don't keep system visibility cache on both C++ and Java
Since Android Java side is managing the system ui visibility calls,
keep any cached states there to avoid any inconsistency between the
two sides, so Qt always sends the call and Java decides whether
it goes through with it or not.

Pick-to: 6.10 6.10.0
Change-Id: I68dfb64fe38ecd7d71a6aae5bfa2e32b8f481b04
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-09-12 14:19:10 +03:00
Assam Boudjelthia 41491e96ac Android: call requestApplyInsets() after system ui visibility change
Always call decorView.requestApplyInsets() after a system ui
visibility change. This ensures the insets are updated and we
don't end up with wrong window sizes or half-way transitions
to different visibility states. With this change, the various
transitions are no longer flaky, many tests for safe margins
and fullscreen dimensions under tst_android are now reliably
executed over multiple iterations.

Pick-to: 6.10 6.10.0 6.9 6.8
Change-Id: I69260f76aa0a0e67f65918b6a8b10413cae13fd4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-09-12 14:19:10 +03:00
Assam Boudjelthia c603091382 Android: use rootView to retrieve the insets in of the current view
The insets are calculated for the top level windows so using the
current view to retrieve them is not accurate although it can
work.

Pick-to: 6.10 6.10.0 6.9
Change-Id: Ibc0526822760ebccbb30b7c8ad557e7005118f85
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-09-12 14:19:10 +03:00
Assam Boudjelthia 74a3746617 Android: clamp safe margins values to max of the reported insets
In some cases during resize events after an orientation change, it
can happen that the subtraction logic to figure out the remaining
value to leave the non-safe area, might compare a transcient/old
geometry, and end with big values in the reported safe margin. To
avoid that clamp the value to insets reported by the system.

Pick-to: 6.9 6.10 6.10.0
Change-Id: Ia7b39e1ef3969dca0cdc998368290646ab6d2b6d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-09-12 14:19:09 +03:00
Assam Boudjelthia 13a1cf98e6 Android: don't use OnPreDrawListener in setOnApplyWindowInsetsListener
Firstly, this was adding a new OnPreDrawListener listener with each
onApplyWindowInsets call and it wasn't cleaned afterwards. In this
case it's not even necessary to have those nested listeners.

Furthermore, don't set m_firstSafeMarginsDelivered from within the
onApplyWindowInsetsListener so that we're certain that some safe
margin values are retrieved from sources other than the
onApplyWindowInsetsListener just a guarantee.

If the window moves or resizes under the root while the root
doesn't change, signals like setOnApplyWindowInsetsListener
won't be sent thus we'll end up with out-dated safe margins,
so add addOnLayoutChangeListener to fix that.
Along the way move the expanded show after the normal show
because that's how I found this case handling was missing.

Pick-to: 6.9 6.10 6.10.0
Task-number: QTBUG-135808
Change-Id: I57c74cbd8ec7a0c190dc97ba9a92a0292a535240
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-09-12 14:19:09 +03:00
Even Oscar Andersen cc984a60fd wasm: Switch to the new jspi browser
Change-Id: I10d1950f6532a01b7803944aa4383df4f974d996
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
2025-09-12 11:32:51 +02:00
Ulf Hermann 12779df281 Wayland: Don't leak tokenProvider
Apparently the done() signal might never arrive, in which case the
tokenProvider would leak. Parent it to the surface to prevent this.

Change-Id: Icc03fc6b60deba9ae4d297fcec38318cb04768d7
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2025-09-12 11:32:51 +02:00
Marc Mutz 9e479614d9 Mark Boyer-Moore searchers as security-critical
QString and QByteArray are critical, too, and not because of their
ownership semantics, but because of the algorithms operating on
them. Boyer-Moore searching is one of those algorithms.

The QStringMatcher header is not decls-only, but it only contains
trivial implementation (like (QChar*, int) -> QStringView forwarders),
so is sensitive.

The QLatin1StringMatcher and QByteArrayMatchers contain half of the
algorithm in the header, though, to support calculating the BM tables
at compile-time, so they are security-critical.

Task-nunber: QTBUG-135195
Pick-to: 6.10.0 6.10 6.9 6.8
Change-Id: Ia0e32262a7b80462d681d1e688dc5153de136e7a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-09-12 07:17:25 +02:00
Eskil Abrahamsen Blomfeldt 3b294d2d4f Upgrade Harfbuzz to 11.4.5
[ChangeLog][Third-Party Code] Upgraded Harfbuzz to version
11.4.5.

Task-number: QTBUG-140080
Pick-to: 6.10 6.9 6.8 6.5 5.15
Change-Id: I0b406b85389618e32a8d8cd9a211a2eabc6af530
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 4c64493386)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-11 21:22:46 +00:00
Assam Boudjelthia a67f47e8ca AndroidTestRunner: don't print crashes by default
In most cases after a crash, logs will be too long and will
flood the test output, making it not ideal and mainly unexpected.
Instead of printing the crash logs and logcat by default, have
it done only when it's explicitly requested via --show-logcat.

For CI though, add the --show-logcat by default so we don't lose
that verbosity.

Pick-to: 6.10
Change-Id: I2306b97378b6218ed22ba98aa50deefa9c9cd968
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2025-09-11 23:39:03 +03:00
Laszlo Agocs 73a18c3eba rhi: Add an InstanceIndexIncludesBaseInstance feature query
Document it and add a corresponding feature as a temporary
remedy for the portability shortcomings of using gl_InstanceIndex
when the draw call specified a non-zero base instance.

Task-number: QTBUG-139565
Change-Id: I3b5f8f6c1c8a47db7fedd15545ea83b2784f53eb
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2025-09-11 22:39:03 +02:00
Marc Mutz 5f6bfa3692 Mark QStringTokenizer as security-critical
QString and QByteArray are critical, too, and not because of their
ownership semantics, but because of the algorithms operating on
them. QStringTokenizer is one of those algorithms.

The implementation is completely in the header, so mark the header
critical. The .cpp file contains only documentation blocks.

Task-nunber: QTBUG-135195
Pick-to: 6.10.0 6.10 6.9 6.8
Change-Id: I0780b342d0886efa773a5af24066de11b6f3b621
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-09-11 19:24:48 +00:00
Edward Welbourne a865a146be Move CharBuff back into QLocaleData
This reverts commit 69d3e96e02, and
adjusted users that have since been added.

Its name doesn't start with Q so it shouldn't be in the public
namespace, even if it is in a private header.

The reason for the move out of QLocaleData disappeared with the
recent commit 1cdb5178b9, which moved
ParsingResult into QLocaleData for the same reason.

Pick-to: 6.10 6.9 6.8
Change-Id: Icd3eac41ef7654024224dd1d55a5922f7f598a36
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2025-09-11 19:24:48 +00:00
Edward Welbourne caee07c5c8 Use QTest::failOnWarning() in a test whose comment said the equivalent
We can now actually make "should not produce warnings" a test
condition, so do so. Amends the start of public history.

Change-Id: I58b7ba71cab59d1dec445f1408849527d6a38865
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2025-09-11 21:24:48 +02:00
Marc Mutz 8a5b558400 Mark qtextboundaryfinder.h as trivial-impl-only
The implementation was already marked as security-critical in
8df072fc80.

Task-number: QTBUG-135195
Pick-to: 6.10.0 6.10 6.9 6.8
Change-Id: I62787b7fefcc1904730e9834c6a571eb1bfc380a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-09-11 19:24:48 +00:00
Marc Mutz 4f2712f730 Mark QChar as security-critical
QString and QByteArray are critical, too, and not because of their
ownership semantics, but because of the algorithms operating on
them. QChar contains at least decomposition() as one of those
algorithms.

The implementation in the header is just a bit too much to be called
trivial-impl-only, so mark the header critical as well.

Task-nunber: QTBUG-135195
Pick-to: 6.10.0 6.10 6.9 6.8
Change-Id: I58aac5e290fa9487340b8df500b915b3b150e38a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-09-11 19:24:48 +00:00
Joerg Bornemann a975781f5c CMake: Simplify the installation of .prl files
Since the commit that introduced .prl file generation,
bfcf36d459, we jumped through some hoops
to collect the build directories containing .prl files and then
installing these directories with the FILES_MATCHING argument. This
resulted in the installation of empty directories, because
install(DIRECTORY ... FILES_MATCHING ...) preserves the input directory
structure.

This complex installation procedure is unnecessary. We know how to
construct the final .prl file path with generator expressions.
install(FILES) supports generator expressions since CMake 3.0, which the
original author of bfcf36d459 missed.

Remove the qt_internal_install_prl_files function that called
install(DIRECTORY ... FILES_MATCHING ...) in a post-process step, and
call install(FILES ...) instead for every generated .prl file. This
solves the issue that we would install empty directories in lib/cmake.

Pick-to: 6.10
Task-number: QTBUG-138580
Change-Id: I4af3e808dc420d08a0e1a1fe3059a0a432949586
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2025-09-11 21:24:48 +02:00
Tor Arne Vestbø 08a17345db macOS: Show icons in menus on macOS 26 and above
As this is the new system behavior.

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ie33bc70a627133459e26411f4492ea0fe1f07ca4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2025-09-11 20:44:00 +02:00
Marc Mutz 75e51b0bd7 QLocale: de-inline c()
At face value, this is just replacing one out-of-line function call
(the QLocale(Language) ctor) with another (QLocale::c()). It follows
that this isn't worse than what was there before.

But as an out-of-line function, it has access to c_private() directly,
and we can afford to commit to noexcept(true) in this special case,
because we'll always be able to create this special object in a
noexcept way, so add that, too.

Together with the fact that the ctor we've been calling from inline
code doesn't just take one argument, but three (although the defaulted
ones are all of trivial type, and the default values are all
numerically zero), and this static function now takes zero, this
should nicely reduce the code generated for calls to this function.

Change-Id: If6ec4205773a57f1b3d3acf55d10ad4e030d92b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-09-11 17:36:30 +00:00
Ahmad Samir 4fbd808b4c tst_qmetamethod: don't use indexOfSlot() with non-slots
At the moment, QMetaOjbect::indexOfSlot() works for both Q_SLOTS: and
invokables, but technically for a Q_INVOKABLE method that isn't under
Q_SLOTS:, we should use indexOfMethod().

Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Iabf14f234a119b0f06ef078ed080e717670c6a47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2025-09-11 17:35:08 +00:00
Piotr Wiercinski 91b63ad3d6 wasm: Fix corelib snippets
Change-Id: Ifaf2c6dd3ff5c97f9c7eef71d397ee8d58cdb4c4
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Oleksii Zbykovskyi <Oleksii.Zbykovskyi@qt.io>
2025-09-11 19:35:08 +02:00
Tim Blechmann 4d11d9fe9c Gui: name mangle qt_ft_grays_raster
qt_ft_grays_raster can clash with symbols of the same name in the same
DSO. To be on the safe side, we should append the qt namespace to the
identifier

Task-number: QTBUG-138543
Pick-to: 6.10
Change-Id: I2523a1c509985e226f5e510140d184d14eb8470b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2025-09-12 01:35:08 +08:00
Eirik Aavitsland 5b93573bb4 Update bundled libjpeg-turbo to version 3.1.2
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 3.1.1

Pick-to: 6.10.0 6.10 6.9 6.8 6.5 5.15
Change-Id: I570d330f65ad720fb9d1e73e056d9dc8971be6cd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2025-09-11 19:35:08 +02:00
Marc Mutz 46feeeca7c QVariant: fix GCC -Warray-bounds in rvalue qvariant_cast
Change prompted by this warning from GCC:

  In function ‘T qvariant_cast(QVariant&&) [with T = QTransform]’,
      inlined from ‘T QVariant::value() && [with T = QTransform]’ at qvariant.h:530:30,
      inlined from ‘void QSvgAnimatedStyle::applyPropertyAnimation(QPainter*, QSvgAbstractAnimatedProperty*, bool, QSvgExtraStates&)’ at qsvgstyle.cpp:754:87:
  qvariant.h:794:67: error: array subscript ‘QTransform[0]’ is partly outside array bounds of ‘QVariant [1]’ [-Werror=array-bounds=]
    794 |             return std::move(*reinterpret_cast<T *>(v.d.data.data));
        |                                                                   ^
  qsvgstyle.cpp: In member function ‘void QSvgAnimatedStyle::applyPropertyAnimation(QPainter*, QSvgAbstractAnimatedProperty*, bool, QSvgExtraStates&)’:
  qsvgstyle.cpp:754:67: note: object ‘<anonymous>’ of size 32
    754 |         QTransform animatedTransform = property->interpolatedValue().value<QTransform>();
        |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~

If sizeof(T) > sizeof(Private::data), the sought object cannot
possibly be in the internal storage. But the old code still checked
is_shared and exposed the std::move(Private::data) case to the
compiler, prompting said warning.

To fix the warning, and to avoid emitting the redundant runtime check,
first check whether the sought object could possibly fit into the
internal buffer. Don't use CanUseInternalBuffer, which is what the
original implementation¹ did and we fixed afterwards². Just do a size
check. If the object is too large, no manner of QTypeInfo flags will
ever make it use the internal space. Since this is a compile-time
check, wrap it in a constexpr-if, thus hiding the move-from-internal-
space from the compiler for objects that are too large.

Add some checks, also for get/get_if. I couldn't reproduce the
warning, so I don't know whether these tests threw them, but the
setting is the same as in Eddy's report.

¹ dcf7604230
² eb87b0444a

Amends [²].

Reported-by: Edward Welbourne <edward.welbourne@qt.io>
Fixes: QTBUG-140064
Pick-to: 6.10 6.10.0 6.9 6.8
Change-Id: I66c12506f1746a94138c65dad980160138ab0a9e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2025-09-11 09:43:48 +00:00
Marc Mutz 88dd520407 [docs] Fix \relates on QTEST_THROW_ON_{FAIL,SKIP} \macro
The other macros, e.g. QCOMPARE(), use \relates QTest. I used \relates
<QTest>, which puts these two macros on a page of their own, which was
not intended.

Fix by using the correct \relates target. This will break links to
https://doc.qt.io/qt-6/qtest-qttestlib-proxy.html, but we can't use
two \relates for the same entitiy (that's QTBUG-116182), so we have to
live with that.

Amends e769cf026e.

Pick-to: 6.10 6.9 6.8
Change-Id: I4bb05b2f96e6e2195a5b281638b6a68cbe4c43af
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2025-09-11 11:43:47 +02:00
Assam Boudjelthia 50018b099f Android: blacklist tst_QGridLayout::spacingsAndMargins
This fails for Android 15 and blocks the safe margins fixes
in 6.10.0 release, I looked briefly at it but it seems it
might require some non-trivial changes to have it work, so
blacklist it for now.

Pick-to: 6.10.0 6.9 6.8
Task-number: QTBUG-140038
Change-Id: I1abe1dfdc6084549a44a9d7a209d59d7c21ae91b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit eaf36ed874)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-09-10 21:56:40 +00:00
Thiago Macieira 671ea076f2 q20::countr_zero: add support for the TZCNT instruction with MSVC
This intruction introduced by Intel with the Bit Manipulation
Instructions (BMI) with the Haswell generation and later adopted by AMD
when they also adopted AVX2. Like LZCNT, this instruction reports the
size of the input if it was zero.

The processor has 8- and 16-bit forms of this instruction, but MSVC has
no intrinsics for them, so we still need to check for zero input, in
which case we may as well emit the old BSF instruction, for which we get
the input-was-zero status from the instruction itself, saving on some
code emission.

Change-Id: I116169a2d8b6ae96936ffffd563084a3009f2dce
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-09-10 13:11:30 -07:00
Thiago Macieira 22ec8e4e3d q20::countl_zero: add support for the LZCNT instruction with MSVC
This intruction introduced by AMD with the Advanced Bit Manipulations
(ABM) instruction set and adopted by Intel with the Haswell generation
replaces the need to reverse the calculation and supports a zero input.

Change-Id: Icf849d18b39c8dafedc4fffd7694a760f92d54fb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-09-10 13:11:30 -07:00
Thiago Macieira 71e56913b7 Short live q20:rotl and q20::rotr
They are also easy.

Change-Id: I72120e4d97bb7fefc3a7fffd525132143e44e52b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-09-10 13:11:30 -07:00
Thiago Macieira 9a3bdeab74 q20bit.h: fix compilation in C++17 mode
Change-Id: Ieefde9327d4e518720b9fffd817ae30d20ac6180
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2025-09-10 13:11:29 -07:00
Assam Boudjelthia 40b7f97456 Android: add docs to QtActivity.appendApplicationParameters()
Pick-to: 6.10 6.9 6.8
Change-Id: Icefdaa0a51aa8fcfb792f6b6265493b4fd890123
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-09-10 21:42:29 +03:00
Assam Boudjelthia cea76e7c5f Android: warn instead of assert on invalid winId on windowFocusChanged
Pick-to: 6.9 6.10
Change-Id: I2cb0431dccc1fd87a4d363b4bcc9a18443abbaaf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-09-10 21:42:29 +03:00
Assam Boudjelthia fbe13a4bc1 Android: add color to test widgets to visualize window states better
Pick-to: 6.10
Change-Id: Id6f50004c764910cf3d9263a73e48ecfe0fb0842
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-09-10 21:42:29 +03:00