Why roll your own if you can use the original. The clone was even
designed to be API-compatible with std::set, so porting is trivial,
except for the unholy int/size_t mismatch, which requires a few
casts.
Change-Id: Ieb99cbc019ef387c6901d7518d1e79585169b638
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
The code contained a sizeable chunk of string parsing along with
qDebug()s in the normal path of execution. That code, however, was
only used for Qt's own autotests.
The idea of this patch is, then, to not only move the autotest case
into the cold text section (using Q_UNLIKELY), but also to completely
exclude it, when QT_BUILD_INTERNAL is not set.
Unfortunately, the structure of the function did not really lend
itself to #ifdefing that part of the code out (production code was in
the middle of non-production code), so I transformed the engine
selection code into a lambda, replacing assignment with returns, and
swapping the branches of the central if around to yield a single block
of code that can be excluded from compilation with just one #ifdef.
As a consequence, the runtime code is almost unaffected, and the
function is much easier to read now.
Since the test-specific code is only compiled into Qt now in developer
builds, guard the tests that rely on this behavior with the same macro.
Change-Id: I9fd1c57020a13cef4cd1b1674ed2d3ab9424d7cd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
They're meant to be subclassed, so we need to avoid slicing.
Change-Id: I384b65478f728c69aaf1edbc985b3fb4150191fe
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Use qExchange() in the move ctor and pass the function object by
rvalue ref.
This saves one move construction and doesn't produce unexpected
results. The qScopeGuard free function should take the function object
by value, because it decays and because we can't create an rvalure
reference in a deduced context. But once we're inside qScopeGuard, the
extra object isn't needed anymore, so optimize it away.
Change-Id: I94cbc45f9bf6ca086e100efd922a0b4643a81671
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
They will be deprecated, so qmake wouldn't compile anymore.
Change-Id: I42212fdf213df696d736ed34458f7e79bd902dd5
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
They are going to be deprecated.
Change-Id: Ib021aad108dc021df76ae21d1db6c8a1a734893d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The accessibilityAttributeValue method was deprecated and all needed
replacements are in macOS 10.12.
The new API is nicer, since it adds a lot of individual functions instead of
forcing one big switch statement on us. This makes it easier to implement
further protocols. When implementing e.g. the Button protocol, the old attribute
functions do not get called any more, so this is needed before implementing more
features.
Change-Id: I5a705edfa3f6bb0d25436df8cf5dd7f59e7e764e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We had an implementation of this based on the old attribute
based API, which also works. This cleans it up and adds
the setter.
Change-Id: I886fc9c89ee08b9f4f9aabec00ac1a5b9a800c6f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Setting the childMode property to ParallelStates will result in an
invalid state machine. This is never checked (worse, we explicitly
allow it and have a constructor to set it), but it results in
findLCCA failing, which then results in a failing assert or crash.
This fix in this patch is to handle this case separately. The proper
fix would be to remove completely the ability to set the childMode
on a QStateMachine, but that will have to wait until Qt6.
Fixes: QTBUG-49975
Change-Id: I43692309c4d438ee1a9bc55fa4f65f8bce8e0a59
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This code has been there since the initial public commit, but has no
effect.
Change-Id: Iae80ae22a363b3bd0e6cf7706619b38edc47790f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A comma appeared on a line on its own; a closing-brace didn't.
Change-Id: I33cf37bb3574cd421c8af5ab6312865b71ce61f1
Reviewed-by: Peter Hartmann <peter-qt@hartmann.tk>
Break a line before a close-brace. Added blank lines. Remove some
duplicate blank lines and spurious \fn directives. Fixed placement of
& between type and parameter name in the function declarations that
made these last redundant (these are the WS-only changes).
Change-Id: I7ee06a7cbb4f9cb275d5ad87246d8fbc9c9b6668
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
There are still users of QWeakPointer::data(), which under
certain compilers will make headersclean fail. So this
patch:
* ports data() to a private internalData() function and
calls it from all the usage points;
* adds cleanup notes for Qt 6, once some of the deprecated
machinery around storing unmanaged QObjects in QWeakPointers
can get removed.
Change-Id: Id3bcbd23374c18a2026861c08a4dcba1670673c1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
QFileDialog::DontUseSheet is obsolete since 4.5 and not used anywhere
inside the Qt code base. Mark it as deprecated and remove the last usage
in the examples.
Change-Id: If3d23fd5906314e6ebc7080efa79da14a2aa2720
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The following enumerations were obsolete for a log time but not marked
as deprecated:
- WA_NoBackground
- WA_MacNoClickThrough
- WA_MacBrushedMetal
- WA_MacMetalStyle
- WA_MSWindowsUseDirect3D
- WA_MacFrameworkScaled
- AA_MSWindowsUseDirect3DByDefault
- AA_X11InitThreads
- ImMicroFocus
mark them as deprecated and remove the usage inside QtBase so they can
be removed with Qt6
Change-Id: Ia087a7e1d0ff1945286895be6425a6cceaa483fb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
It's a dangerous API to have. Upgrade to a shared pointer
if accessing the raw pointer is required.
[ChangeLog][QtCore][QWeakPointer] The data() function has
been deprecated.
Change-Id: Ie5d34f4fb500b3cfa14d2c0b1b08484df072129c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Use the writeDefaultVariables method also for the
Win32MakeFileGenerator. Remove the initializations that are already done
in Makefile::writeDefaultVariables.
Change-Id: I590cc5d7031de67dd830e6113849ab080dbf2325
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
The old code did not prevent concurrent writes to the LUTs by separate
threads, each finding lutsGenerated to be false.
Let's consider whether the change is safe now: the storeRelease(1)
comes before the QMutex::unlock(), but since it is release semantics
no writes may be ordered past it. We have two releases, and their
order doesn't matter, since nothing else happens in-between.
Could we use a normal relaxed store? No, because the unlock() of the
mutex only synchronizes with the lock() of the same mutex, which
doesn't happen if the loadAcquire() succeeds. For loadAcquire() to
happen-before a write to the luts, we need a storeRelease() on the
atomic.
So, everything is correct, and minimal.
But maybe, to save the next reader from having to do the same mental
exercise again, add a manual locker.unlock() in front of the
storeRelease()?
Again no: that opens a gap where the luts are already generated on T0,
and the mutex unlocked, but the atomic not set. If another thread T1
gets to execute the function, it will enter the critical section, then
writing new values to the LUT. Meanwhile, the T0 sets generate to true
and a T2 enters the function, sees the final write from T0 and starts
using the luts -> data race with the writes concurrently done by T1.
Change-Id: Id278812a74b6e326e3ddf0dbcbb94b34766aa52e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This change adds the correct suffix to debug mode .pc filenames for
MinGW and also to the Qt libraries listed in the `Requires` field.
The filename adjustment fixes the accidental overwriting of release
mode .pc files with the debug mode variant which required the wrong
variant of the libraries when `debug_and_release` is active.
Note that macOS also supports the `debug_and_release' configuration
but may use the regular library names together with DYLD_IMAGE_SUFFIX.
Creation of *_debug.pc files is turned off as they're identical to their
non-debug counterparts.
[ChangeLog][Platform Specific Changes][MinGW] Added a suffix to debug
mode pkgconfig files.
Task-number: QTBUG-4155
Change-Id: I221c2dae51d7bd011836cb03945631a43180d7b5
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
[ChangeLog][configure] Added the configure option -qtlibinfix-plugins
to rename plugins according to QT_LIBINFIX. This option is off by
default.
Fixes: QTBUG-15192
Change-Id: Id5b267e169ee143fc8f7abc6b27bc0ed5306406f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This test passes, according to our metrics it kept on failing on 16.04
and on OpenSuse.
This reverts commit d2015b4d06.
Change-Id: Ibe81f848238d9df651a74f9fd82ac636c2c249f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Modern macOS accessibility is based on protocols.
By implementing NSAccessibilityElement we get warnings
for missing functions for the most basic accessibility
functionality.
Change-Id: I0595ea5b9927c5bfb4bbeff3fc9322cb1f232b9f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Following the introduction of AutoDeleteReplyOnFinishAttribute to
QNetworkRequest it seems natural to make it easy to enable for all
replies created with the current QNetworkAccessManager.
[ChangeLog][QtNetwork][QNetworkAccessManager] Added setAutoDeleteReplies
to QNetworkAccessManager to enable the AutoDeleteReplyOnFinishAttribute
attribute for all QNetworkRequests that are passed to
QNetworkAccessManager.
Change-Id: I7f96dd1fc9a899328e89732be17780b4e710c2a2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
[ChangeLog][QtNetwork][QNetworkRequest] Added the
AutoDeleteReplyOnFinishAttribute attribute to QNetworkRequest, which
makes QNetworkAccessManager delete the QNetworkReply after it has
emitted the "finished" signal.
Change-Id: I03d4ac0830137882e51dd28795a8ec817762a300
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The 'queue' was never used as a queue: it was populated, and then
exchanged into a local copy to be consumed in a loop. This loop used
dequeue(), but of course it could just const-iterate the container and
dump it as the end, since the member variable was already reset at
that point, no-one could tell the difference from the outside.
So, no need for a queue. A vector will do very nicely.
The loop now uses ranged-for and qExchange(), greatly simplifying the
code over the old version.
Add another qExchange() call as a drive-by.
Change-Id: I6147453dc9edfe9500833627b123bb3a31114651
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This adds the shortcut to spinboxes and date edites.
Fixes: QTBUG-48231
Change-Id: I91400e1990e4b1d7d971198c1e2a64149c2a835e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
When migrating QFtp test to docker server, it seems it is easy to get
"QTestEventLoop::instance().timeout()" during the test in Coin network.
To move the task of migration forward, those flaky timeout errors will
be ignored for short-term.
Task-number: QTBUG-75549
Change-Id: I797952b82c0ceb637f40c77fac2a88ca2a9a0eae
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Sometimes, it fails in tst_QFtp::proxy or tst_QFtp::activeMode under the
stress test. It complains about "Network operation timed out" on
vsftpd.test-net.qt.local.
When this issue happens in tst_QFtp::proxy, it shows "USER-ERR reject:
172.18.0.5 (ForkLimit 40)" in the log of ftp-proxy. By default, the
ftp-proxy only supports 40 incoming client connections per minute. To
make the ftp-proxy more powerful, this change extends the limits from 40
to 2000.
When this issue happens in tst_QFtp:activeMode, vsftpd shows 426 Failure
writing network stream error. It is a known issue of vsftpd. A quick fix
is turning use_sendfile off.
Change-Id: Iad50469654041bf30f92ef00805034f0d4aa9c3f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The proxy_data() defined in tst_qftp.cpp expects five items (bigfile,
nonASCII, rfc3252, rfc3252.txt, and upload) in the server folder
(ftp/qtest). The file rfc3252 and nonASCII folder were missing.
Change-Id: I995d6e254875ade22a1def53187077f1cc8d4c98
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Use docker test server to run test, following instructions on
https://wiki.qt.io/Network_Testing. Verified on Ubunutu 18.04.
Several test failures due to network timeouts and inconsistent
configuration of FTP server and assumptions made in the tests.
However, the test is either way blacklisted, and the docker test
server is not in use yet.
Done-with: Ryan Chu <ryan.chu@qt.io>
Fixes: QTQAINFRA-2275
Change-Id: I4cbd0109ce3f4cfb23ba2303a85796681d12febc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QAbstractPrintDialog (a QDialog subclass) has an interesting
override of exec(): a pure virtual, without a body.
The UNIX subclass was therefore forced to override it, but
since it did not need to do anything with it, it had to call
QDialog::exec (bypassing the direct base, otherwise it
would cause a pure virtual call).
Eliminate the pure virtual override. This should be BC;
the layout of the vtable does not change, merely its contents.
Change-Id: I84ac23c938f1934f699df032ef1bde0d6df77784
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The object is never copied, so there's no point in using a cow'ed list implementation.
Apart from the usual API adaptions (isEmpty() -> empty(), append() -> push_back()),
alse replaced two foreach-loops with ranged-for. The first one does not call into
out-of-line functions, and doesn't modify the container it iterates over, so is
safe.
The second does call into out-of-line functions, but they are const. The loop does
not modify the container it iterates over, either, so is also safe (except for some
fishy const_cast somewhere, or const being lost due to shallowness of const).
Also replaced explicit-iterator loops with ranged-for where possible.
Change-Id: I60b0f2d356846d527bfbaa6a0ecbb8395013b852
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The object is never copied, so there's no point in using a cow'ed list implementation.
Also port two explicit-iterator loops to ranged-for, as one is necessary
(because of constBegin()) and the other is for consistency.
Change-Id: Ia7f080060d6b675a76b55d197af08161389082a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Casting towards more derived classes is "downcasting",
not "upcasting".
Change-Id: I1373a073ba81fb2c2b77c35ac1916a53ce30b86c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Add noexcept and honor the RO3 to silence warnings.
In theory this could also be constexpred, but there might
still be compilers we support that do not have constexpr initialization
for atomics...
Change-Id: Ibb94a2f4392908451cf7985d48f999581f03398d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The internal QByteArrays are kept in a QList, so we can use
int to get the count. This matches what operator[] takes,
and gets rid of a bunch of warnings when iterating over a QByteData
using a plain int as a index variable.
Change-Id: Ib44d4101612135b976979a8464442e94706f8736
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is a 1:1 replacement for std::exchange, and should be removed once
Qt fully depends on C++14. It's too versatile a tool to miss it, so
provide a copy.
[ChangeLog][QtCore][QtGlobal] Added qExchange(), a drop-in for C++14's std::exchange()
Change-Id: I31c4f1141e7a99f99ea65eb36ddf9d68b7847337
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is in preparation of deprecating QLinkedList.
Change-Id: Id5018b7fbc89f8b76b86e97cd09d18b4b8cb6234
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The macro needed to avoid generating headers_*.o from the header files.
Change-Id: I4fc5ec2432661493e337e1779d79373dedff0132
Reviewed-by: David Faure <david.faure@kdab.com>
QtANGLE is set on MODULE_AUX_INCLUDES so the headers can be found when
building with ANGLE (gui.pro) but the pkg-config file is missing this
header and the Qt headers cannot be compiled with the path from this
config.
Fixes: QTBUG-75495
Change-Id: I4d795b3495b8d08c65f9ddffad4fc838b4f04c31
Reviewed-by: Kai Koehne <kai.koehne@qt.io>