diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 8825372c03..eacc373ee3 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -1121,7 +1121,8 @@ public: template iterator emplace(const Key &key, Args &&... args) { - return emplace(Key(key), std::forward(args)...); + Key copy = key; // Needs to be explicit for MSVC 2019 + return emplace(std::move(copy), std::forward(args)...); } template