to save allocations, and use tokenize to avoid temp container
Change-Id: I2a43612b9d15538a93d4afd2c544714507141f0f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
In QHttpNetworkRequest and QHttpNetworkReply this method is used with const char* literals, so no need to create QByteArray
Change-Id: Ifef7cb23aa434577455625077ef1adaab085c8ae
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This makes the code slightly more readable.
Rename one overload of QDBusConnectionManager::doConnectToBus to
avoid using qOverload.
Change-Id: Id878e5baade539c3f748b5bf66a5aff726604b89
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Neither C++ nor modern C allow omitting the type (which used to be
equivalent to an "int" return type).
moc should not try to parse functions in C code, as they cannot be
meta-methods. So there is no point in supporting it.
Change-Id: I2b3a492988f29e8139311db64be110581cc1a4de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We know that all lines from /proc/<PID>/maps end in a newline, so we
trim exactly that one byte, then we put it all back together with
.join('\n') to check if we've read the entire file.
Linux virtual files are usually served in 4 kB increments; tst_qfile's
maps file is about 16000 bytes for me, just short of the QIODevice buffer:
[pid 414315] read(5, "55c6afe04000-55c6afe11000 r--p 0"..., 16384) = 4049
[pid 414315] read(5, "7f215fd25000-7f215fd26000 r--p 0"..., 12335) = 4038
[pid 414315] read(5, "7f2160800000-7f21608c7000 r--p 0"..., 8297) = 4072
[pid 414315] read(5, "7f216119f000-7f21611a0000 rw-p 0"..., 4225) = 3994
It is not a coincidence that the reads are at line boundaries, though
it's not a guarantee from the kernel.
We appear to have accidentally fixed the QEMU emulation bug by reading
another process' /proc/<PID>/maps (hypothesis: QMU emulates the target
system in /proc/self, hiding itself in maps, but makes no translation
for other process map files.
Change-Id: Ifbf974a4d10745b099b1fffd1777ac919b12dc90
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
I've left the QT_NO_ macros because they were public. No one should be
using them (and they are now 1 on Linux, so you had better not be using
them), but just in case.
Change-Id: Ifbf974a4d10745b099b1fffd177758a7a26e4244
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Create QBA only when it's needed
While touching code, use std::move more
Change-Id: I5f014822a47d41fa1fca46a85a7921c70d1d9a55
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This unifies the approach to running sync tasks (possibly with a
return value) on the main thread.
Change-Id: I2a05c4f40115a79dbf03c03fa8d8db34124884dc
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
File filter was not properly processed when using LocalFileAPI.
The QtFormat->AcceptList conversion was happening twice, resulting
in erronous types. This prevented dialog from appearing on Chrome.
Additionally remove unused debug code.
Fixes: QTBUG-115087
Pick-to: 6.5 6.6
Change-Id: Ie6770e2f1d2aa7c3ad19f9ab105dbec8102d45fc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The test changes couple variables to emulate the user project
environment. These variables also affect the policy handling.
The test will build and work properly only if tests are built
standalone. So add this limitation.
Amends 2e340cea88
Pick-to: 6.6
Change-Id: I0cc49bf55bf7763e4c3ecdfa5333fb0453f06794
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We are BLACKLISTing on macos/arm - the test is flaky.
Pick-to: 6.6 6.5
Task-number: QTBUG-115945
Change-Id: I3be28c895d46ce5ba86e00d597016334bdb16021
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Since the native file dialog doesn't allow changing the name filters
after it's been opened, another way to ensure that we comply with
the provided nameFilters list is to provide them all at once.
[ChangeLog][Android][FileDialog] use all nameFilters at once since
Android file picker can't change nameFilters after being opened.
Pick-to: 6.6
Change-Id: I389feecae190af41b87c7f2070494bd57eec4b69
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
QObject::children() returns a const QList&, and nothing in the loop body
changes the objects children, so straightforward port to ranged-for.
Task-number: QTBUG-115839
Change-Id: I78827fd986d6ff2607cc2616ff23580c9d830f1b
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Calling this function before we had a QGuiApplication instance, would
return an empty string, even if QT_QPA_DEFAULT_PLATFORM_NAME was defined
at compile time. We now return the default platform name
[ChangeLog][QtGui][QGuiApplication] QGuiApplication::platformName
now reports the default platform name if QGuiApplication hasn't been
instantiated yet. It used to return an empty string.
Pick-to: 6.6 6.5
Change-Id: Iffe7cde8943ed2d186bc494d0920b9cf79389dd0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It's very flakey in CI: http://testresults.qt.io/grafana/goto/XZQAAPRSg
What we want to test is whether Qt issues paint events in response
to enabling an already enabled effect. Doing so via qWait will process
both window system events and posted Qt events, and the former might
include spontaneous paint events from the system that we can't control.
Task-number: QTBUG-115945
Pick-to: 6.5 6.6
Change-Id: I65e5c6a4458e77b3bd2ad700c5caf6d441f4ca53
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
As part of creating the QML binding, add
Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
to QNetworkInformation.
Task-number: QTBUG-113813
Change-Id: Ib5d3b2356986c565b9786bc2d925cc4199bae6c9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The old name misleadingly identifies it as the Greek letter on which
it is based (and to which it case-folds); but U+00B5 is MICRO SIGN,
not the Greek letter mu, and pretending it is the latter only leads to
confusion.
Retain the old name as an alias to the new, prepare to deprecate it
from 6.11 and change all uses of it to the new name.
[ChangeLog][QtCore][Qt::Key] Qt::Key_mu is now renamed Key_micro,
since it is, in fact, the micro sign, not the Greek letter mu. The old
name is retained as an alias for the time being.
Change-Id: I4deb905f5e59b906710bd092c05a2c0a9b6bba65
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The displayed failure messages were missing the label, making the
output confusing.
Pick-to: 6.5 6.6
Change-Id: I4e20687f85b651dcac66ebd6e0881809dc0be709
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Replace if-block with early return on null QWindow.
Pick-to: 6.6
Task-number: QTBUG-116232
Change-Id: Iaf402edfd9b03734b64fdf707834fa92c827a1dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Use QObjectPrivate::connect() instead of SLOT/SIGNAL based connection.
Remove _q_ prefix and private slot declaration.
Change-Id: I4f91d6f7155d7578c5d2d31a18865a00ebb8d13b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Use QObjectPrivate::connect() instead of SLOT/SIGNAL based connection.
Remove _q_ prefix and private slot declaration.
Change-Id: If6882b7cbd723b441f865f1a8de47466964077e7
Reviewed-by: David Faure <david.faure@kdab.com>
This is a macro. We cannot use return() here or we're skipping code at
the call site.
This commit amends b684984939.
Task-number: QTBUG-88264
Change-Id: Icf6dd06338584239873bf4d66a4bbceef9071399
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>