If QTextDocument::loadResource() gets called from a different thread
than the thread that the QTD object (and *necessarily* its parent, if it
has one) live in, we would get the warning "Unable to invoke methods
with return values in queued connections". Rather, ensure that it's
invoked only via a direct connection.
Amends ac300a166f
Pick-to: 6.4
Task-number: QTBUG-35688
Change-Id: I35644f7cd54b1f40362d3d45c2a120883f7a2e61
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The lock and unlock of the Android deadlock mutex is now part
of the internal implementation instead of limited to the enum
based permission API. It is unclear why 8bca441b6f added
the guard only to this API and not to the string based API
as well.
The check for isBackgroundLocationApi29 has been removed,
as the logic seemingly resulted in accepting every single
permission type except location permissions if used via
the enum-based API.
Since Android's platform permission API doesn't have an
Undetermined status, we keep a hash of the status for each
permission type, and by default checkPermission() would
return Undetermined, until a requestPermission() call
is done which updates the internal hash, and after that
checkPermission() would return properly Granted/Denied.
Task-number: QTBUG-100413
Change-Id: Ia95c76af754481a281bc90198e349966c9c2da52
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Most of them were easy to change. The pair one was a bit of a stretch,
but still worked. I've removed the lines on QPair, since QPair is
std::pair in Qt 6.
Change-Id: I3d74c753055744deb8acfffd17246ec98c583d08
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
qIsNumericType does not return true for enum types, which meant we never
called numericCompare() or numericEquals() when one of the types was an
enum.
Task-number: QTBUG-108188
Change-Id: I3d74c753055744deb8acfffd172449c68af19367
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This reduces the chances of mistakes in forgetting a type. Plus, this
makes it easier to add char16_t and char32_t.
Drive-by change some type().id() code that doesn't need the ID for user
types to typeInterface()->typeId.
Change-Id: I3d74c753055744deb8acfffd17248aa81bf8ce55
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Avoids having to have a convertOptionalToPartialOrdering() function
to convert back.
std::optional<int> is 64 bits on any platform, though it's returned in
registers for the IA-64 C++ ABI. Unfortunately, that's not the case for
Windows.
Change-Id: I3d74c753055744deb8acfffd172480eee189b3b2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
As we're not doing any deep analysis, the code is almost exactly the
same anyway. It is possible to simplify further by avoiding the
signed/unsigned conversion rules, but it's not worth the
effort. Instead, we can share code.
Change-Id: I3d74c753055744deb8acfffd17248a5c51cbbfcb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The code implementing the C++ rules of type promotion and conversion
was too pedantic. There's no need to follow the letter of the standard,
not when we can now assume that everything is two's complement (this was
true for all architectures we supported when I wrote this code in 2014,
but wasn't required by the standard).
So we can reduce this to fewer comparisons and fewer rules, using the
size of the type, not just the type ID.
Change-Id: I3d74c753055744deb8acfffd172446b02444c0c0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Generate bc file using the "new way".
Task-number:QTBUG-106331
Pick-to: 6.4
Change-Id: I70d2c0e5026636deee1b8389f50f51e075187b76
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Avoids operating in UTF-16 and having to convert.
Drive-by fix int to qsizetype.
Change-Id: I3c79b7e08fa346988dfefffd17203b044914d68d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The man page says the prctl() should apply to any performance counters
measuring the current process, so it should work with a perf stat
started with --delay=-1... but I couldn't make that work.
Change-Id: I3c79b7e08fa346988dfefffd172032f06cc10fa0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This code predated C++11 and thus had a sentinel element.
Change-Id: I3c79b7e08fa346988dfefffd17202ef3f9735683
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Implemented for the Linux Perf measurer, with four measurements by
default.
RESULT : tst_MyClass::QString_toInt():
149.574444 CPU cycles per iteration (total: 149,574,445, iterations: 1000000)
RESULT : tst_MyClass::QString_toInt():
620.000181 instructions per iteration (total: 620,000,182, iterations: 1000000)
RESULT : tst_MyClass::QString_toInt():
131.000046 branch instructions per iteration (total: 131,000,047, iterations: 1000000)
RESULT : tst_MyClass::QString_toInt():
32.118771 nsecs per iteration (total: 32,118,771, iterations: 1000000)
Change-Id: I3c79b7e08fa346988dfefffd17202cda3df8431b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
And pass the value in a qreal, which is what QBenchlib stores
anyway. This increases the code size a little because the conversion
from integer to qreal is in multiple places, but doesn't meaningfully
increase the overhead: in the SysV ABI, we still return Measurement in
registers and even using the floating point registers where applicable.
This is the first step in allowing the Perf benchmarker to benchmark more
than one event.
Change-Id: I3c79b7e08fa346988dfefffd172027a8677f17c0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
I think it's useful for everyone to know what error it was, not just if
it's about to abort. And then simply abort() when we want to.
Change-Id: I3d74c753055744deb8acfffd1724c5b2b293ca9a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
User code shouldn't have to know about this.
Amends 0e1ce757d5.
Change-Id: I3d74c753055744deb8acfffd1724c5282f60ea59
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
qWaitForWindowActive was called in two test functions without
activating the relevant widget.
This patch adds widget activation before calling
qWaitForWindowActive.
Helper function verifyColor:
A loop made six comparison attempts of widget size, pixel color and
image with a 200ms waiting time after each unsuccessful attempt.
The widget size was tested at the beginning of the loop.
The test was failed on the first size mismatch, which occurred when
verifyColor was called before the widget was rendered.
That has lead to flakiness (e.g. on openSuSE).
This patch encapsules each check in a lambda and calls qWaitFor to
ensure event processing until each condition has become true.
Change-Id: Ic98f93c8acf41459bc728f2969fe8b01768048dd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Follow-up to 8222e06d12, which only reset
the item repaint count.
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: Id1fe840c14c0940d7020cf8f8cc6a3aeceaa5fb5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Added QtMqtt and QtPdf to the windeployqt module list
Task-number: QTBUG-105135
Pick-to: 6.4
Change-Id: Ic8a8a0c157663088341ed5a1a417dcb57a717286
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
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>