Merge pull request #4318 from RytoEX/qt6-fixes

UI: Fix Qt6 build issues
master
Jim 2021-03-09 19:34:54 -08:00 committed by GitHub
commit fc6e085d32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 9 deletions

View File

@ -101,9 +101,7 @@ void OBSLogViewer::InitLog()
if (file.open(QIODevice::ReadOnly)) {
QTextStream in(&file);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
in.setEncoding(QStringConverter::Utf8);
#else
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
in.setCodec("UTF-8");
#endif

View File

@ -31,6 +31,7 @@
#include <obs-config.h>
#include <obs.hpp>
#include <QFile>
#include <QGuiApplication>
#include <QProxyStyle>
#include <QScreen>
@ -1389,7 +1390,9 @@ bool OBSApp::OBSInit()
{
ProfileScope("OBSApp::OBSInit");
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
qRegisterMetaType<VoidFunc>();

View File

@ -28,12 +28,7 @@
#include <memory>
#include <vector>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#define QT_UTF8(str) QString::fromUtf8(str, -1)
#else
#define QT_UTF8(str) QString::fromUtf8(str)
#endif
#define QT_TO_UTF8(str) str.toUtf8().constData()
class QDataStream;

View File

@ -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();