Commit Graph

40115 Commits

Author SHA1 Message Date
Marc Mutz
322ac72945 QObject: fix memory order on load/store of signal spy callback set
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>
2019-06-20 02:21:10 +02:00
Marc Mutz
08103d3a52 QDBusAbstractInterface: make call() and asyncCall() variadic templates
... 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>
2019-06-21 09:18:13 +02:00
Marc Mutz
6bcfe04535 QSysInfo: fix warning on non-Linux about unconditional adjacent returns
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>
2019-06-21 07:12:50 +00:00
Shawn Rutledge
b149f5d77a Overload QTextBrowser::setSource() to add optional type argument
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>
2019-06-20 20:29:15 +02:00
Marc Mutz
84536ae61e QNetworkAcesssCache: replace a QQueue with a std::vector
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>
2019-06-20 20:19:14 +02:00
Thiago Macieira
041a5ff076 gen_qfloat16_tables: add a comment explaining what the tool is
For our future selves.

Change-Id: I2b1955a995ad40f3b89afffd15a4c127686662bc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-06-03 10:42:55 -07:00
Thiago Macieira
5e40d3d982 qfloat16: Check in the tables to Git
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>
2019-06-03 10:42:53 -07:00
Thiago Macieira
26e5aa45e1 De-bootstrap the qfloat16 generator tool
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>
2019-06-03 10:42:44 -07:00
Eskil Abrahamsen Blomfeldt
6492541df3 Support copy-pasting foreground images within same document
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>
2019-06-21 11:48:10 +02:00
Jan Arve Sæther
cefaa2ff4c Fix androidtestrunner for windows
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>
2019-06-19 13:00:19 +02:00
BogDan Vatra
e428cdc32c Android: Fix sanitize_address
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>
2019-05-29 15:03:47 +03:00
Giuseppe D'Angelo
34fe9232db Port from QAtomic::load() to loadRelaxed()
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>
2019-06-20 20:48:59 +02:00
Edward Welbourne
84e89c1e9e Convert uses of QTime as a timer to QElapsedTimer
Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-14 10:42:33 +02:00
Christian Kandeler
feb06decfe qmake: Let evaluateFunction() return error for infinite recursion
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>
2019-06-18 11:23:03 +02:00
Samuel Gaist
1e21867baf test: migrate ModelsToTest to QRegularExpression
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>
2019-06-10 08:42:17 +02:00
Samuel Gaist
16cc3ea585 test: migrate QNetworkReply test to QRegularExpression
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>
2019-06-10 16:49:19 +02:00
Samuel Gaist
605dc42a0f test: migrate QXmlSimpleReader to QRegularExpression
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>
2019-06-10 21:37:56 +00:00
Samuel Gaist
6ff2e0e718 test: migrate QFontComboBox test to QRegularExpression
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>
2019-06-10 09:35:45 +02:00
Samuel Gaist
5398ce2432 test: migrate QAbstractItemModelTester to QRegularExpression
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>
2019-06-10 09:32:36 +02:00
Samuel Gaist
5174c8abae test: migrate QPrinterInfo test to QRegularExpression
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>
2019-06-11 09:08:11 +02:00
Samuel Gaist
2d72bf6019 Remove unused QRegExp include
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>
2019-06-10 19:25:12 +00:00
Samuel Gaist
928c3e4a68 test: migrate QTextDocumentFragment test to QRegularExpression
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>
2019-06-10 09:20:55 +02:00
Samuel Gaist
94495c814f test: migrate collections test to QRegularExpression
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>
2019-06-10 19:24:05 +00:00
Samuel Gaist
4aec51e39f test: migrate QStateMachine test to QRegularExpression
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>
2019-06-10 19:23:42 +00:00
Samuel Gaist
fd58792ef8 test: migrate QLibrary test to QRegularExpression
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>
2019-06-10 19:22:55 +00:00
Samuel Gaist
c0f0e94db5 test: Fix QRegularExpression feature config check
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>
2019-06-10 19:29:19 +00:00
Samuel Gaist
826b262fa6 test: migrate QItemSelectionModel test to QRegularExpression
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>
2019-06-10 19:29:44 +00:00
Samuel Gaist
0389a459bb test: migrate QStandardPaths tests to QRegularExpression
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>
2019-06-10 21:34:38 +02:00
Samuel Gaist
cc843c36ea test: add missing QRegularExpression specific QDataStream tests
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>
2019-06-10 19:22:20 +00:00
Samuel Gaist
20c6242c52 test: migrate highdpi manual test to QRegularExpression
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>
2019-06-10 10:16:52 +02:00
BogDan Vatra
743bc1254c Android: Fix resources folder
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>
2019-05-29 09:42:53 +03:00
Rolf Eike Beer
60932f69cc QTimeZone: avoid needless QString instances
Change-Id: I250bfb58c04b2c013285c8ebd6db1f964f0b7b29
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
 
 
 
 
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-19 09:30:12 +02:00
Simone Gaiarin
c826e67765 QAction: add exclusionPolicy property
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>
2019-03-19 13:46:43 +01:00
Laszlo Agocs
b17e05729e vkmemalloc: Disable SRWLOCK for mingw
...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>
2019-06-18 08:53:56 +00:00
Anton Kudryavtsev
55240bcdf3 QStringView, QLatin1String: add lastIndexOf methods
While touching the code, factor out internal methods
to avoid needlees latin1->utf16 conversion.

[ChangeLog][QtCore][QLatin1String] Added lastIndexOf().

[ChangeLog][QtCore][QStringView] Added lastIndexOf().

Change-Id: I1c624f00e4ed10111e0d00b86daff7904eeed176
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-18 14:48:50 +03:00
Friedemann Kleint
eed9a8fbd3 Add accessors for QWindow and QScreen to QWidgetPrivate
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>
2019-06-18 10:15:26 +02:00
Marc Mutz
cd563b3497 QNetworkConfiguration: remove unused member 'serviceNetworkMembers'
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>
2019-06-14 21:38:56 +02:00
Marc Mutz
a44a3a4999 QString: towards QStringView::arg() pt.2: port internal machinery to QStringView
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>
2019-06-06 18:47:25 +02:00
Marc Mutz
54bf20af5d QString: towards QStringView::arg() pt.1: modernize some code
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>
2019-06-06 18:30:40 +02:00
Marc Mutz
d0b3aaecd9 Make QIPAddressUtils::toString() const-correct for IPv6
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>
2019-06-15 18:40:37 +02:00
Marc Mutz
f2bd46d1df Fix deep-const-correctness of qGetPtrHelper() for smart pointers
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>
2019-06-15 18:40:24 +02:00
BogDan Vatra
079dafc42f Run prebuilt android test APKs
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>
2019-06-13 07:26:20 +00:00
Giuseppe D'Angelo
d73497cf77 QObject/QWidget::setParent: add assertions to prevent loops
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>
2019-06-07 10:43:16 +02:00
BogDan Vatra
9dec965248 Say hello to $ make apk
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>
2019-06-06 15:31:29 +03:00
BogDan Vatra
0ad4da0c64 Android: Nuke ant support
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>
2019-06-06 15:25:12 +03:00
BogDan Vatra
a5e03f59f4 Say hello to androidtestrunner
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>
2019-06-06 15:25:07 +03:00
Christian Ehrlicher
784c94c727 Replace QPainter::initFrom() with begin()
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>
2019-06-13 21:23:22 +02:00
Marc Mutz
779f1ff9fa QEvdev: remove m_deviceDiscovery members
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>
2019-06-13 08:48:26 +02:00
Marc Mutz
f1404c0ed1 QEvdev: Extract Method parseSpecification()
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>
2019-06-13 08:48:26 +02:00
Marc Mutz
e01e848df4 QMimeType: towards re-entrancy: do not cache iconName made from mimetype name
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>
2019-06-16 16:56:35 +02:00