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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>