tests: fix deprecated implicit capture of this via [=]

Fixes compiler warnings:
    warning: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Wdeprecated]

Change-Id: Ia7cf50f491e92f39162c69afb2a8320afedba056
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
Marc Mutz 2021-06-30 10:57:17 +02:00
parent 8c97f51425
commit 0ed1f8b54e
3 changed files with 3 additions and 3 deletions

View File

@ -293,7 +293,7 @@ public:
#if !defined(Q_OS_MACOS)
// FIXME: All platforms should send window-state change events, regardless
// of the sync/async nature of the the underlying platform, but they don't.
connect(this, &QWindow::windowStateChanged, [=]() {
connect(this, &QWindow::windowStateChanged, [this]() {
lastReceivedWindowState = windowState();
});
#endif

View File

@ -363,7 +363,7 @@ void tst_QHostInfo::lookupConnectToLambda()
QFETCH(QString, addresses);
lookupDone = false;
QHostInfo::lookupHost(hostname, [=](const QHostInfo &hostInfo) {
QHostInfo::lookupHost(hostname, [this](const QHostInfo &hostInfo) {
resultsReady(hostInfo);
});

View File

@ -193,7 +193,7 @@ QNetworkInterface tst_QUdpSocket::interfaceForGroup(const QHostAddress &multicas
if (!scope.isEmpty())
return QNetworkInterface::interfaceFromName(scope);
static QNetworkInterface ipv6if = [=]() {
static QNetworkInterface ipv6if = [&]() {
// find any link local address in the allAddress list
for (const QHostAddress &addr: qAsConst(allAddresses)) {
if (addr.isLoopback())