diff --git a/tests/auto/wayland/shared/mockcompositor.cpp b/tests/auto/wayland/shared/mockcompositor.cpp index 946e87ed6a7..5748c51ae57 100644 --- a/tests/auto/wayland/shared/mockcompositor.cpp +++ b/tests/auto/wayland/shared/mockcompositor.cpp @@ -37,8 +37,8 @@ DefaultCompositor::DefaultCompositor(CompositorType t, int socketFd) // TODO: other shells, viewporter, xdgoutput etc - QObject::connect(get(), &WlCompositor::surfaceCreated, [&] (Surface *surface){ - QObject::connect(surface, &Surface::bufferCommitted, [=] { + QObject::connect(get(), &WlCompositor::surfaceCreated, [this] (Surface *surface){ + QObject::connect(surface, &Surface::bufferCommitted, [this, surface] { if (m_config.autoRelease) { // Pretend we made a copy of the buffer and just release it immediately surface->m_committed.buffer->send_release(); @@ -49,7 +49,7 @@ DefaultCompositor::DefaultCompositor(CompositorType t, int socketFd) }); }); - QObject::connect(get(), &XdgWmBase::toplevelCreated, get(), [&] (XdgToplevel *toplevel) { + QObject::connect(get(), &XdgWmBase::toplevelCreated, get(), [this] (XdgToplevel *toplevel) { if (m_config.autoConfigure) toplevel->sendCompleteConfigure(); }, Qt::DirectConnection);