From 831c7c863ed833c2385adaf5efcf17fc4fc5842c Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Mon, 23 Oct 2023 10:28:51 +0200 Subject: [PATCH] Use new QT_NO_CONTEXTLESS_CONNECT variable in qt6 Defining the macro before including any Qt header will disable the overload of QObject::connect that does not take a receiver/context argument. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64e38cac1..1b5058364 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,9 @@ if(NOT Qt6_FOUND) find_package(Qt5 5.15 COMPONENTS Core Gui Test REQUIRED) endif() +if (NOT Qt5_FOUND) + add_definitions(-DQT_NO_CONTEXTLESS_CONNECT) +endif() if(UNIX AND NOT APPLE) if (Qt5_FOUND)