From 8bf470baa0f54b1d27894110f6ddceefd0199670 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Sat, 2 Nov 2024 06:55:29 +1000 Subject: [PATCH] Disable Qt deprecation warnings on Qt 6 builds These are too noisy, as we get thousands of warnigs due to QVariant::Type usage in headers which we need for Qt 5 build compatibility --- CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 991af98eb9b..e1eeb0cdc46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -824,10 +824,14 @@ if(MSVC) add_definitions(-DNOMINMAX) endif() -# Prevent build when Qt api deprecated before this Qt version is used: -add_definitions(-DQT_DEPRECATED_WARNINGS) -# Unfortunately Qwt uses deprecated QString::null in headers, preventing this being raised above 5.8 -add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050800) +if(BUILD_WITH_QT6) + # Qt deprecated warnings are too noisy for now -- we have a LOT of QVariant::Type usage + # in order to maintain Qt5 compatibility + add_definitions(-DQT_NO_DEPRECATED_WARNINGS) +else() + # Unfortunately Qwt uses deprecated QString::null in headers, preventing this being raised above 5.8 + add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050800) +endif() # For fast string concatenation add_definitions(-DQT_USE_QSTRINGBUILDER)