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.

Change-Id: Ib1c746ccf1c02b2ee3891eca5bddd7e47f559dc5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit bac7f20acd37911813bd774afea55823b8320aa2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Ahmad Samir 2024-11-02 23:18:49 +02:00 committed by Qt Cherry-pick Bot
parent 79507816fa
commit 60065cc08e

View File

@ -1380,7 +1380,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) {