1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-07 03:22:33 +01:00

Fix Qt 5 compilation

This commit is contained in:
Elias Steurer 2021-06-25 12:06:43 +02:00
parent a577decdc9
commit 0ab4e2e42f
5 changed files with 13 additions and 10 deletions

View File

@ -6,12 +6,12 @@ set(CMAKE_AUTOMOC ON)
find_package( find_package(
QT NAMES Qt6 Qt5 QT NAMES Qt6 Qt5
COMPONENTS Quick Widgets Gui LinguistTools WebSockets COMPONENTS Quick Widgets Gui LinguistTools WebSockets WebEngine QuickCompiler
REQUIRED) REQUIRED)
find_package( find_package(
Qt${QT_VERSION_MAJOR} Qt${QT_VERSION_MAJOR}
COMPONENTS Quick Widgets Gui LinguistTools WebSockets COMPONENTS Quick Widgets Gui LinguistTools WebSockets WebEngine QuickCompiler
REQUIRED) REQUIRED)
message(STATUS "[PROJECT] QT_VERSION_MAJOR = ${QT_VERSION_MAJOR}") message(STATUS "[PROJECT] QT_VERSION_MAJOR = ${QT_VERSION_MAJOR}")
@ -106,6 +106,7 @@ target_link_libraries(
Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::WebSockets Qt${QT_VERSION_MAJOR}::WebSockets
Qt${QT_VERSION_MAJOR}::WebEngine
ScreenPlaySDK ScreenPlaySDK
ScreenPlayUtil ScreenPlayUtil
benchmark::benchmark benchmark::benchmark

View File

@ -36,6 +36,7 @@
#include <QApplication> #include <QApplication>
#include <QCommandLineParser> #include <QCommandLineParser>
#include <QDebug> #include <QDebug>
#include <QtWebEngine/QtWebEngine>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <sentry.h> #include <sentry.h>
#endif #endif
@ -45,7 +46,7 @@
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
QtWebEngine::initialize();
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);

View File

@ -5,11 +5,11 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
find_package( find_package(
QT NAMES Qt6 Qt5 QT NAMES Qt6 Qt5
COMPONENTS Quick Widgets Gui COMPONENTS Quick Widgets Gui WebEngine QuickCompiler
REQUIRED) REQUIRED)
find_package( find_package(
Qt${QT_VERSION_MAJOR} Qt${QT_VERSION_MAJOR}
COMPONENTS Quick Widgets Gui WebEngine COMPONENTS Quick Widgets Gui WebEngine QuickCompiler
REQUIRED) REQUIRED)
if(WIN32) if(WIN32)
@ -27,7 +27,7 @@ set(src main.cpp src/basewindow.cpp)
set(headers src/basewindow.h) set(headers src/basewindow.h)
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(resources SPWResources.qrc) qt_add_resources(resources SPWResources.qrc)
else() else()
qtquick_compiler_add_resources(resources SPWResources.qrc) qtquick_compiler_add_resources(resources SPWResources.qrc)
endif() endif()

View File

@ -3,7 +3,7 @@
#include <QStringList> #include <QStringList>
#include <QVector> #include <QVector>
#include <QtGlobal> #include <QtGlobal>
#include <QtWebEngine> #include <QtWebEngine/QtWebEngine>
#include "ScreenPlayUtil/util.h" #include "ScreenPlayUtil/util.h"
@ -19,6 +19,7 @@ int main(int argc, char* argv[])
{ {
//QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); //QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
QtWebEngine::initialize();
QApplication app(argc, argv); QApplication app(argc, argv);

View File

@ -5,11 +5,11 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
find_package( find_package(
QT NAMES Qt6 Qt5 QT NAMES Qt6 Qt5
COMPONENTS Quick Widgets Gui COMPONENTS Quick Widgets Gui WebEngine QuickCompiler
REQUIRED) REQUIRED)
find_package( find_package(
Qt${QT_VERSION_MAJOR} Qt${QT_VERSION_MAJOR}
COMPONENTS Quick Widgets Gui WebEngine COMPONENTS Quick Widgets Gui WebEngine QuickCompiler
REQUIRED) REQUIRED)
set(src main.cpp src/widgetwindow.cpp) set(src main.cpp src/widgetwindow.cpp)
@ -17,7 +17,7 @@ set(src main.cpp src/widgetwindow.cpp)
set(headers src/widgetwindow.h) set(headers src/widgetwindow.h)
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(resources SPWidgetResources.qrc) qt_add_resources(resources SPWidgetResources.qrc)
else() else()
qtquick_compiler_add_resources(resources SPWidgetResources.qrc) qtquick_compiler_add_resources(resources SPWidgetResources.qrc)
endif() endif()