Submitted By:            Joe Locash <jlocash at gmail dot com>
Date:                    2025-10-25
Initial Package Version: 2.2.0
Upstream Status:         Applied
Origin:                  Upstream commit 90473945
Description:             Fixes building lxqt-qtplugin against qt-6.10.

From 90473945206dbf21816a00dfba27426a5b5a9e25 Mon Sep 17 00:00:00 2001
From: Chiitoo <Chiitoo@users.noreply.github.com>
Date: Wed, 8 Oct 2025 19:46:22 +0300
Subject: [PATCH] cmake: fix build with Qt 6.10 (#100)

The 'Qt6FooPrivate' targets have been split into separate CMake files
in Qt 6.9, and require a 'find_package(Qt6FooPrivate)' call starting
with Qt 6.10.

See also: https://bugreports.qt.io/browse/QTBUG-87776
---
 CMakeLists.txt     |  5 +++++
 src/CMakeLists.txt | 11 +++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 39b136d..cecc546 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,6 +23,11 @@ find_package(Qt6DBus ${QT_MINIMUM_VERSION} REQUIRED)
 find_package(Qt6LinguistTools ${QT_MINIMUM_VERSION} REQUIRED)
 find_package(Qt6Widgets ${QT_MINIMUM_VERSION} REQUIRED)
 find_package(Qt6XdgIconLoader ${QTXDG_MINIMUM_VERSION} REQUIRED)
+
+if (Qt6Gui_VERSION VERSION_GREATER_EQUAL "6.10.0")
+    find_package(Qt6GuiPrivate REQUIRED)
+endif()
+
 find_package(lxqt2-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
 find_package(dbusmenu-lxqt ${DBUSMENU_MINIMUM_VERSION} REQUIRED)
 find_package(fm-qt6 ${FMQT_MINIMUM_VERSION} REQUIRED)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 008e2be..6bcd84e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -33,10 +33,13 @@ target_compile_definitions(qtlxqt
 )
 
 target_link_libraries(qtlxqt
-    Qt6::Widgets
-    Qt6::DBus
-    dbusmenu-lxqt
-    Qt6XdgIconLoader
+    PRIVATE
+        Qt6::GuiPrivate
+    PUBLIC
+        Qt6::Widgets
+        Qt6::DBus
+        dbusmenu-lxqt
+        Qt6XdgIconLoader
 )
 
 lxqt_query_qt(_QT_PLUGINS_DIR QT_INSTALL_PLUGINS)
