From b2ea4212fd863ed69f5f6babfd1605e687f01b8f Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Thu, 2 Jan 2025 23:18:05 +0000 Subject: [PATCH] Use a common way to check for Qt6 instead of introducing UB --- OpenRGB.pro | 2 -- qt/OpenRGBSupportedDevicesPage/OpenRGBSupportedDevicesPage.cpp | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/OpenRGB.pro b/OpenRGB.pro index 9807859a..5700d308 100644 --- a/OpenRGB.pro +++ b/OpenRGB.pro @@ -21,8 +21,6 @@ CONFIG += c++17 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets -greaterThan(QT_MAJOR_VERSION, 5): DEFINES += _QT6 - #-----------------------------------------------------------------------------------------------# # Application Configuration # #-----------------------------------------------------------------------------------------------# diff --git a/qt/OpenRGBSupportedDevicesPage/OpenRGBSupportedDevicesPage.cpp b/qt/OpenRGBSupportedDevicesPage/OpenRGBSupportedDevicesPage.cpp index 62dc01ae..69eb440f 100644 --- a/qt/OpenRGBSupportedDevicesPage/OpenRGBSupportedDevicesPage.cpp +++ b/qt/OpenRGBSupportedDevicesPage/OpenRGBSupportedDevicesPage.cpp @@ -70,7 +70,7 @@ void OpenRGBSupportedDevicesPage::on_GetHardwareIDsButton_clicked() void OpenRGBSupportedDevicesPage::on_Filter_textChanged(const QString &arg1) { -#ifdef _QT6 +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) detectorSortModel->setFilterRegularExpression(QRegularExpression(arg1 , QRegularExpression::CaseInsensitiveOption)); #else detectorSortModel->setFilterRegExp(QRegExp(arg1, Qt::CaseInsensitive));