From 37971e7bf9aa4f25b5ece382ef236264d04f1316 Mon Sep 17 00:00:00 2001 From: Ryan Foster Date: Tue, 9 Mar 2021 09:10:59 -0500 Subject: [PATCH] UI: Force plugins to use version appropriate Qt Network Make building against either Qt5 or Qt6 easier by checking the Qt version used and loading the appropriate Qt Network DLL. --- UI/window-basic-main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 5d91c777d..65f5c938f 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -1746,10 +1746,14 @@ void OBSBasic::OBSInit() InitOBSCallbacks(); InitHotkeys(); - /* hack to prevent elgato from loading its own Qt5Network that it tries + /* hack to prevent elgato from loading its own QtNetwork that it tries * to ship with */ #if defined(_WIN32) && !defined(_DEBUG) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) LoadLibraryW(L"Qt5Network"); +#else + LoadLibraryW(L"Qt6Network"); +#endif #endif AddExtraModulePaths();