QSignalSpyCallbackSet is a set of pointers, so when we store a pointer
to it for later dereferencing, we need to use a release fence for the
store and a corresponding acquire on load, lest the two don't
synchronize with each other and we end up with a data race.
Amends a65752c71b.
Change-Id: Ic2983d76237c5c5b00eb2a3575b10beb84d57190
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
... and use a variant of the QString::multiArg() trick to pass the
variable number of arguments into an out-of-line function.
The idea of this patch is to make the lowly asyncCall() and call()
functions the principal interface for DBus calls again.
Currently, it is more efficient to build up a QList<QVariant> and pass
that to the *WithArgumentList() methods. With more efficient, I mean
that the equivalent calls with QList expand to less client code,
probably because of the need to construct eight QVariant instances,
destroy them again, and then take the hit for a function call with so
many arguments, which can all but be efficient.
Consequently, when porting the NM bearer plugin to use call() instead
of callWithArgumentList(), text size increased by ~3KiB on my machine.
So, looking for a way to avoid the overhead of so many default
arguments, while at the same time allowing to pass even more arguments
than the predefined eight, I considered the QString::arg() method, but
discarded it because it does not scale to arbitrarily
(ie. SEP-limited) many arguments.
Variadic templates scale to SEP-limited many arguments, but they are
templates and deduce the exact type, so constraining the template to
only QVariants would have broken all users of the API which pass
non-QVariants and expect an implicit con- version to resolve the call.
So I decided to make a virtue of necessity, accept all argument types
and convert them to QVariant when constructing the
QString::multiArg()-inspired QVariant array.
To bring this patch to its consequential end would require to pass the
arguments as arrays instead of QLists, but to get a feeling of how
much impact this new API has, I backed the new implementation by
converting the array to a QList and calling the *WithArgumentList()
methods.
The result is, if I may say so, satisfying. Said bearer plugin drops
from +3KiB (baseline: callWithArgumentList()) to -5KiB (2.0% and 3.2%,
resp.); the (unmodified) connman bearer plugin, which already used
call(), dropped by almost 6KiB (2.5%).
While GCC can deal with the zero-sized array in a nullary call to the
variadic templates, MSVC cannot, so an extra overload provides an
alternative for zero arguments.
[ChangeLog][QtDBus][QDBusAbstractInterface] The call() and asyncCall()
methods now accept more than eight QVariant arguments.
Change-Id: Ic85faca40949f9bb8c08756be3bfe945c9cdd952
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
E.g. as seen on Integrity:
"global/qglobal.cpp", line 2967: warning #111-D: statement is unreachable
Change-Id: I6845192ee7fb14b66700b68118355c871b1a4baf
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Now that it's trying to guess whether the type is markdown based on
the file extension, there needs to be a way to override it. For example
it might be arranged that directory listings will be generated in
markdown format instead of HTML; then when loading a source URL that
is a directory, the application may override the type. The type for
the single-argument setSource(url) is UnknownResource to preserve
the existing behavior, but the user can override the guessing by
setting a specific type.
Change-Id: Id111efd24de7d8fd18c47b16a2d58f5b09d77891
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
The code didn't really use the queue as a queue, because it enqueued
one at a time, but dequeued potentially many. Even if it actually
decays to actual queue behavior: for the small number of elements
expected, a vector would still be preferable over the per-element
allocation performed by QQueue.
Because std::vector doesn't have pop_front(), I took the liberty of
making the dequeue code easier to read by using find_if with an
aptly-named lambda.
Change-Id: I09bd7ede50cb8ab5af5d1fc2ede37a3731f67070
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
It's a 38k source file, which makes it MUCH smaller than other generated
files like qlocale_data_p.h (982k) and qunicodetables.cpp (718k). The
constants are platform-independent, since they are defined by IEEE 754,
so they will never change.
The generator tool is moved to util/ and removed from the build. That's
one fewer bootstrapped tool to have to worry about.
The output file is committed as .cpp so it won't get installed.
Fixes: QTBUG-76165
Change-Id: I2b1955a995ad40f3b89afffd15a3ded58dc3e35f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
It doesn't really need Qt. So remove the dependency. I've confirmed that
the output is identical to what used to be generated.
This ought to be replaced by a script. Or just committed to Git, since
the generated output is not really supposed to change, ever.
Change-Id: I46363e5b8944459e8c48fffd158bb5d74fb6184c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
When using a texture for foreground color in text and copy-pasting
the text inside the same QTextEdit, the formatting would disappear.
Fixing this in a general way would require implementing some
other carrier format in the mime data than HTML, such as e.g ODF,
but it can quite easily be fixed for the case where the data
is pasted in the same document, or even different documents
as long as they have a reference to the image in the formats.
[ChangeLog][QtWidgets][QTextEdit] Added support for copy-pasting
foreground brushes with textures within same document.
Task-number: QTBUG-75931
Change-Id: I8b39dce289c64eea39e25cb8eb207e2534bcd2eb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
First, we cannot quote the whole command in double quotes, since the
command itself very often have double quotes inside it.
Secondly, we should use the same that the ssh(1) command does:
Instead of adb shell setprop foo 'a b' we should use
adb shell setprop foo "'a b'" as explained here:
[https://developer.android.com/studio/command-line/adb#shellcommands]
Last hunk in isRunning():
The pipe character got eaten by the shell if we used a single quote (so
the stuff after the pipe (grep) was actually run locally).
Switching to ssh-style quoting fixed that.
Change-Id: I3075cdf8595ac2549cec8019f2cba79f77815e0b
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Starting with Android 8.1.0 wrap.sh can be used to enable ASAN on Android.
Change-Id: I6ef6e5989475b9b7981d05e78a03f9680c1acb1b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Semi-automated, just needed ~20 manual fixes:
$ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} +
$ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} +
It can be easily improved (e.g. for store check that there are no commas
after the opening parens). The most common offender is QLibrary::load,
and some code using std::atomic directly.
Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Otherwise, it can happen that parsing goes on forever in cumulative
mode.
Task-number: QTCREATORBUG-17656
Change-Id: If69f2265ac7eee0d230bd77a9aa9500e97ebeff6
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: Ifea720470541000481fbacc510b4cb589c9990d9
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: Ibdd3f63d9069c3f01dfe8431bcc64bde4f2aa569
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: Ifa62ad002689a0be6ed1a88ad4ac0e92082ef616
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: I2e1b42c09db88da64ec62aee7906f4c368e5bcbb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: I23bc9693fb9f553fd63d10687d51322394717ed7
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: I949479066e114af0af85b6e62d90fd56b9c80077
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
There's no use of QRegExp here therefore remove the include
Task-number: QTBUG-72587
Change-Id: If281c34d202c9fae4e548c8293443cc0dc283de0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: I18fb17dd2f5f7c70b5c6564b876fc2138c430176
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: Iff9d4be685bf360ad921e29a82cb878ae5c46180
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: If5d5a9d1c3f094d554110ada3b259f4d863e7121
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: I60ffa6df83aaf520730cfbb1dd3f18a2d2e19977
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The check to disable the test was the one for QRegExp. This patch fixes
that.
Change-Id: I8783f582998cdd6ffe5dc5dafb3d53d56cd91213
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: Ibbd161700bf9e75736652b99dfa1ffd47e584249
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: Ie89641601763ff41eee5356a4b5ddee7ef810fbc
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This patch adds the missing tests for the QRegularExpression class to
the QDataStream tests. Only QRegExp was tested until now.
Task-number: QTBUG-72587
Change-Id: I68ad1500ecbb041bbc6fbdff04b99171530cc0fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
Task-number: QTBUG-72587
Change-Id: I0bb1d1409cb0c8f38b7582bb5ce6bbc2b047b6fc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Resources are usually needed to add extra stuff to apk lib/<arch> which normally
are stripped by gradle.
Change-Id: Id96ce246fdc2a4606e39ecfb75d5b3294aad3c08
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
When set to ExclusiveOptional, the new exclusionPolicy property let the
user uncheck the active checkable action in an exclusive group.
[ChangeLog][QtWidgets][QActionGroup] Added new exclusionPolicy
property. Set it to ExclusiveOptional to allow unchecking the active
checkable action in an exclusive group.
Change-Id: I61a9885cfd076d631cddf8c08313e4b488e5dc38
Fixes: QTBUG-71160
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
...until some day someone investigates what is exactly the problem with the
sdk that ships with mingw.
Task-number: QTBUG-76424
Change-Id: I64869a4fbb07a64cfc1430234d732e143fefe720
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Rewrite the existing accessor QWidgetPrivate::windowHandle() to
accept a mode enumeration that has an "Any" convenience.
Based on that, add QWidgetPrivate::associatedScreen(), which is seful
in many places where scaling is performed.
Prototypically simplify the code.
Task-number: QTBUG-62094
Task-number: QTBUG-73231
Change-Id: I516288363d329bce9bc94e4951106f9357bc6cde
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It's never set anywhere, neiher in QtBase nor in any other Qt module.
So, remove.
Change-Id: If616d350a1c1c74f6f3e87f8cd98ccb3bff5cf70
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This involves replacing the use of QStringRef with QStringView and
replacing int indexes and sizes with qsizetype ones.
Since we use QStringView now, where mid() is cheap and well-defined,
remove the offset and length parameters that used to be Part ctor
arguments, and use mid() in the caller.
Change-Id: I08f3cd467b7b935f734b73d15eb8564b7deaa87e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Replace explicit iterator loops with ranged for loops.
Also remove the pointless detach() of the QString result, caused by
calling mutable data() instead of using the old trick of const-casting
constData().
Change-Id: Ia7e2cb2926dc30b4dba33200b17697fd33d22446
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The IPv4 overload takes a IPv4Address, which is just an quint32, so it
doesn't matter whether clients call it with a const or a mutable
argument.
The IPv6 overload, OTOH, took a IPv6Address, which is a typedef for
quint8[16]. This allows users to pass a quint16[16], but not a const
quint8[16], because that would lose the const. The function, however,
doesn't modify the argument, so it could be const.
Make it so, even though, due to the typedef, it looks like a redundant
top-level const.
Change-Id: I0506f6f9026ad616c4450fceb45fea137ac27692
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The function qGetPtrHelper() is mainly used to implement d_func() within
the Q_DECLARE_PRIVATE() macro. The whole purpose of d_func() is to
propagate const deeply. But if a smart pointer implements this by itself,
then the old version of qGetPtrHelper(), by taking the Ptr as a const-&,
would always return a const payload pointer, which would fail in the
following reinterpret_cast in d_func() to mutable payloads.
This was found while experimenting with making QExplicitlySharedDataPointer
deep const-correct, and I have no explanation why it seems to have worked
with QSharedDataPointer, which is deep-const-correct already.
Change-Id: Iee2e8fcce89c58ba2af7818de6f79ed39c5a4030
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
androidtestrunner now checks is the apk is build and if it is, it will skip the build phase.
Now we can build the apks in parallel (which takes most of the time) and run them sequentially.
This way running tests on Android is much faster.
Change-Id: I82f34723ac08f7728cc0daab3366e03821335eed
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
It is perfectly possible to accidentally create a parent/child
loop. This can happens by direct means (a->setParent(b);
b->setParent(a);), or some more subtle means, e.g.
class MyClass : public QObject {
MyClass() : QObject(this) {}
};
Since this is UB, add a few robustness checks to make sure the
code above crashes right away (at least in debug builds).
Change-Id: I6583c8514b4c1f8a90677b04c77b8e8f0c15dba3
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Now creating an .apk it's easier than ever.
"$ make apk" is all you need to run to create an apk for your application.
[ChangeLog][Android] Introduce "make apk" target, an easy way to create an apk.
Change-Id: I12565e7ed32beb42da40d8ce42a52339038be950
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Ant is history for so many years, yet we forgot to remove it from
androiddeployqt.
[ChangeLog][Android] Remove ant support from androiddeployqt
Change-Id: I093295e18e8710c565e9d101e21c49b3c62f6322
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
androidtestrunner is a tool needed to run qt tests on Android.
Now you can run tests as simple as you run them on Linux, macOS,
Windows.
"$ make check" it's all you need to run tests on the default android
device.
ANDROID_DEVICE_SERIAL env variable can be used to use a specific android
serial.
Use cases:
$ make -j1 check
-j1 is needed to make sure we don't run multiple tests in parallel.
$ ANDROID_DEVICE_SERIAL="emulator-5554" make check
Run the test on "emulator-5554"
$ make TESTARGS="-- -xml" check
Switch to xml output. All params after -- are passed to test
application.
$ make TESTARGS="-- -o out.xml,xml -o out.txt,txt -o -,tap -vs" check
Create two files out.xml and out.txt in the current folder and print
"tap" format to stdout and enable logging of every signal emission.
[ChangeLog][Android] Make it easy to run Qt tests on Android.
"$ make check" is all it's needed to run a test on an Android device.
Change-Id: I1a7f64b62608f7367b5a6aabf5d6c6e7e50242e6
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
It's deprecated since e56401818b
but still needed for QWidget rendering - therefore move it to
QPainterPrivate.
Change-Id: I35880ffa22830c2921c6675b1acf7e4ca38601db
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
They were never referenced outside the classes' ctor and, worse,
remained uninitialized if the specification string contained devices.
Change-Id: I977a156acf10190428da00fe128fee70cff8f98d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
All four manager classes contained roughly the same code in their
ctors that parsed out devices from a colon-separated string.
Extract shared code, and port the parsing to QStringRef (later to be
ported to QStringView).
Saves ~2.4KiB on optimized Linux GCC 9.1 AMD64 builds across all
.so's that link to libQtInputSupport.a.
Change-Id: I3db826ee2b422cfc02f8d49bd21985a03b6c0935
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
To not write into a shared object without mutex protection. If the
stored icon name is empty, just calculate a new one on each call.
Task-number: QTBUG-45684
Change-Id: I01dfb6697b5275e69451da91fdc7346f40bc424e
Reviewed-by: David Faure <david.faure@kdab.com>