The top level widget in the test might be too big in some Android
devices and ends up overlapping the system areas, it would then
receive a non-null safe margins and then a resize event, so the
test needs to account for that case.
Pick-to: 6.10 6.9
Fixes: QTBUG-140192
Change-Id: Iff7194e48cc000cc0a37b66f8ac219f54a87d6db
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
On VxWorks with hostFs (commonly used for debugging via Workbench),
using QFile::exists() triggers a statfs() call, which fails. This change
uses stat() check instead, which behaves more reliably in this context.
Additionally, VxWorks stat() still incorrectly reports that the file has
been deleted. This fix accounts for that false negative and avoids
treating the file as missing.
Task-number: QTBUG-139007
Pick-to: 6.8 6.9 6.10
Change-Id: Ie2cd277868e0d57bb8288271c8973da17162eef3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Amends 2bce75a6b5 which had itself amended
commit 5b5297fe87.
This commit adds a much lengthier explanation of the design of this test
-- which I had to write to understand and fix the problems anyway.
The fix itself consists of uses two QElapsedTimers in each thread, not
just one: one for the threads that time out and started before the
auxiliary threads, and one for threads that succeed and is started after
they have reached the synchronization point. Because the main thread
must now wait for the WaiterThreads to reach the synchronization point,
we needed to replace the startSema QSemaphore with a barrier instead.
Pick-to: 6.10 6.9
Fixes: QTBUG-139617
Change-Id: I5d86dd42f5cd9b87a55dfffd30fd47637ea3066a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Amends and complements 28619f1ddd4a4b21d8489476d18927564ee0839d, which
had identified this could be a problem, but since there was no test, we
couldn't confirm it. Now that there is, we can see that it fails with
VxWorks, where I guess the two stacks are wholly separate.
Note fetchConnectionParameters() only sets AnyIPProtocol if the socket
is bound to :: or ::ffff:0.0.0.0. Binding to other addresses is
technically possible, but broadcasting would only work if bound to
another v4-mapped address. Changing fetchConnectionParameters() to, for
example, use toIPv4Address() and check for success is left as an
exercise for the reader.
Task-number: QTBUG-139586
Task-number: QTBUG-130070
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I44daa5ec27877abc2e09fffd875d4be6dfc86446
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Most of these functions have inline versions of the QChar overload, so
we call them if the size of the input QStringView is known to be 1 at
compile time. For those that don't have an inline version (count(),
lastIndexOf()), this change simplifies the call sequence by passing a
single QChar or char16_t instead of a full View object.
Change-Id: I75cca6a0c3c4664cea77fffdebe0b798e7443537
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Avoids an unnecessary QStringView and possibly pessimizing the
code generation.
Pick-to: 6.10 6.9 6.8
Change-Id: Iac1ff680887641888e00fffd17e098972382bf10
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Amends b347d48704.
Drive-by change the unit test to use QCOMPARE and add lastIndexOf()
tests for good measure.
Pick-to: 6.10
Change-Id: I474e2d6060bf10179545fffd9ce2caa517114b48
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
To avoid warnings like:
Unable to grant 'android.permission.INTERNET' to
'org.qtproject.example.tst_android'. Probably the Android version
mismatch.
First, get the full list of dangerous permissions and check
for each permission if it's dangerous or not before granting it.
Change-Id: I84b214773c4cceb17f96284f9fb9a0d2d519933a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
MainWindow has ModelFactory as a member, and that again has large arrays
as members. The stack on Windows cannot handle that, and the test fails
to start.
Allocate the UI on the heap.
Pick-to: 6.10 6.10.0
Change-Id: I8659fd7bc267f133e66e5620a430ba32b7abae2a
Reviewed-by: Maycon Stamboroski <maycon.stamboroski@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Assign the default level to all files in the directory.
Fixes: QTBUG-135726
Pick-to: 6.10 6.9 6.8
Change-Id: I3a585710e61f29d99a460f6335e541203b721ce2
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Also add support for jspi.
Fixes: QTBUG-139785
Fixes: QTBUG-129735
Change-Id: Ifd251fd0cd738d2c089084f4fd6d65dd0a7e91e5
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Only copy the object, and first level functions. Field values are
aliased. Functions are duplicated by creating new forwarding
functions.
However, the duplicated functions refers to the original object,
this do not seem to be a problem.
Change-Id: Ifaebb5f42845448b02b0dea797a80964b623d979
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
nw_path_monitor's update handler calls our 'updateState' on a dispatch
queue, potentially from a different thread. 'this' pointer captured
by the handler's lambda can be already invalid (if the backend was deleted).
We call nw_path_monitor_cancel in 'stopMonitoring', but it's not enough
to prevent update handler from accessing the (now-invalid) pointer.
To resolve this issue we move the lock and 'this' pointer to the separate
object, which is essentially owned by the callback and will be deleted
by the monitor's cancellation handler, set via
nw_path_monitor_set_cancel_handler.
Pick-to: 6.10
Change-Id: I79f48ef021d19dcba0923ef06690433d167c4ea6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The definition of Accessible.onPressAction is enough to let
Android announce an element as clickable. But this is a
problem when components are designied in a way like this:
Accessible.role: clickable ? Accessible.Button : Accessible.StaticText
Accessible.onPressAction: clickable ? doit() : nothing()
So we avoid to set clickable for StaticText and Heading.
Windows, macOS and iOS already have the right behavior and do
not care about pressAction or toggleAction on simple text.
Pick-to: 6.10 6.9 6.8
Change-Id: I7bf9ffae112b92dd4a90f51f014a348dfe1b63f3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This enables components to provide more detailed information about the
value to the a11y-interface.
For the ProgressBar this controls the pitch of the sound which TalkBack
uses to represent the current value of the ProgressBar.
Task-number: QTBUG-139712
Pick-to: 6.8 6.9 6.10
Change-Id: I0b2694e8e47b264d75e3fcecbbe900c310aa4e19
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
We make linkToParent fault tolerant. Among other things make sure
that a selected item is still selected after this function returns.
Change-Id: Id8ff2a2a24b32f493665730cdfd3ef69731819f0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
We trust the OS, so none of this code is security critical.
Fixes: QTBUG-134564
Change-Id: I9d190a12c3ac8b3b75896ba97ffbc6293e27ef67
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
We trust the OS, so none of this code is security critical.
Fixes: QTBUG-134566
Change-Id: I35e1f3a5e67ad78ba469d32614dd236bf4356bfd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
As the latter requires us to awkwardly create a fake dummy header in
the frameworks we ship.
The symlink points to the `Current` version symlink, just like for the
library itself and Resources -- both of which CMake generates still.
Change-Id: I2db3f218a3c01cb1be73a0d7a514241b6c472ba3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Amends 772b62c91e.
The amended commit removed the definition from both the generator and
the generated code, but only removed the declaration from the
generated code, not the generator.
Pick-to: 6.10.0 6.10
Change-Id: I2f41aad9777a8c27f80edb9b7ef7a97e1871ffbb
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Change title from "Thread Support in Qt" to "Multi-threading in Qt"
to use more modern and precise terminology. Add target directive to
preserve possible existing links and update all cross-references
across the codebase.
Task-number: QTBUG-140178
Pick-to: 6.10 6.10.0 6.9 6.8
Change-Id: If3457a811d71fa17e29cf5d5886fda11951c2862
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Handle windows absolute paths when recursively searching include files.
Fixes: QTBUG-140058
Pick-to: 6.10
Change-Id: Ie21a083f50602357efaa2c8d0ac87348a27fd129
Reviewed-by: Janne Roine <janne.roine@qt.io>
Reviewed-by: Sami Varanka <sami.varanka@qt.io>
QFileSystemModel parses and processes file paths, which includes complex
logic for e.g. following symlinks. Mistakes here could easily introduce
vulnerabilities. In addition, corrupted file paths might result in
undefined behavior in the parsing code. Mark the implementation of that
class (including the private header) as security critical. The public
header only contains the declaration of a more or less typical
QAbstractItemModel subclass, and can stick to the default.
The remaining code in this folder can also stay with the default
classification of 'significant'.
QUIP: 23
Fixes: QTBUG-135218
Pick-to: 6.10 6.9 6.8
Change-Id: Iaefb5ddb02a061d67236759efc23c7ced533f361
Reviewed-by: Mate Barany <mate.barany@qt.io>
RadioButton and CheckBox should not provide a value because this
leads to the behavior that iOS read out both states (checked and
unchecked). Also we need to provide own strings in multiple
languages because resolving 0 and 1 is not supported by iOS in
this case. This behavior is not intended by iOS. Instead we need
to provide the state with a UIAccessibilityTrait. This creates
the same representation as for the items in the iOS settings and
uses the iOS specific wording.
Task-number: QTBUG-139676
Pick-to: 6.8 6.9 6.10
Change-Id: I1369291cc9e8fbbe9ae65f2ca6c742d942d2acd6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
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>