diff --git a/src/platform/qt/CMakeLists.txt b/src/platform/qt/CMakeLists.txt index 41f3f8614..0818fefbc 100644 --- a/src/platform/qt/CMakeLists.txt +++ b/src/platform/qt/CMakeLists.txt @@ -25,8 +25,12 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(QT_LIBRARIES) -find_package(Qt5 COMPONENTS Core Widgets Network OPTIONAL_COMPONENTS Multimedia) -set(QT Qt5) +set(QT_V 5) +find_package(Qt${QT_V} COMPONENTS Core Widgets Network OPTIONAL_COMPONENTS Multimedia) +if(QT_V GREATER_EQUAL 6) + find_package(Qt${QT_V} COMPONENTS OpenGL OpenGLWidgets) +endif() +set(QT Qt${QT_V}) if(NOT BUILD_GL AND NOT BUILD_GLES2 AND NOT BUILD_GLES3) message(WARNING "OpenGL is recommended to build the Qt port") @@ -199,7 +203,7 @@ set(GB_SRC GBOverride.cpp PrinterView.cpp) -set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libqt5widgets5") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libqt${QT_V}widgets${QT_V}") set(AUDIO_SRC) if(BUILD_SDL) @@ -219,15 +223,17 @@ if(${QT}Multimedia_FOUND) list(APPEND AUDIO_SRC AudioProcessorQt.cpp AudioDevice.cpp) - list(APPEND SOURCE_FILES - VideoDumper.cpp) + if(QT_V LESS 6) + list(APPEND SOURCE_FILES + VideoDumper.cpp) + endif() if (WIN32 AND QT_STATIC) list(APPEND QT_LIBRARIES ${QT}::QWindowsAudioPlugin ${QT}::DSServicePlugin ${QT}::QWindowsVistaStylePlugin ${QT}::QJpegPlugin strmiids mfuuid mfplat mf ksguid dxva2 evr d3d9) endif() list(APPEND QT_LIBRARIES ${QT}::Multimedia) list(APPEND QT_DEFINES BUILD_QT_MULTIMEDIA) - set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libqt5multimedia5") + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},libqt${QT_V}multimedia${QT_V}") endif() if(NOT AUDIO_SRC) @@ -403,6 +409,9 @@ if(WIN32) endif() list(APPEND QT_LIBRARIES ${QT}::Widgets ${QT}::Network) +if(${QT_V} GREATER_EQUAL 6) + list(APPEND QT_LIBRARIES ${QT}::OpenGL ${QT}::OpenGLWidgets) +endif() if(BUILD_GL OR BUILD_GLES2 OR BUILD_EPOXY) list(APPEND QT_LIBRARIES ${OPENGL_LIBRARY} ${OPENGLES2_LIBRARY}) endif() diff --git a/src/platform/qt/InputController.h b/src/platform/qt/InputController.h index 12f4e8915..936b211eb 100644 --- a/src/platform/qt/InputController.h +++ b/src/platform/qt/InputController.h @@ -25,7 +25,9 @@ #include #ifdef BUILD_QT_MULTIMEDIA +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) #include "VideoDumper.h" +#endif #include #endif @@ -165,7 +167,9 @@ private: bool m_cameraActive = false; QByteArray m_cameraDevice; std::unique_ptr m_camera; +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) VideoDumper m_videoDumper; +#endif #endif mInputMap m_inputMap; diff --git a/src/platform/qt/InputProfile.cpp b/src/platform/qt/InputProfile.cpp index e8f7f1711..852dbb413 100644 --- a/src/platform/qt/InputProfile.cpp +++ b/src/platform/qt/InputProfile.cpp @@ -8,7 +8,7 @@ #include "input/InputMapper.h" #include "InputController.h" -#include +#include using namespace QGBA; @@ -202,8 +202,8 @@ constexpr InputProfile::InputProfile(const char* name, const InputProfile* InputProfile::findProfile(const QString& name) { for (size_t i = 0; i < sizeof(s_defaultMaps) / sizeof(*s_defaultMaps); ++i) { - QRegExp re(s_defaultMaps[i].m_profileName); - if (re.exactMatch(name)) { + QRegularExpression re(QString("^%1$").arg(s_defaultMaps[i].m_profileName)); + if (re.match(name).hasMatch()) { return &s_defaultMaps[i]; } }