From 3fb7bc1b564ed658fe045903697609db2406bfad Mon Sep 17 00:00:00 2001 From: Lili Kurek Date: Sun, 12 Oct 2025 09:56:22 +0000 Subject: [PATCH] Fix building with Qt 6.10 Fixes #6326. --- src/qt/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt index 1a004d958..1c61f5559 100644 --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -48,10 +48,12 @@ set(CMAKE_FIND_PACKAGE_PREFER_CONFIG OFF) find_package(Threads REQUIRED) find_package(Qt${QT_MAJOR} COMPONENTS Core Widgets Network OpenGL Gui REQUIRED) find_package(Qt${QT_MAJOR}LinguistTools REQUIRED NO_CMAKE_FIND_ROOT_PATH) -if(NOT USE_QT6) - # For in src/qt/qt_mainwindow.cpp +if(USE_QT6) + set(QT_NO_PRIVATE_MODULE_WARNING ON) + find_package(Qt6 COMPONENTS GuiPrivate) +else() include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS}) -endif () +endif() # TODO: Is this the correct way to do this, and is it required on any # other platforms or with Qt 5?