platforms/windows: fix deprecated C++ 20 implicit capture of this in [=]

With MinGW, GCC and Clang `[=, this]` is acceptable in C++20 mode, but
MSVC on the CI still builds with C++17. So use `[&]`, the other two
variables used inside the lambda are (const) built-in types, taking by
reference is the same as taking by copy.

Amends a90d99d8da9b2be2e6b8e981cd9dabfb1641e985.

Pick-to: 6.8
Change-Id: Ib1c746ccf1c02b2ee3891eca5bddd7e47f559dc5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
Ahmad Samir 2024-11-02 23:18:49 +02:00
parent 180f72d100
commit bac7f20acd

View File

@ -1363,7 +1363,7 @@ void QWindowsForeignWindow::setParent(const QPlatformWindow *newParentWindow)
qCDebug(lcQpaWindow) << __FUNCTION__ << window() << "newParent="
<< newParentWindow << newParent << "oldStyle=" << debugWinStyle(oldStyle);
auto updateWindowFlags = [=]{
auto updateWindowFlags = [&] {
// Top level window flags need to be set/cleared manually.
DWORD newStyle = oldStyle;
if (isTopLevel) {