diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index d9b7df18014..9d6229207d7 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -1754,7 +1754,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