This patch replaces the first instance of QCOMPARE with QTRY_COMPARE /
QVERIFY with QTRY_VERIFY after a call to QWidget::grabGesture.
It re-groups verifications so that the verification of the highest
event count is on top.
The test function customGesture is skipped if
QGestureManager::deliverEvents cannot establish a target to deliver
the custom event.
Change-Id: I8188559a40ed5be86f3c6e9c82fa54a97ce5d7d6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Use it for logging TODO items.
Change-Id: If3218effcc7f044269defd5187ec080d4132d674
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Use private class functions and data. Move static paste
function out of the class, next to the other static event
handlers. Remove writeToClipboard()'s unused argument.
Change-Id: I9098290a3885dc540ea29a989fe3e83f8f4d5396
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
It may happen that other styles (especially QtQucik styles) apply
different palette for applications. In such case AndroidPlatformTheme
should not override it when Light/Dark mode is changed
Task-number: QTBUG-83185
Pick-to: 6.4 6.2
Change-Id: I6a3b7ee047fcd729be03271a7202cd260360f83b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Refactor an if/else chain over an enumerator into a switch.
This unveils that the last else is actually dead code, as there
is no Qt::UniteClip any more (removed 11 years ago in
01b72952c3).
Change-Id: Ib702e3f5bfdc39e580a4d872e54a5239d62204f7
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
When resolving QML module dependencies we scan the produced by the
build system import paths for the required QML modules. Previously the
check in androiddeployqt only was confirming that the required import
starts with the one of import paths. This worked well unless the
required import is nested in higher level import path. In the situation
when we have the following build structure:
build_dir/
imports/
MyModule/
...
and both 'build_dir' and 'build_dir/imports' directories are in QML
import paths, the MyModule QML module is resolved by the
'build_dir/imports'. But androiddeployqt assumed that it's found by
'build_dir' import path and copied the whole 'imports' directory as
the 'MyModule' QML module. The resulting bundle then had the
following content:
qml/
imports/
MyModule/
...
...
instead of the correct one:
qml/
MyModule/
...
...
This checks if import path contains the required url-based module
path before using it as the base directory to copy the module.
Amends 0a73fb10005053945571e6cdb0b03d916715c112
Pick-to: 6.2 6.4
Fixes: QTBUG-108194
Change-Id: I79e1a8a67f62e5ae4a899ba1a4f49ee4ad44ebf9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
GNOME doesn't set these for Wayland session and without those env
variables set users might experience broken cursor with Qt apps
as QWayland reads them to setup QWaylandInputDevice.
There is no cursor protocol available on Wayland yet, see also
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/58
Qt Wayland QPA plugin still tries to load from those two envs.
Fixes: QTBUG-67579
Fixes: QTBUG-87778
Pick-to: 6.4 6.2 5.15
Change-Id: I4e7f6871b56599170b12e796858238b1df6d47d1
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
A new SDK marked several functions in SecKeychain family as deprecated.
Fortunately for us, Security framework on the whole is not deprecated
and thus provides an alternative API to inspect keychain items, and also
much nicer one - instead of having a function with 15 parameters, those
parameters are 'collapsed' into one, the 'query', which is a dictionary.
Pick-to: 6.4 6.2
Fixes: QTBUG-108196
Change-Id: I602d1a846ff9683cac724859a776de2b901f5c1c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The comparator object is allowed to reject rvalues. Use a const
lvalue ref.
Change-Id: Id4ab5e094f3a0f4e6b2549ee5d3105d93faf1d14
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qtestoutputreporter.js and qtestoutputreporter.css were added to
the batchtestrunner, but not to the list of files copied from
sources, so make sure to add those and add a note for future reference.
Change-Id: If7f323b3051ee9b6fb4bedc3ee314e4941b41f0b
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Added QtCharts, QtDataVisualization, QtRemoteObjects, QtScxml, and QtNetworkAuthorization to the windeployqt module list
Task-number: QTBUG-105135
Pick-to: 6.2 6.4
Change-Id: I16f2897583518c4577eeeda2dc0a6f413fef9794
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The insets used to calculate the correct height were not the best
choice. It used display cutout insets which would work correctly on
most devices, but in the case of an emulator or a device without a
camera, it could fail to calculate correctly.
Task-number: QTBUG-107604
Task-number: QTBUG-107709
Task-number: QTBUG-107523
Pick-to: 6.4 6.4.1 6.2 5.15
Change-Id: I8c4da83ae7359a0c133dbeb02dbd2cd260565f78
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Replace flavor with uti, remove unused parameters, remove unused
hasOSFlavor function. Hide QMacMimeData as an implementation detail, it
is generally undefined behavior to cast an object to a type it is not an
instance of (even if related and without new data members).
Apply const, fix coding style.
Task-number: QTBUG-93632
Change-Id: I3bc05a72bc47c78958f26211211e734387fbb024
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Make name of virtual functions explicit, following the QWindowsMime
API.
Task-number: QTBUG-93632
Change-Id: I7ada2b1aa86bc6e28b47383a32ab9cbaf9ad93e5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The value indicates for which systems the handler is relevant, e.g.
clipboard and/or drag'n'drop. Rename the enum from "MimeType", which is
something else already, to "HandlerScope".
Make the enum a scoped enum to avoid implicit conversion to uchar, and
to allow for better value names. Use the type in APIs and only convert
to uchar when needed.
Make respective arguments default to both DnD and clipboard implicitly,
instead of explicitly interpreting an invalid zero-value as a default
value.
Task-number: QTBUG-93632
Change-Id: I85ab982f6c9fe78ea4d030dd0b0791c8ab866f67
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
We want to make it public, and there is no need for "pasteboard" since
it also coveres drag'n'drop. Add a default constructor that defaults to
supporting both clipboard and drag'n'drop, and clean up the code by
using that constructor where applicable.
Historical note: the converter interface was called QMacMime up to
Qt 4.2, when due to macOS changes it had to be replaced by
QMacPasteboardMime.
Task-number: QTBUG-93632
Change-Id: Id9712300039375aa6394598b104827e6f5d6c948
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Register the QWindowsMime implementation instance in the QWindowsMime
constructor, and remove it again in the destructor.
Provide a convenience static method to register a mime type.
This makes it a lot easier to use the type, without having to use native
interfaces.
Since this requires adding a qwindowsmime.cpp file, move the (so far
internal) documentation there.
Task-number: QTBUG-93632
Change-Id: I3b5e45be6255bd11a576127304c4aec9d7364e69
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Data received by Qt from a native clipboard- or drag'n'drop-source is
mapped to a application/x-qt-windows-mime;value=... mime type, where the
"value" corresponds to the native clipboard format name, e.g.
"FileGroupDescriptor". When we register such a mime type in Qt, then we
need to get the same clipboard format number back. I.e. registering
'application/x-qt-windows-mime;value="FileGroupDescriptor"' needs to
produce the same Windows clipboard format identifier as the call to
RegisterClipboardFormat("FileGroupDescriptor").
Otherwise, a mime converter implementation has to operate on different
clipboard format values in the implementations of the different virtual
functions that are operating on FORMATETC data structures.
Task-number: QTBUG-93632
Change-Id: I0b7e3a2fc0e3f72bffc4490fc0ff4b190e0929a3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Setting the flag QSurfaceFormat::StereoBuffers does not actually do
anything, because we do not utilize the extra buffers provided. We need
to expose setting the correct buffers using glDrawBuffers between draw
calls.
Change-Id: I6a5110405e621030ac3a2886fa83df0cfe928723
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
MSVC 2022. Must have been some indirect include I'm modifying.
qcryptographichash.cpp(266): error C2079: 'QCryptographicHashPrivate::SmallByteArray::m_data' uses undefined class 'std::array<char,64>'
Change-Id: I3d74c753055744deb8acfffd172492257099f14d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Flushing the queued paint events will bump numRepaints, and the whole
point of calling reset() is to prepare a consistent state before the
next test, so we need to call it after flushing the events.
Pick-to: 6.2 6.4
Change-Id: Iaefc9854caafe82c65c9587e18fd081439e8dda6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This patchset adds the rules to utilize build artifacts from multiple
android abi builds and to use them for building and running tests.
If target.arch has the value 'Multi', coin will now skip building Qt
itself, since this means that all Qt versions were build previously.
It only builds test using the pre-built Qt for Android archives and
then runs the regular Android tests using multi-ABI apks. The rules
are implemented for qtbase only.
Change-Id: I265c70c45caa2155c75cd15c7e3a4f6a863252b8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The qfiledialog test was failing on completer_data test. The fix
available for Android 11 also works in Android 7, so removed the if
clause.
Task-number: QTBUG-105377
Change-Id: I76a4c1073a754c9b299cfe731f42b80da1a6f8e2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
It may take some time before the shown window is available through the
accessible hierarchy, so do an asynchronous test for that to happen.
Pick-to: 6.4
Change-Id: I3f312ae636505b805899973678b1bf10a65f96b3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
There's no need to split it, we can use the -x compiler flag to build
the .cpp file as Objective-C++, or, as done here, just rename the file.
This allows us to use QVERIFY and friends, giving more precise failure reporting.
Pick-to: 6.4
Change-Id: I6fb1c4454335082c8a39010c5b75c59e6ec6561b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Don't attempt to link to std::as_const with \sa.
* Don't say 'please'.
* Describe what is, never what may come to be at some
undefined point in the future.
* Format text properly.
Change-Id: I496d98c143d693b3f09753f91f2fa5327bbb9402
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
When a compound widget is created not directly before its children,
then another widget will be in the focus chain between the compound and
the compound's first child. If one of those children is then made the
focus proxy of the compound, then the widget in between becomes
unreachable by tabbing.
To fix this, detect that we set the focus proxy to be a descendent of
the compound widget, and then move the compound widget directly in front
of its first child in the focus chain. This way we can't have any gaps
in the focus chain.
Augment the test case with a corresponding scenario. As a drive-by, move
the debug helper up in the code so that it can be easier used, and set
object names on relevant widgets.
Pick-to: 6.4 6.2 5.15
Fixes: QTBUG-89156
Change-Id: I17057719a90f59629087afbd1d2ca58c1aa1d8f6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Some Windows SDKs seem to throw an exception (sometimes?) when
calling ConnectionProfile::NetworkAdapter.
Catch the exception and ignore it, we would return Unknown anyway.
And just in case it is needed, do the same for GetConnectionCost.
This requires enabling exceptions for the plugin.
Fixes: QTBUG-108156
Pick-to: 6.4 6.4.1
Change-Id: Ie6c5adb3715578aa94ef3391afae79d9aecdc5d3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Basic unitttest and one to verify erase returns iterator, not
const_iterator.
Change-Id: I44c3b82b4686ff3809648063376f5e36fb7e181d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
ELFOSABI_LINUX is the old name for ELFOSABI_GNU
and some systems (NetBSD 9) with an old elf.h
still use that define instead of ELFOSABI_GNU.
Pick-to: 6.4 6.4.1
Change-Id: I3d18efe117ea21f13831df5293b4efce99694294
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- If the string isn't shared, don't call detach(), instead remove characters
matching ch, and resize()
- If the string is shared, create a new string, and copy all characters
except the ones that would be removed, see task for details
Update unittets so that calls to this overload of remove() test both code
paths (replace() calls remove(QChar, cs) internally).
Drive-by change: use QCOMPARE() instead of QTEST()
Task-number: QTBUG-106181
Change-Id: I1fa08cf29baac2560fca62861fc4a81967b54e92
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- If this bytearray isn't shared call d->erase() as needed
- if it's shared, instead of detaching, create a new bytearray, and copy
all characters except for the ones that would be removed
See task for details.
Adjust unittest to test both code paths.
Task-number: QTBUG-106182
Change-Id: I806e4d1707004345a2472e056905fbf675f765ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Only calling xcb_flush() is not enough when users use xlib calls
to paint with the Display, for example in QWidget::paintEvent(),
and not call XFlush().
This fixes a regression since Qt 4.x.
In Qt 4, we use XNextEvent() in x11 event dispatcher which
implicitly called XFlush(). In Qt 5 and 6, we use xcb calls.
See also https://www.x.org/releases/X11R7.5/doc/man/man3/XFlush.3.html
Most client applications need not use this function because the
output buffer is automatically flushed as needed by calls to
XPending, XNextEvent, and XWindowEvent.
Pick-to: 6.4 6.2 5.15
Fixes: QTBUG-46681
Fixes: QTBUG-100085
Change-Id: I08dc0800ad0e23f0c2293d0d4e4bd29d92155752
Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Also avoid to include xlib headers directly.
Pick-to: 6.4 6.2 5.15
Change-Id: Id60a9b39a9d8284d5d0ab3df1ed61f844f1e68e4
Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This reverts commit 79a11470f3, which
resulted in QTBUG-105735. The new behavior is worse and affects multiple
screen readers, while the old issue is isolated to Windows Narrator and
could be considered a narrator bug.
Task-number: QTBUG-105735
Pick-to: 6.2 6.4
Change-Id: Ic8be1dbd592a3fdf2c3219ec4c5524bc2c7f0f6a
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Pass parameters as const-reference, and declare member functions as
const. They have no reason to modifty the converter itself, and
converters are expected to return the same result for identical input.
Task-number: QTBUG-93632
Change-Id: I19ef799c1aca956f2cd1aaea1d4f7ecb565fc017
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
It's not called anywhere, we always get all convertors and iterate over
them to find the best match for the relevant context. Change those
loops to use ranged for.
Task-number: QTBUG-93632
Change-Id: Icb450ca56310a0acab881899234ac647792ce0c9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The function was primarily called to generate debug output. The only
other usage was to identify the Rtf converter so that we can avoid that
we convert outgoing HTML to RTF. This is just as easily (and more
accurately) done by skipping any converter that converts HTML to RTF.
Task-number: QTBUG-93632
Change-Id: Ibe5bdece982399e2d9823f6df67393d1f81501fe
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The logic for registration of converter implementations is only used
internally through static functions. Move those, and related global
functions, to a QMacMimeRegistry namespace.
Reduce the QMacInternalPasteboardMime to the abstract interface for
converting between native and Qt clipboard data.
Historically, mime converters can have different "types"; make that API
type-safe.
Task-number: QTBUG-93632
Change-Id: I0e16fefa350398b693486199fe10357fd84abcd6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The class registers converters and provides access to the converter
able to handle specific formats. But it is not a converter itself.
The converter would then be the implementation of the virtual
interface, e.g. QWindowsMime subclasses.
Task-number: QTBUG-93632
Change-Id: I150ef28e9bcead4291d72e0b0aa660be3fcd4a8a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QDialogs can be backed by native dialog helpers, and the choice of
whether to use a particular helper is a runtime decision, made
in QDialog::setVisible() via QDialogPrivate::canBeNativeDialog().
As the native dialogs may not always provide every feature of the
corresponding Qt dialog, or if the user wants a uniform look and
feel for their application (even if that breaks the platform UX),
there is a way to opt out, via the Qt::AA_DontUseNativeDialogs
attribute.
This attribute was checked by subclasses of QDialog/QDialogPrivate,
for example QFileDialog or QColorDialog, but not by the base class
implementation, which is being used by e.g. QMessageBox.
Ideally we'd reduce the amount of code duplication in this area,
by having subclasses such as QFileDialog and QColorDialog call the
base class implementations, but for now we add a similar check for
the attribute to the base class as we have in other leaf classes.
[ChangeLog][Widgets] QMessageBox now respects the Qt::AA_DontUseNativeDialogs
application attribute to opt out of native message boxes on
platforms where this is supported (iOS, Android).
Change-Id: I0080441ea8764e9d5fc62d7f2d7b8914a5844c28
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>