public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Zephyr Lykos <git@mochaa.ws>
To: git-commits@fedoraproject.org
Subject: [rpms/qt6ct] epel9: Refactor CMake build rules
Date: Thu, 08 Oct 2026 20:05:59 GMT	[thread overview]
Message-ID: <179148995900.1.12054578863483471025.rpms-qt6ct-334aa5c492e1@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/qt6ct
Branch : epel9
Commit : 334aa5c492e1d7fb471a461d226f07b6ff6cf78e
Author : Zephyr Lykos <git@mochaa.ws>
Date   : 2025-09-09T04:19:41+08:00
Stats  : +887/-622 in 4 file(s)
URL    : https://src.fedoraproject.org/rpms/qt6ct/c/334aa5c492e1d7fb471a461d226f07b6ff6cf78e?branch=epel9

Log:
Refactor CMake build rules

---
diff --git a/0001-build-refactor-CMake-build-rules.patch b/0001-build-refactor-CMake-build-rules.patch
new file mode 100644
index 0000000..c1a4b76
--- /dev/null
+++ b/0001-build-refactor-CMake-build-rules.patch
@@ -0,0 +1,386 @@
+From 37b5df86077954ff9575f78b485a7205858cc676 Mon Sep 17 00:00:00 2001
+From: Zephyr Lykos <git@mochaa.ws>
+Date: Mon, 8 Sep 2025 16:34:18 +0800
+Subject: [PATCH] build: refactor CMake build rules
+
+---
+ CMakeLists.txt                        | 55 ++++++---------------------
+ src/qt6ct-common/CMakeLists.txt       | 33 ++++++----------
+ src/qt6ct-common/config.h.in          | 37 ++++++++++++++++++
+ src/qt6ct-common/qt6ct.cpp            |  6 ++-
+ src/qt6ct-common/qt6ct.h              |  4 ++
+ src/qt6ct-qtplugin/CMakeLists.txt     |  8 ++--
+ src/qt6ct-style/CMakeLists.txt        | 11 ++----
+ src/qt6ct/CMakeLists.txt              | 12 +++---
+ src/qt6ct/main.cpp                    |  5 +++
+ src/qt6ct/translations/CMakeLists.txt | 48 +++++++++++++++++++++++
+ 10 files changed, 136 insertions(+), 83 deletions(-)
+ create mode 100644 src/qt6ct-common/config.h.in
+ create mode 100644 src/qt6ct/translations/CMakeLists.txt
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0d88aeb..366c3df 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 3.18.0)
+ 
+-project(qt6ct LANGUAGES CXX)
++project(qt6ct LANGUAGES CXX VERSION 0.11)
+ 
+ if(POLICY CMP0175)
+     cmake_policy(SET CMP0175 NEW)
+@@ -8,6 +8,11 @@ endif()
+ 
+ include(GNUInstallDirs)
+ 
++find_package(ECM REQUIRED NO_MODULE)
++set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
++
++option(QT6CT_IN_TREE "act as an in-tree Qt module, use standard Qt paths, unbundle language files, etc." OFF)
++
+ configure_file(
+   "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
+   "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
+@@ -27,52 +32,16 @@ set(CMAKE_AUTOUIC ON)
+ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
+ 
+-add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060200 -DUSE_WIDGETS -DQT_DEPRECATED_WARNINGS -DQT_MESSAGELOGCONTEXT)
++add_compile_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060200 -DUSE_WIDGETS -DQT_DEPRECATED_WARNINGS -DQT_MESSAGELOGCONTEXT)
+ add_compile_options(-Wall -Wextra)
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
+ 
+-find_package(Qt6 6.2 CONFIG REQUIRED COMPONENTS BuildInternals Core Widgets OPTIONAL_COMPONENTS QuickControls2 LinguistTools)
+-find_package(KF6Config)
+-find_package(KF6ColorScheme)
+-find_package(KF6IconThemes)
++find_package(Qt6 6.2 CONFIG REQUIRED COMPONENTS BuildInternals Core Widgets LinguistTools OPTIONAL_COMPONENTS QuickControls2)
++find_package(KF6 COMPONENTS Config ColorScheme IconThemes)
+ 
+-get_target_property(QT_QTPATHS_EXECUTABLE Qt6::qtpaths IMPORTED_LOCATION)
+-
+-if(Qt6LinguistTools_FOUND)
+-    get_target_property(QT_LRELEASE_EXECUTABLE Qt6::lrelease IMPORTED_LOCATION)
+-    if(NOT QT_QTPATHS_EXECUTABLE AND QT_LRELEASE_EXECUTABLE)
+-        get_filename_component(QT_LRELEASE_PATH ${QT_LRELEASE_EXECUTABLE} DIRECTORY)
+-        set(QT_QTPATHS_EXECUTABLE ${QT_LRELEASE_PATH}/qtpaths)
+-    endif()
+-endif()
+-
+-if(QT_QTPATHS_EXECUTABLE AND EXISTS ${QT_QTPATHS_EXECUTABLE})
+-    message(STATUS "Found qtpaths executable: ${QT_QTPATHS_EXECUTABLE}")
+-else()
+-    message(FATAL_ERROR "Could NOT find qtpaths executable")
+-endif()
+-
+-if(Qt6LinguistTools_FOUND)
+-    if(QT_LRELEASE_EXECUTABLE AND EXISTS ${QT_LRELEASE_EXECUTABLE})
+-        message(STATUS "Found lrelease executable: ${QT_LRELEASE_EXECUTABLE}")
+-    else()
+-        message(FATAL_ERROR "Could NOT find lrelease executable")
+-    endif()
+-endif()
+-
+-#execute_process(COMMAND ${QT_QTPATHS_EXECUTABLE} -query QT_INSTALL_PLUGINS OUTPUT_VARIABLE PLUGINDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
+-execute_process(COMMAND ${QT_QTPATHS_EXECUTABLE} --plugin-dir OUTPUT_VARIABLE PLUGINDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
+-
+-if(PLUGINDIR)
+-   message(STATUS "Plugin path: ${PLUGINDIR}")
+-else()
+-   message(FATAL_ERROR "Could not get plugin path")
+-endif()
+-
+-if(Qt6LinguistTools_FOUND)
+-    message(STATUS "Generating translations ...")
+-    execute_process(COMMAND find ${CMAKE_CURRENT_SOURCE_DIR}/src -name *.ts COMMAND xargs ${QT_LRELEASE_EXECUTABLE} -silent)
+-endif()
++include(ECMQueryQt)
++ecm_query_qt(QT_INSTALL_PLUGINS QT_INSTALL_PLUGINS)
++ecm_query_qt(QT_INSTALL_TRANSLATIONS QT_INSTALL_TRANSLATIONS)
+ 
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/qt6ct-common)
+ 
+diff --git a/src/qt6ct-common/CMakeLists.txt b/src/qt6ct-common/CMakeLists.txt
+index 2afce8d..e121662 100644
+--- a/src/qt6ct-common/CMakeLists.txt
++++ b/src/qt6ct-common/CMakeLists.txt
+@@ -1,29 +1,18 @@
+-project(qt6ct-common)
++block()
++  set(QT6CT_VERSION_MAJOR "${CMAKE_PROJECT_VERSION_MAJOR}")
++  set(QT6CT_VERSION_MINOR "${CMAKE_PROJECT_VERSION_MINOR}")
++  configure_file(config.h.in config.h @ONLY)
++endblock()
+ 
+-#extract version from qt6ct.h
+-file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/qt6ct.h"
+-     QT6CT_VERSION_DATA REGEX "^#define[ \t]+QT6CT_VERSION_[A-Z]+[ \t]+[0-9]+.*$")
+-
+-if(QT6CT_VERSION_DATA)
+-  foreach(item IN ITEMS MAJOR MINOR)
+-    string(REGEX REPLACE ".*#define[ \t]+QT6CT_VERSION_${item}[ \t]+([0-9]+).*"
+-       "\\1" QT6CT_VERSION_${item} ${QT6CT_VERSION_DATA})
+-  endforeach()
+-  set(QT6CT_VERSION "${QT6CT_VERSION_MAJOR}.${QT6CT_VERSION_MINOR}")
+-  set(QT6CT_SOVERSION "${QT6CT_VERSION_MAJOR}")
+-  message(STATUS "qt6ct version: ${QT6CT_VERSION}")
+-else()
+-  message(FATAL_ERROR "invalid header")
+-endif()
+-
+-add_definitions(-DQT6CT_LIBRARY)
+-
+-set(app_SRCS
++set(lib_SRCS
+   qt6ct.cpp
+ )
+ 
+-add_library(qt6ct-common SHARED ${app_SRCS})
+-set_target_properties(qt6ct-common PROPERTIES VERSION ${QT6CT_VERSION})
++add_library(qt6ct-common SHARED ${lib_SRCS})
++set_target_properties(qt6ct-common PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
++target_compile_definitions(qt6ct-common PRIVATE -DQT6CT_LIBRARY -DQT6CT_HAVE_CONFIG_H)
++target_include_directories(qt6ct-common PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
++target_include_directories(qt6ct-common INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
+ target_link_libraries(qt6ct-common PRIVATE Qt6::Gui $<TARGET_NAME_IF_EXISTS:KF6::ConfigCore> $<TARGET_NAME_IF_EXISTS:KF6::ColorScheme>)
+ target_compile_definitions(qt6ct-common PRIVATE $<$<TARGET_EXISTS:KF6::ConfigCore>:KF_CONFIGCORE_LIB> $<$<TARGET_EXISTS:KF6::ColorScheme>:KF_COLORSCHEME_LIB>)
+ install(TARGETS qt6ct-common DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff --git a/src/qt6ct-common/config.h.in b/src/qt6ct-common/config.h.in
+new file mode 100644
+index 0000000..586daa6
+--- /dev/null
++++ b/src/qt6ct-common/config.h.in
+@@ -0,0 +1,37 @@
++/*
++ * Copyright (c) 2014-2024, Ilya Kotov <forkotov02@ya.ru>
++ * Copyright (c) 2023-2024, Zephyr Lykos <self@mochaa.ws>
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are
++ * met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ *
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in
++ *    the documentation and/or other materials provided with the
++ *    distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#ifndef QT6CT_CONFIG_H
++#define QT6CT_CONFIG_H
++
++#cmakedefine QT6CT_VERSION_MAJOR @QT6CT_VERSION_MAJOR@
++#cmakedefine QT6CT_VERSION_MINOR @QT6CT_VERSION_MINOR@
++#cmakedefine01 QT6CT_IN_TREE
++
++#endif
+diff --git a/src/qt6ct-common/qt6ct.cpp b/src/qt6ct-common/qt6ct.cpp
+index 896895d..ec040fc 100644
+--- a/src/qt6ct-common/qt6ct.cpp
++++ b/src/qt6ct-common/qt6ct.cpp
+@@ -40,7 +40,7 @@
+ #endif
+ #include "qt6ct.h"
+ 
+-#ifndef QT6CT_DATADIR
++#if !defined(QT6CT_IN_TREE) && !defined(QT6CT_DATADIR)
+ #define QT6CT_DATADIR "/usr/share"
+ #endif
+ 
+@@ -104,7 +104,9 @@ QStringList Qt6CT::sharedStyleSheetPaths()
+     {
+         paths << (p + QStringLiteral("/qt6ct/qss"));
+     }
++#ifndef QT6CT_IN_TREE
+     paths << QStringLiteral(QT6CT_DATADIR"/qt6ct/qss");
++#endif
+     paths.removeDuplicates();
+     return paths;
+ }
+@@ -129,7 +131,9 @@ QStringList Qt6CT::sharedColorSchemePaths()
+         paths << (p + QStringLiteral("/color-schemes"));
+ #endif
+     }
++#ifndef QT6CT_IN_TREE
+     paths << QStringLiteral(QT6CT_DATADIR"/qt6ct/colors");
++#endif
+     paths.removeDuplicates();
+     return paths;
+ }
+diff --git a/src/qt6ct-common/qt6ct.h b/src/qt6ct-common/qt6ct.h
+index 7d6b283..e16c3c6 100644
+--- a/src/qt6ct-common/qt6ct.h
++++ b/src/qt6ct-common/qt6ct.h
+@@ -29,8 +29,12 @@
+ #ifndef QT6CT_H
+ #define QT6CT_H
+ 
++#ifndef QT6CT_HAVE_CONFIG_H
+ #define QT6CT_VERSION_MAJOR 0
+ #define QT6CT_VERSION_MINOR 11
++#else
++#include "config.h"
++#endif
+ 
+ #define QT6CT_TOSTRING(s) #s
+ #define QT6CT_STRINGIFY(s)         QT6CT_TOSTRING(s)
+diff --git a/src/qt6ct-qtplugin/CMakeLists.txt b/src/qt6ct-qtplugin/CMakeLists.txt
+index e5366ef..d986c7b 100644
+--- a/src/qt6ct-qtplugin/CMakeLists.txt
++++ b/src/qt6ct-qtplugin/CMakeLists.txt
+@@ -1,12 +1,10 @@
+-project(qt6ct-qtplugin)
+-
+-set(app_SRCS
++set(lib_SRCS
+   main.cpp
+   qt6ctplatformtheme.cpp
+ )
+ 
+-add_library(qt6ct-qtplugin MODULE ${app_SRCS})
++add_library(qt6ct-qtplugin MODULE ${lib_SRCS})
+ set_target_properties(qt6ct-qtplugin PROPERTIES OUTPUT_NAME qt6ct)
+ target_link_libraries(qt6ct-qtplugin PRIVATE Qt6::Widgets Qt6::GuiPrivate $<TARGET_NAME_IF_EXISTS:Qt6::QuickControls2> $<TARGET_NAME_IF_EXISTS:KF6::IconThemes> qt6ct-common)
+ target_compile_definitions(qt6ct-qtplugin PRIVATE $<$<TARGET_EXISTS:KF6::IconThemes>:KF_ICONTHEMES_LIB>)
+-install(TARGETS qt6ct-qtplugin DESTINATION ${PLUGINDIR}/platformthemes)
++install(TARGETS qt6ct-qtplugin DESTINATION ${QT_INSTALL_PLUGINS}/platformthemes)
+diff --git a/src/qt6ct-style/CMakeLists.txt b/src/qt6ct-style/CMakeLists.txt
+index 5ab1c21..00c73a1 100644
+--- a/src/qt6ct-style/CMakeLists.txt
++++ b/src/qt6ct-style/CMakeLists.txt
+@@ -1,12 +1,9 @@
+-project(qt6ct-style)
+-
+-add_definitions(-DUSE_WIDGETS)
+-
+-set(app_SRCS
++set(lib_SRCS
+   plugin.cpp
+   qt6ctproxystyle.cpp
+ )
+ 
+-add_library(qt6ct-style MODULE ${app_SRCS})
++add_library(qt6ct-style MODULE ${lib_SRCS})
++target_compile_definitions(qt6ct-style PRIVATE -DUSE_WIDGETS)
+ target_link_libraries(qt6ct-style PRIVATE Qt6::Widgets qt6ct-common)
+-install(TARGETS qt6ct-style DESTINATION ${PLUGINDIR}/styles)
++install(TARGETS qt6ct-style DESTINATION ${QT_INSTALL_PLUGINS}/styles)
+diff --git a/src/qt6ct/CMakeLists.txt b/src/qt6ct/CMakeLists.txt
+index 578f3b0..f0aa070 100644
+--- a/src/qt6ct/CMakeLists.txt
++++ b/src/qt6ct/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-project(app)
++add_subdirectory(translations)
+ 
+ set(app_SRCS
+   appearancepage.cpp
+@@ -26,12 +26,14 @@ set(app_SRCS
+   troubleshootingpage.ui
+ )
+ 
+-if(Qt6LinguistTools_FOUND)
+-    list(APPEND app_SRCS translations/translations.qrc)
+-endif()
+-
+ add_executable(qt6ct ${app_SRCS})
++add_dependencies(qt6ct app_translations)
+ target_link_libraries(qt6ct PRIVATE Qt6::Widgets Qt6::WidgetsPrivate $<TARGET_NAME_IF_EXISTS:KF6::ConfigCore> qt6ct-common)
+ target_compile_definitions(qt6ct PRIVATE $<$<TARGET_EXISTS:KF6::ConfigCore>:KF_CONFIGCORE_LIB> $<$<TARGET_EXISTS:KF6::ColorScheme>:KF_COLORSCHEME_LIB>)
++
++if(NOT QT6CT_IN_TREE)
++  target_link_libraries(qt6ct PRIVATE app_resources)
++endif()
++
+ install(TARGETS qt6ct DESTINATION ${CMAKE_INSTALL_BINDIR})
+ install(FILES qt6ct.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
+diff --git a/src/qt6ct/main.cpp b/src/qt6ct/main.cpp
+index 753aeec..51f6f8d 100644
+--- a/src/qt6ct/main.cpp
++++ b/src/qt6ct/main.cpp
+@@ -42,8 +42,13 @@ int main(int argc, char **argv)
+ 
+     QTranslator translator;
+ 
++#ifndef QT6CT_IN_TREE
+     if(translator.load(QLocale(), QStringLiteral("qt6ct"), QStringLiteral("_"), QStringLiteral(":/")))
+         QCoreApplication::installTranslator(&translator);
++#else
++    if(translator.load(QLocale(), QStringLiteral("qt6ct"), QStringLiteral("_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
++        QCoreApplication::installTranslator(&translator);
++#endif
+ 
+     QTranslator qt_translator;
+     if(qt_translator.load(QLocale(), QStringLiteral("qtbase"), QStringLiteral("_"), QLibraryInfo::path(QLibraryInfo::TranslationsPath)))
+diff --git a/src/qt6ct/translations/CMakeLists.txt b/src/qt6ct/translations/CMakeLists.txt
+new file mode 100644
+index 0000000..2777d3e
+--- /dev/null
++++ b/src/qt6ct/translations/CMakeLists.txt
+@@ -0,0 +1,48 @@
++set(translation_SRCS
++    qt6ct_ar.ts
++    qt6ct_bg.ts
++    qt6ct_ca.ts
++    qt6ct_cs.ts
++    qt6ct_da.ts
++    qt6ct_de.ts
++    qt6ct_el.ts
++    qt6ct_en.ts
++    qt6ct_es_ES.ts
++    qt6ct_es.ts
++    qt6ct_fi.ts
++    qt6ct_fr.ts
++    qt6ct_gl_ES.ts
++    qt6ct_he.ts
++    qt6ct_hu.ts
++    qt6ct_it_IT.ts
++    qt6ct_it.ts
++    qt6ct_ja.ts
++    qt6ct_kk.ts
++    qt6ct_lt.ts
++    qt6ct_nl_NL.ts
++    qt6ct_nl.ts
++    qt6ct_pl.ts
++    qt6ct_pt_BR.ts
++    qt6ct_pt.ts
++    qt6ct_ru.ts
++    qt6ct_sk.ts
++    qt6ct_sr_BA.ts
++    qt6ct_sr_RS.ts
++    qt6ct_sr.ts
++    qt6ct_tr.ts
++    qt6ct_uk.ts
++    qt6ct_zh_CN.ts
++    qt6ct_zh_TW.ts
++)
++
++qt6_add_translation(app_LANGS ${translation_SRCS} OPTIONS -silent)
++set_source_files_properties(${app_LANGS} PROPERTIES GENERATED TRUE)
++add_custom_target(app_translations DEPENDS ${app_LANGS})
++
++if(QT6CT_IN_TREE)
++  install(FILES ${app_LANGS} DESTINATION ${QT_INSTALL_TRANSLATIONS})
++else()
++  configure_file(translations.qrc translations.qrc COPYONLY)
++  qt6_add_resources(lang_RC ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc)
++  add_library(app_resources INTERFACE ${lang_RC})
++endif()
+-- 
+2.51.0
+

diff --git a/9.patch b/9.patch
deleted file mode 100644
index a711763..0000000
--- a/9.patch
+++ /dev/null
@@ -1,609 +0,0 @@
-From 06a58d44f2da5590879ea143006a32e571159561 Mon Sep 17 00:00:00 2001
-From: Ilya Fedin <fedin-ilja2010@ya.ru>
-Date: Mon, 21 Oct 2024 01:55:18 +0400
-Subject: [PATCH 1/4] Use KDE's QtQuick-QtWidgets style bridge
-
----
- CMakeLists.txt                            | 2 +-
- src/qt6ct-qtplugin/CMakeLists.txt         | 2 +-
- src/qt6ct-qtplugin/qt6ctplatformtheme.cpp | 9 +++++++++
- 3 files changed, 11 insertions(+), 2 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 5d8aeae..558ab7e 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -31,7 +31,7 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060200 -DUSE_WIDGETS -DQT_DEPRE
- add_compile_options(-Wall -Wextra)
- include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
- 
--find_package(Qt6 6.2 CONFIG REQUIRED COMPONENTS BuildInternals Core Widgets OPTIONAL_COMPONENTS LinguistTools)
-+find_package(Qt6 6.2 CONFIG REQUIRED COMPONENTS BuildInternals Core Widgets OPTIONAL_COMPONENTS QuickControls2 LinguistTools)
- 
- get_target_property(QT_QTPATHS_EXECUTABLE Qt6::qtpaths IMPORTED_LOCATION)
- 
-diff --git a/src/qt6ct-qtplugin/CMakeLists.txt b/src/qt6ct-qtplugin/CMakeLists.txt
-index 93a2b84..300d993 100644
---- a/src/qt6ct-qtplugin/CMakeLists.txt
-+++ b/src/qt6ct-qtplugin/CMakeLists.txt
-@@ -7,5 +7,5 @@ set(app_SRCS
- 
- add_library(qt6ct-qtplugin MODULE ${app_SRCS})
- set_target_properties(qt6ct-qtplugin PROPERTIES OUTPUT_NAME qt6ct)
--target_link_libraries(qt6ct-qtplugin PRIVATE Qt6::Widgets Qt6::GuiPrivate qt6ct-common)
-+target_link_libraries(qt6ct-qtplugin PRIVATE Qt6::Widgets Qt6::GuiPrivate $<TARGET_NAME_IF_EXISTS:Qt6::QuickControls2> qt6ct-common)
- install(TARGETS qt6ct-qtplugin DESTINATION ${PLUGINDIR}/platformthemes)
-diff --git a/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp b/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp
-index b90c801..cb27d8c 100644
---- a/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp
-+++ b/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp
-@@ -44,6 +44,9 @@
- #endif
- #include <QFile>
- #include <QFileSystemWatcher>
-+#ifdef QT_QUICKCONTROLS2_LIB
-+#include <QQuickStyle>
-+#endif
- #include <private/qiconloader_p.h>
- 
- #include "qt6ct.h"
-@@ -67,6 +70,12 @@ Qt6CTPlatformTheme::Qt6CTPlatformTheme()
-         QMetaObject::invokeMethod(this, &Qt6CTPlatformTheme::createFSWatcher, Qt::QueuedConnection);
- #endif
-         QGuiApplication::setFont(m_generalFont);
-+#if defined QT_WIDGETS_LIB && defined QT_QUICKCONTROLS2_LIB
-+        if(hasWidgets())
-+            //don't override the value explicitly set by the user
-+            if(QQuickStyle::name().isEmpty() || QQuickStyle::name() == QLatin1String("Fusion"))
-+                QQuickStyle::setStyle(QLatin1String("org.kde.desktop"));
-+#endif
-     }
-     qCDebug(lqt6ct) << "using qt6ct plugin";
- #ifdef QT_WIDGETS_LIB
--- 
-GitLab
-
-
-From 91ac3b8efd5f086d127e729617bbf1cc2a9e7bd0 Mon Sep 17 00:00:00 2001
-From: Ilya Fedin <fedin-ilja2010@ya.ru>
-Date: Mon, 21 Oct 2024 02:00:29 +0400
-Subject: [PATCH 2/4] Write widget style and icon theme to kdeglobals
-
-This allows to style applications that use KStyleManager
----
- CMakeLists.txt               |  1 +
- src/qt6ct/CMakeLists.txt     |  3 ++-
- src/qt6ct/appearancepage.cpp | 12 ++++++++++++
- src/qt6ct/appearancepage.h   |  4 ++++
- src/qt6ct/iconthemepage.cpp  | 16 ++++++++++++++++
- src/qt6ct/iconthemepage.h    |  4 ++++
- src/qt6ct/mainwindow.cpp     |  8 ++++++++
- src/qt6ct/tabpage.h          |  8 ++++++++
- 8 files changed, 55 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 558ab7e..0cc9721 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -32,6 +32,7 @@ add_compile_options(-Wall -Wextra)
- include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
- 
- find_package(Qt6 6.2 CONFIG REQUIRED COMPONENTS BuildInternals Core Widgets OPTIONAL_COMPONENTS QuickControls2 LinguistTools)
-+find_package(KF6Config)
- 
- get_target_property(QT_QTPATHS_EXECUTABLE Qt6::qtpaths IMPORTED_LOCATION)
- 
-diff --git a/src/qt6ct/CMakeLists.txt b/src/qt6ct/CMakeLists.txt
-index fb0e1f7..7efe4eb 100644
---- a/src/qt6ct/CMakeLists.txt
-+++ b/src/qt6ct/CMakeLists.txt
-@@ -31,6 +31,7 @@ if(Qt6LinguistTools_FOUND)
- endif()
- 
- add_executable(qt6ct ${app_SRCS})
--target_link_libraries(qt6ct PRIVATE Qt6::Widgets Qt6::WidgetsPrivate qt6ct-common)
-+target_link_libraries(qt6ct PRIVATE Qt6::Widgets Qt6::WidgetsPrivate $<TARGET_NAME_IF_EXISTS:KF6::ConfigCore> qt6ct-common)
-+target_compile_definitions(qt6ct PRIVATE $<$<TARGET_EXISTS:KF6::ConfigCore>:KF_CONFIGCORE_LIB>)
- install(TARGETS qt6ct DESTINATION ${CMAKE_INSTALL_BINDIR})
- install(FILES qt6ct.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
-diff --git a/src/qt6ct/appearancepage.cpp b/src/qt6ct/appearancepage.cpp
-index 2f1faf8..0745b16 100644
---- a/src/qt6ct/appearancepage.cpp
-+++ b/src/qt6ct/appearancepage.cpp
-@@ -35,6 +35,9 @@
- #include <QMenu>
- #include <QIcon>
- #include <QStringList>
-+#ifdef KF_CONFIGCORE_LIB
-+#include <KConfigGroup>
-+#endif
- #include <qpa/qplatformthemefactory_p.h>
- #include <qpa/qplatformtheme.h>
- #include "qt6ct.h"
-@@ -126,6 +129,15 @@ void AppearancePage::writeSettings(QSettings *settings)
-     settings->endGroup();
- }
- 
-+#ifdef KF_CONFIGCORE_LIB
-+void AppearancePage::writeSettings(KSharedConfigPtr config)
-+{
-+    KConfigGroup group(config, "KDE");
-+    group.writeEntry("widgetStyle", "qt6ct-style");
-+    group.sync();
-+}
-+#endif
-+
- void AppearancePage::on_styleComboBox_textActivated(const QString &text)
- {
-     QStyle *style = QStyleFactory::create(text);
-diff --git a/src/qt6ct/appearancepage.h b/src/qt6ct/appearancepage.h
-index e196b62..31c26c6 100644
---- a/src/qt6ct/appearancepage.h
-+++ b/src/qt6ct/appearancepage.h
-@@ -49,6 +49,10 @@ public:
- 
-     void writeSettings(QSettings *settings) override;
- 
-+#ifdef KF_CONFIGCORE_LIB
-+    void writeSettings(KSharedConfigPtr config) override;
-+#endif
-+
- private slots:
-     void on_styleComboBox_textActivated(const QString &text);
-     void on_colorSchemeComboBox_activated(int);
-diff --git a/src/qt6ct/iconthemepage.cpp b/src/qt6ct/iconthemepage.cpp
-index 37960f9..9156116 100644
---- a/src/qt6ct/iconthemepage.cpp
-+++ b/src/qt6ct/iconthemepage.cpp
-@@ -34,6 +34,9 @@
- #include <QProgressBar>
- #include <QMetaObject>
- #include <QThread>
-+#ifdef KF_CONFIGCORE_LIB
-+#include <KConfigGroup>
-+#endif
- #include "qt6ct.h"
- #include "iconthemepage.h"
- #include "ui_iconthemepage.h"
-@@ -71,6 +74,19 @@ void IconThemePage::writeSettings(QSettings *settings)
-         settings->setValue("Appearance/icon_theme"_L1, item->data(3, Qt::UserRole));
- }
- 
-+#ifdef KF_CONFIGCORE_LIB
-+void IconThemePage::writeSettings(KSharedConfigPtr config)
-+{
-+    QTreeWidgetItem *item = m_ui->treeWidget->currentItem();
-+    if(!item)
-+        return;
-+
-+    KConfigGroup group(config, "Icons");
-+    group.writeEntry("Theme", item->data(3, Qt::UserRole));
-+    group.sync();
-+}
-+#endif
-+
- void IconThemePage::onFinished()
- {
-     m_ui->treeWidget->addTopLevelItems(m_items);
-diff --git a/src/qt6ct/iconthemepage.h b/src/qt6ct/iconthemepage.h
-index 8938671..9ad3580 100644
---- a/src/qt6ct/iconthemepage.h
-+++ b/src/qt6ct/iconthemepage.h
-@@ -51,6 +51,10 @@ public:
- 
-     void writeSettings(QSettings *settings) override;
- 
-+#ifdef KF_CONFIGCORE_LIB
-+    void writeSettings(KSharedConfigPtr config) override;
-+#endif
-+
- private slots:
-     void onFinished();
- 
-diff --git a/src/qt6ct/mainwindow.cpp b/src/qt6ct/mainwindow.cpp
-index 122dff2..10296a4 100644
---- a/src/qt6ct/mainwindow.cpp
-+++ b/src/qt6ct/mainwindow.cpp
-@@ -91,11 +91,19 @@ void MainWindow::on_buttonBox_clicked(QAbstractButton *button)
-     if(id == QDialogButtonBox::Ok || id == QDialogButtonBox::Apply)
-     {
-         QSettings settings(Qt6CT::configFile(), QSettings::IniFormat);
-+#ifdef KF_CONFIGCORE_LIB
-+        KSharedConfigPtr config = KSharedConfig::openConfig("kdeglobals");
-+#endif
-         for(int i = 0; i < m_ui->tabWidget->count(); ++i)
-         {
-             TabPage *p = qobject_cast<TabPage*>(m_ui->tabWidget->widget(i));
-             if(p)
-+            {
-                 p->writeSettings(&settings);
-+#ifdef KF_CONFIGCORE_LIB
-+                p->writeSettings(config);
-+#endif
-+            }
-         }
-     }
- 
-diff --git a/src/qt6ct/tabpage.h b/src/qt6ct/tabpage.h
-index c77b5a7..4e46ddd 100644
---- a/src/qt6ct/tabpage.h
-+++ b/src/qt6ct/tabpage.h
-@@ -32,6 +32,10 @@
- #include <QWidget>
- #include <QSettings>
- 
-+#ifdef KF_CONFIGCORE_LIB
-+#include <KSharedConfig>
-+#endif
-+
- class TabPage : public QWidget
- {
-     Q_OBJECT
-@@ -39,6 +43,10 @@ public:
-     explicit TabPage(QWidget *parent = nullptr);
- 
-     virtual void writeSettings(QSettings *settings) = 0;
-+
-+#ifdef KF_CONFIGCORE_LIB
-+    virtual void writeSettings(KSharedConfigPtr config) {}
-+#endif
- };
- 
- #endif // TABPAGE_H
--- 
-GitLab
-
-
-From ee837c42fff5771504d6213f53878549f731ea51 Mon Sep 17 00:00:00 2001
-From: Ilya Fedin <fedin-ilja2010@ya.ru>
-Date: Mon, 21 Oct 2024 01:47:18 +0400
-Subject: [PATCH 3/4] Add KDE color schemes support
-
----
- CMakeLists.txt                            |  1 +
- src/qt6ct-common/CMakeLists.txt           |  3 ++-
- src/qt6ct-common/qt6ct.cpp                | 17 +++++++++++++++
- src/qt6ct-common/qt6ct.h                  |  1 +
- src/qt6ct-qtplugin/qt6ctplatformtheme.cpp | 26 +++++++++++++++++++++++
- src/qt6ct-qtplugin/qt6ctplatformtheme.h   |  5 ++++-
- src/qt6ct/CMakeLists.txt                  |  2 +-
- src/qt6ct/appearancepage.cpp              | 22 ++++++++++++++++---
- src/qt6ct/appearancepage.h                |  2 +-
- 9 files changed, 72 insertions(+), 7 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 0cc9721..b18a42e 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -33,6 +33,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
- 
- find_package(Qt6 6.2 CONFIG REQUIRED COMPONENTS BuildInternals Core Widgets OPTIONAL_COMPONENTS QuickControls2 LinguistTools)
- find_package(KF6Config)
-+find_package(KF6ColorScheme)
- 
- get_target_property(QT_QTPATHS_EXECUTABLE Qt6::qtpaths IMPORTED_LOCATION)
- 
-diff --git a/src/qt6ct-common/CMakeLists.txt b/src/qt6ct-common/CMakeLists.txt
-index 3b9f0b9..2afce8d 100644
---- a/src/qt6ct-common/CMakeLists.txt
-+++ b/src/qt6ct-common/CMakeLists.txt
-@@ -24,5 +24,6 @@ set(app_SRCS
- 
- add_library(qt6ct-common SHARED ${app_SRCS})
- set_target_properties(qt6ct-common PROPERTIES VERSION ${QT6CT_VERSION})
--target_link_libraries(qt6ct-common PRIVATE Qt6::Gui)
-+target_link_libraries(qt6ct-common PRIVATE Qt6::Gui $<TARGET_NAME_IF_EXISTS:KF6::ConfigCore> $<TARGET_NAME_IF_EXISTS:KF6::ColorScheme>)
-+target_compile_definitions(qt6ct-common PRIVATE $<$<TARGET_EXISTS:KF6::ConfigCore>:KF_CONFIGCORE_LIB> $<$<TARGET_EXISTS:KF6::ColorScheme>:KF_COLORSCHEME_LIB>)
- install(TARGETS qt6ct-common DESTINATION ${CMAKE_INSTALL_LIBDIR})
-diff --git a/src/qt6ct-common/qt6ct.cpp b/src/qt6ct-common/qt6ct.cpp
-index 616440b..896895d 100644
---- a/src/qt6ct-common/qt6ct.cpp
-+++ b/src/qt6ct-common/qt6ct.cpp
-@@ -34,6 +34,10 @@
- #include <QFile>
- #include <QSettings>
- #include <QtDebug>
-+#if defined KF_CONFIGCORE_LIB && defined KF_COLORSCHEME_LIB
-+#include <KSharedConfig>
-+#include <KColorScheme>
-+#endif
- #include "qt6ct.h"
- 
- #ifndef QT6CT_DATADIR
-@@ -121,6 +125,9 @@ QStringList Qt6CT::sharedColorSchemePaths()
-     for(const QString &p : QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation))
-     {
-         paths << (p + QStringLiteral("/qt6ct/colors"));
-+#if defined KF_CONFIGCORE_LIB && defined KF_COLORSCHEME_LIB
-+        paths << (p + QStringLiteral("/color-schemes"));
-+#endif
-     }
-     paths << QStringLiteral(QT6CT_DATADIR"/qt6ct/colors");
-     paths.removeDuplicates();
-@@ -148,8 +155,18 @@ QString Qt6CT::resolvePath(const QString &path)
-     return tmp;
- }
- 
-+bool Qt6CT::isKColorScheme(const QString &filePath)
-+{
-+    return filePath.toLower().endsWith(".colors");
-+}
-+
- QPalette Qt6CT::loadColorScheme(const QString &filePath, const QPalette &fallback)
- {
-+#if defined KF_CONFIGCORE_LIB && defined KF_COLORSCHEME_LIB
-+    if(isKColorScheme(filePath))
-+        return KColorScheme::createApplicationPalette(KSharedConfig::openConfig(filePath));
-+#endif
-+
-     QPalette customPalette;
-     QSettings settings(filePath, QSettings::IniFormat);
-     settings.beginGroup("ColorScheme"_L1);
-diff --git a/src/qt6ct-common/qt6ct.h b/src/qt6ct-common/qt6ct.h
-index f253987..7d6b283 100644
---- a/src/qt6ct-common/qt6ct.h
-+++ b/src/qt6ct-common/qt6ct.h
-@@ -101,6 +101,7 @@ public:
-     static QString styleColorSchemeFile();
-     static QStringList sharedColorSchemePaths();
-     static QString resolvePath(const QString &path);
-+    static bool isKColorScheme(const QString &filePath);
-     static QPalette loadColorScheme(const QString &filePath, const QPalette &fallback);
- 
-     static void registerStyleInstance(StyleInstance *instance);
-diff --git a/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp b/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp
-index cb27d8c..f43a29b 100644
---- a/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp
-+++ b/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp
-@@ -70,6 +70,9 @@ Qt6CTPlatformTheme::Qt6CTPlatformTheme()
-         QMetaObject::invokeMethod(this, &Qt6CTPlatformTheme::createFSWatcher, Qt::QueuedConnection);
- #endif
-         QGuiApplication::setFont(m_generalFont);
-+        //must be applied before Q_COREAPP_STARTUP_FUNCTION execution
-+        if(Qt6CT::isKColorScheme(m_schemePath))
-+            qApp->setProperty("KDE_COLOR_SCHEME_PATH", m_schemePath);
- #if defined QT_WIDGETS_LIB && defined QT_QUICKCONTROLS2_LIB
-         if(hasWidgets())
-             //don't override the value explicitly set by the user
-@@ -82,6 +85,7 @@ Qt6CTPlatformTheme::Qt6CTPlatformTheme()
-     if(!QStyleFactory::keys().contains(u"qt6ct-style"_s))
-         qCCritical(lqt6ct) << "unable to find qt6ct proxy style";
- #endif
-+    QCoreApplication::instance()->installEventFilter(this);
- }
- 
- Qt6CTPlatformTheme::~Qt6CTPlatformTheme()
-@@ -167,6 +171,11 @@ void Qt6CTPlatformTheme::applySettings()
- 
-     QGuiApplication::setFont(m_generalFont); //apply font
- 
-+    if(Qt6CT::isKColorScheme(m_schemePath))
-+        qApp->setProperty("KDE_COLOR_SCHEME_PATH", m_schemePath);
-+    else if(m_update)
-+        qApp->setProperty("KDE_COLOR_SCHEME_PATH", QVariant());
-+
- #ifdef QT_WIDGETS_LIB
-     if(hasWidgets())
-     {
-@@ -243,6 +252,8 @@ void Qt6CTPlatformTheme::updateSettings()
- 
- void Qt6CTPlatformTheme::readSettings()
- {
-+    m_schemePath.clear();
-+
-     QSettings settings(Qt6CT::configFile(), QSettings::IniFormat);
- 
-     settings.beginGroup("Appearance"_L1);
-@@ -252,6 +263,7 @@ void Qt6CTPlatformTheme::readSettings()
-     if(!schemePath.isEmpty() && settings.value("custom_palette"_L1, false).toBool())
-     {
-         schemePath = Qt6CT::resolvePath(schemePath); //replace environment variables
-+        m_schemePath = schemePath;
-         m_palette = Qt6CT::loadColorScheme(schemePath, m_palette);
-     }
-     m_iconTheme = settings.value("icon_theme"_L1).toString();
-@@ -361,3 +373,17 @@ QString Qt6CTPlatformTheme::loadStyleSheets(const QStringList &paths)
-     content.replace(regExp, u"\n"_s);
-     return content;
- }
-+
-+//There's such a thing as KColorSchemeManager that lets the user to change the color scheme
-+//application-wide and we should re-apply the color scheme if KCSM resets it to the default
-+//which leads KColorScheme to get the color scheme from kdeglobals which won't help us.
-+bool Qt6CTPlatformTheme::eventFilter(QObject *obj, QEvent *e)
-+{
-+    if(obj == qApp &&
-+            e->type() == QEvent::DynamicPropertyChange &&
-+            static_cast<QDynamicPropertyChangeEvent*>(e)->propertyName() == "KDE_COLOR_SCHEME_PATH" &&
-+            qApp->property("KDE_COLOR_SCHEME_PATH").toString().isEmpty() &&
-+            Qt6CT::isKColorScheme(m_schemePath))
-+        applySettings();
-+    return QObject::eventFilter(obj, e);
-+}
-diff --git a/src/qt6ct-qtplugin/qt6ctplatformtheme.h b/src/qt6ct-qtplugin/qt6ctplatformtheme.h
-index 5312a64..80ac0a4 100644
---- a/src/qt6ct-qtplugin/qt6ctplatformtheme.h
-+++ b/src/qt6ct-qtplugin/qt6ctplatformtheme.h
-@@ -66,6 +66,9 @@ public:
-     //virtual QList<QKeySequence> keyBindings(QKeySequence::StandardKey key) const;
-     //virtual QString standardButtonText(int button) const;
- 
-+protected:
-+    bool eventFilter(QObject *obj, QEvent *e) override;
-+
- private slots:
-     void applySettings();
- #ifdef QT_WIDGETS_LIB
-@@ -79,7 +82,7 @@ private:
-     bool hasWidgets();
- #endif
-     QString loadStyleSheets(const QStringList &paths);
--    QString m_style, m_iconTheme, m_userStyleSheet, m_prevStyleSheet;
-+    QString m_style, m_schemePath, m_iconTheme, m_userStyleSheet, m_prevStyleSheet;
-     QPalette m_palette;
-     QFont m_generalFont, m_fixedFont;
-     int m_doubleClickInterval;
-diff --git a/src/qt6ct/CMakeLists.txt b/src/qt6ct/CMakeLists.txt
-index 7efe4eb..578f3b0 100644
---- a/src/qt6ct/CMakeLists.txt
-+++ b/src/qt6ct/CMakeLists.txt
-@@ -32,6 +32,6 @@ endif()
- 
- add_executable(qt6ct ${app_SRCS})
- target_link_libraries(qt6ct PRIVATE Qt6::Widgets Qt6::WidgetsPrivate $<TARGET_NAME_IF_EXISTS:KF6::ConfigCore> qt6ct-common)
--target_compile_definitions(qt6ct PRIVATE $<$<TARGET_EXISTS:KF6::ConfigCore>:KF_CONFIGCORE_LIB>)
-+target_compile_definitions(qt6ct PRIVATE $<$<TARGET_EXISTS:KF6::ConfigCore>:KF_CONFIGCORE_LIB> $<$<TARGET_EXISTS:KF6::ColorScheme>:KF_COLORSCHEME_LIB>)
- install(TARGETS qt6ct DESTINATION ${CMAKE_INSTALL_BINDIR})
- install(FILES qt6ct.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
-diff --git a/src/qt6ct/appearancepage.cpp b/src/qt6ct/appearancepage.cpp
-index 0745b16..09f753a 100644
---- a/src/qt6ct/appearancepage.cpp
-+++ b/src/qt6ct/appearancepage.cpp
-@@ -73,7 +73,7 @@ AppearancePage::AppearancePage(QWidget *parent) :
-     QMenu *menu = new QMenu(this);
-     menu->addAction(QIcon::fromTheme(u"document-new"_s), tr("Create"), this, qOverload<>(&AppearancePage::createColorScheme));
-     m_changeColorSchemeAction = menu->addAction(QIcon::fromTheme(u"accessories-text-editor"_s), tr("Edit"), this, &AppearancePage::changeColorScheme);
--    menu->addAction(QIcon::fromTheme(u"edit-copy"_s), tr("Create a Copy"), this, &AppearancePage::copyColorScheme);
-+    m_copyColorSchemeAction = menu->addAction(QIcon::fromTheme(u"edit-copy"_s), tr("Create a Copy"), this, &AppearancePage::copyColorScheme);
-     m_renameColorSchemeAction = menu->addAction(tr("Rename"), this, &AppearancePage::renameColorScheme);
-     menu->addSeparator();
-     m_removeColorSchemeAction = menu->addAction(QIcon::fromTheme(u"edit-delete"_s), tr("Remove"), this, &AppearancePage::removeColorScheme);
-@@ -345,6 +345,7 @@ void AppearancePage::setPreviewPalette(const QPalette &p)
- 
- void AppearancePage::updateActions()
- {
-+    m_copyColorSchemeAction->setVisible(!Qt6CT::isKColorScheme(m_ui->colorSchemeComboBox->currentData().toString()));
-     if(m_ui->colorSchemeComboBox->count() == 0 ||
-             !QFileInfo(m_ui->colorSchemeComboBox->currentData().toString()).isWritable())
-     {
-@@ -440,11 +441,26 @@ void AppearancePage::findColorSchemes(const QString &path)
- {
-     QDir dir(path);
-     dir.setFilter(QDir::Files);
--    dir.setNameFilters({ u"*.conf"_s });
-+    QStringList nameFilters;
-+    nameFilters << u"*.conf"_s;
-+#if defined KF_CONFIGCORE_LIB && defined KF_COLORSCHEME_LIB
-+    nameFilters << u"*.colors"_s;
-+#endif
-+    dir.setNameFilters(nameFilters);
- 
-     for(const QFileInfo &info : dir.entryInfoList())
-     {
--        m_ui->colorSchemeComboBox->addItem(info.baseName(), info.filePath());
-+        QString name = info.baseName();
-+        QString path = info.filePath();
-+#if defined KF_CONFIGCORE_LIB && defined KF_COLORSCHEME_LIB
-+        if(Qt6CT::isKColorScheme(path))
-+        {
-+            KSharedConfigPtr config = KSharedConfig::openConfig(path, KConfig::SimpleConfig);
-+            KConfigGroup group(config, "General");
-+            name = group.readEntry("Name", name) + " (KColorScheme)";
-+        }
-+#endif
-+        m_ui->colorSchemeComboBox->addItem(name, path);
-     }
- }
- 
-diff --git a/src/qt6ct/appearancepage.h b/src/qt6ct/appearancepage.h
-index 31c26c6..8e4902e 100644
---- a/src/qt6ct/appearancepage.h
-+++ b/src/qt6ct/appearancepage.h
-@@ -77,7 +77,7 @@ private:
-     QStyle *m_selectedStyle = nullptr;
-     QPalette m_customPalette;
-     QWidget *m_previewWidget;
--    QAction *m_changeColorSchemeAction, *m_renameColorSchemeAction, *m_removeColorSchemeAction;
-+    QAction *m_changeColorSchemeAction, *m_copyColorSchemeAction, *m_renameColorSchemeAction, *m_removeColorSchemeAction;
-     Ui::PreviewForm *m_previewUi;
- };
- 
--- 
-GitLab
-
-
-From 6fa66ca94f1f8fa5119ad6669d5e3547f4077c1c Mon Sep 17 00:00:00 2001
-From: Ilya Fedin <fedin-ilja2010@ya.ru>
-Date: Mon, 21 Oct 2024 01:58:02 +0400
-Subject: [PATCH 4/4] Use KDE's icon engine
-
-It has KDE color schemes support that prevents dark icons on dark background
----
- CMakeLists.txt                            |  1 +
- src/qt6ct-qtplugin/CMakeLists.txt         |  3 ++-
- src/qt6ct-qtplugin/qt6ctplatformtheme.cpp | 12 ++++++++++++
- src/qt6ct-qtplugin/qt6ctplatformtheme.h   |  4 +++-
- 4 files changed, 18 insertions(+), 2 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index b18a42e..0d88aeb 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -34,6 +34,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
- find_package(Qt6 6.2 CONFIG REQUIRED COMPONENTS BuildInternals Core Widgets OPTIONAL_COMPONENTS QuickControls2 LinguistTools)
- find_package(KF6Config)
- find_package(KF6ColorScheme)
-+find_package(KF6IconThemes)
- 
- get_target_property(QT_QTPATHS_EXECUTABLE Qt6::qtpaths IMPORTED_LOCATION)
- 
-diff --git a/src/qt6ct-qtplugin/CMakeLists.txt b/src/qt6ct-qtplugin/CMakeLists.txt
-index 300d993..e5366ef 100644
---- a/src/qt6ct-qtplugin/CMakeLists.txt
-+++ b/src/qt6ct-qtplugin/CMakeLists.txt
-@@ -7,5 +7,6 @@ set(app_SRCS
- 
- add_library(qt6ct-qtplugin MODULE ${app_SRCS})
- set_target_properties(qt6ct-qtplugin PROPERTIES OUTPUT_NAME qt6ct)
--target_link_libraries(qt6ct-qtplugin PRIVATE Qt6::Widgets Qt6::GuiPrivate $<TARGET_NAME_IF_EXISTS:Qt6::QuickControls2> qt6ct-common)
-+target_link_libraries(qt6ct-qtplugin PRIVATE Qt6::Widgets Qt6::GuiPrivate $<TARGET_NAME_IF_EXISTS:Qt6::QuickControls2> $<TARGET_NAME_IF_EXISTS:KF6::IconThemes> qt6ct-common)
-+target_compile_definitions(qt6ct-qtplugin PRIVATE $<$<TARGET_EXISTS:KF6::IconThemes>:KF_ICONTHEMES_LIB>)
- install(TARGETS qt6ct-qtplugin DESTINATION ${PLUGINDIR}/platformthemes)
-diff --git a/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp b/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp
-index f43a29b..cfcc9ec 100644
---- a/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp
-+++ b/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp
-@@ -55,6 +55,11 @@
- #include <QStringList>
- #include <qpa/qplatformthemefactory_p.h>
- 
-+#ifdef KF_ICONTHEMES_LIB
-+#include <KIconEngine>
-+#include <KIconLoader>
-+#endif
-+
- Q_LOGGING_CATEGORY(lqt6ct, "qt6ct", QtWarningMsg)
- 
- //QT_QPA_PLATFORMTHEME=qt6ct
-@@ -161,6 +166,13 @@ QIcon Qt6CTPlatformTheme::fileIcon(const QFileInfo &fileInfo, QPlatformTheme::Ic
-     return QIcon::fromTheme(type.iconName());
- }
- 
-+#ifdef KF_ICONTHEMES_LIB
-+QIconEngine *Qt6CTPlatformTheme::createIconEngine(const QString &iconName) const
-+{
-+    return new KIconEngine(iconName, KIconLoader::global());
-+}
-+#endif
-+
- void Qt6CTPlatformTheme::applySettings()
- {
-     if(!QGuiApplication::desktopSettingsAware() || m_isIgnored)
-diff --git a/src/qt6ct-qtplugin/qt6ctplatformtheme.h b/src/qt6ct-qtplugin/qt6ctplatformtheme.h
-index 80ac0a4..db66d33 100644
---- a/src/qt6ct-qtplugin/qt6ctplatformtheme.h
-+++ b/src/qt6ct-qtplugin/qt6ctplatformtheme.h
-@@ -62,7 +62,9 @@ public:
-     //virtual QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size,
-     //                               QPlatformTheme::IconOptions iconOptions = 0) const;
- 
--    //virtual QIconEngine *createIconEngine(const QString &iconName) const;
-+#ifdef KF_ICONTHEMES_LIB
-+    virtual QIconEngine *createIconEngine(const QString &iconName) const override;
-+#endif
-     //virtual QList<QKeySequence> keyBindings(QKeySequence::StandardKey key) const;
-     //virtual QString standardButtonText(int button) const;
- 
--- 
-GitLab
-

diff --git a/qt6ct-kde.patch b/qt6ct-kde.patch
new file mode 100644
index 0000000..5985258
--- /dev/null
+++ b/qt6ct-kde.patch
@@ -0,0 +1,448 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5d8aeae..0d88aeb 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -31,7 +31,10 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060200 -DUSE_WIDGETS -DQT_DEPRE
+ add_compile_options(-Wall -Wextra)
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
+ 
+-find_package(Qt6 6.2 CONFIG REQUIRED COMPONENTS BuildInternals Core Widgets OPTIONAL_COMPONENTS LinguistTools)
++find_package(Qt6 6.2 CONFIG REQUIRED COMPONENTS BuildInternals Core Widgets OPTIONAL_COMPONENTS QuickControls2 LinguistTools)
++find_package(KF6Config)
++find_package(KF6ColorScheme)
++find_package(KF6IconThemes)
+ 
+ get_target_property(QT_QTPATHS_EXECUTABLE Qt6::qtpaths IMPORTED_LOCATION)
+ 
+diff --git a/src/qt6ct-common/CMakeLists.txt b/src/qt6ct-common/CMakeLists.txt
+index 3b9f0b9..2afce8d 100644
+--- a/src/qt6ct-common/CMakeLists.txt
++++ b/src/qt6ct-common/CMakeLists.txt
+@@ -24,5 +24,6 @@ set(app_SRCS
+ 
+ add_library(qt6ct-common SHARED ${app_SRCS})
+ set_target_properties(qt6ct-common PROPERTIES VERSION ${QT6CT_VERSION})
+-target_link_libraries(qt6ct-common PRIVATE Qt6::Gui)
++target_link_libraries(qt6ct-common PRIVATE Qt6::Gui $<TARGET_NAME_IF_EXISTS:KF6::ConfigCore> $<TARGET_NAME_IF_EXISTS:KF6::ColorScheme>)
++target_compile_definitions(qt6ct-common PRIVATE $<$<TARGET_EXISTS:KF6::ConfigCore>:KF_CONFIGCORE_LIB> $<$<TARGET_EXISTS:KF6::ColorScheme>:KF_COLORSCHEME_LIB>)
+ install(TARGETS qt6ct-common DESTINATION ${CMAKE_INSTALL_LIBDIR})
+diff --git a/src/qt6ct-common/qt6ct.cpp b/src/qt6ct-common/qt6ct.cpp
+index 616440b..896895d 100644
+--- a/src/qt6ct-common/qt6ct.cpp
++++ b/src/qt6ct-common/qt6ct.cpp
+@@ -34,6 +34,10 @@
+ #include <QFile>
+ #include <QSettings>
+ #include <QtDebug>
++#if defined KF_CONFIGCORE_LIB && defined KF_COLORSCHEME_LIB
++#include <KSharedConfig>
++#include <KColorScheme>
++#endif
+ #include "qt6ct.h"
+ 
+ #ifndef QT6CT_DATADIR
+@@ -121,6 +125,9 @@ QStringList Qt6CT::sharedColorSchemePaths()
+     for(const QString &p : QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation))
+     {
+         paths << (p + QStringLiteral("/qt6ct/colors"));
++#if defined KF_CONFIGCORE_LIB && defined KF_COLORSCHEME_LIB
++        paths << (p + QStringLiteral("/color-schemes"));
++#endif
+     }
+     paths << QStringLiteral(QT6CT_DATADIR"/qt6ct/colors");
+     paths.removeDuplicates();
+@@ -148,8 +155,18 @@ QString Qt6CT::resolvePath(const QString &path)
+     return tmp;
+ }
+ 
++bool Qt6CT::isKColorScheme(const QString &filePath)
++{
++    return filePath.toLower().endsWith(".colors");
++}
++
+ QPalette Qt6CT::loadColorScheme(const QString &filePath, const QPalette &fallback)
+ {
++#if defined KF_CONFIGCORE_LIB && defined KF_COLORSCHEME_LIB
++    if(isKColorScheme(filePath))
++        return KColorScheme::createApplicationPalette(KSharedConfig::openConfig(filePath));
++#endif
++
+     QPalette customPalette;
+     QSettings settings(filePath, QSettings::IniFormat);
+     settings.beginGroup("ColorScheme"_L1);
+diff --git a/src/qt6ct-common/qt6ct.h b/src/qt6ct-common/qt6ct.h
+index f253987..7d6b283 100644
+--- a/src/qt6ct-common/qt6ct.h
++++ b/src/qt6ct-common/qt6ct.h
+@@ -101,6 +101,7 @@ public:
+     static QString styleColorSchemeFile();
+     static QStringList sharedColorSchemePaths();
+     static QString resolvePath(const QString &path);
++    static bool isKColorScheme(const QString &filePath);
+     static QPalette loadColorScheme(const QString &filePath, const QPalette &fallback);
+ 
+     static void registerStyleInstance(StyleInstance *instance);
+diff --git a/src/qt6ct-qtplugin/CMakeLists.txt b/src/qt6ct-qtplugin/CMakeLists.txt
+index 93a2b84..e5366ef 100644
+--- a/src/qt6ct-qtplugin/CMakeLists.txt
++++ b/src/qt6ct-qtplugin/CMakeLists.txt
+@@ -7,5 +7,6 @@ set(app_SRCS
+ 
+ add_library(qt6ct-qtplugin MODULE ${app_SRCS})
+ set_target_properties(qt6ct-qtplugin PROPERTIES OUTPUT_NAME qt6ct)
+-target_link_libraries(qt6ct-qtplugin PRIVATE Qt6::Widgets Qt6::GuiPrivate qt6ct-common)
++target_link_libraries(qt6ct-qtplugin PRIVATE Qt6::Widgets Qt6::GuiPrivate $<TARGET_NAME_IF_EXISTS:Qt6::QuickControls2> $<TARGET_NAME_IF_EXISTS:KF6::IconThemes> qt6ct-common)
++target_compile_definitions(qt6ct-qtplugin PRIVATE $<$<TARGET_EXISTS:KF6::IconThemes>:KF_ICONTHEMES_LIB>)
+ install(TARGETS qt6ct-qtplugin DESTINATION ${PLUGINDIR}/platformthemes)
+diff --git a/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp b/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp
+index fb5c748..3ed3c64 100644
+--- a/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp
++++ b/src/qt6ct-qtplugin/qt6ctplatformtheme.cpp
+@@ -44,6 +44,9 @@
+ #endif
+ #include <QFile>
+ #include <QFileSystemWatcher>
++#ifdef QT_QUICKCONTROLS2_LIB
++#include <QQuickStyle>
++#endif
+ #include <private/qiconloader_p.h>
+ 
+ #include "qt6ct.h"
+@@ -52,6 +55,11 @@
+ #include <QStringList>
+ #include <qpa/qplatformthemefactory_p.h>
+ 
++#ifdef KF_ICONTHEMES_LIB
++#include <KIconEngine>
++#include <KIconLoader>
++#endif
++
+ Q_LOGGING_CATEGORY(lqt6ct, "qt6ct", QtWarningMsg)
+ 
+ //QT_QPA_PLATFORMTHEME=qt6ct
+@@ -67,12 +75,22 @@ Qt6CTPlatformTheme::Qt6CTPlatformTheme()
+         QMetaObject::invokeMethod(this, &Qt6CTPlatformTheme::createFSWatcher, Qt::QueuedConnection);
+ #endif
+         QGuiApplication::setFont(m_generalFont);
++        //must be applied before Q_COREAPP_STARTUP_FUNCTION execution
++        if(Qt6CT::isKColorScheme(m_schemePath))
++            qApp->setProperty("KDE_COLOR_SCHEME_PATH", m_schemePath);
++#if defined QT_WIDGETS_LIB && defined QT_QUICKCONTROLS2_LIB
++        if(hasWidgets())
++            //don't override the value explicitly set by the user
++            if(QQuickStyle::name().isEmpty() || QQuickStyle::name() == QLatin1String("Fusion"))
++                QQuickStyle::setStyle(QLatin1String("org.kde.desktop"));
++#endif
+     }
+     qCDebug(lqt6ct) << "using qt6ct plugin";
+ #ifdef QT_WIDGETS_LIB
+     if(!QStyleFactory::keys().contains(u"qt6ct-style"_s))
+         qCCritical(lqt6ct) << "unable to find qt6ct proxy style";
+ #endif
++    QCoreApplication::instance()->installEventFilter(this);
+ }
+ 
+ Qt6CTPlatformTheme::~Qt6CTPlatformTheme()
+@@ -148,6 +166,13 @@ QIcon Qt6CTPlatformTheme::fileIcon(const QFileInfo &fileInfo, QPlatformTheme::Ic
+     return QIcon::fromTheme(type.iconName());
+ }
+ 
++#ifdef KF_ICONTHEMES_LIB
++QIconEngine *Qt6CTPlatformTheme::createIconEngine(const QString &iconName) const
++{
++    return new KIconEngine(iconName, KIconLoader::global());
++}
++#endif
++
+ void Qt6CTPlatformTheme::applySettings()
+ {
+     if(!QGuiApplication::desktopSettingsAware() || m_isIgnored)
+@@ -158,6 +183,11 @@ void Qt6CTPlatformTheme::applySettings()
+ 
+     QGuiApplication::setFont(m_generalFont); //apply font
+ 
++    if(Qt6CT::isKColorScheme(m_schemePath))
++        qApp->setProperty("KDE_COLOR_SCHEME_PATH", m_schemePath);
++    else if(m_update)
++        qApp->setProperty("KDE_COLOR_SCHEME_PATH", QVariant());
++
+ #ifdef QT_WIDGETS_LIB
+     if(hasWidgets())
+     {
+@@ -234,6 +264,8 @@ void Qt6CTPlatformTheme::updateSettings()
+ 
+ void Qt6CTPlatformTheme::readSettings()
+ {
++    m_schemePath.clear();
++
+     QSettings settings(Qt6CT::configFile(), QSettings::IniFormat);
+ 
+     settings.beginGroup("Appearance"_L1);
+@@ -243,6 +275,7 @@ void Qt6CTPlatformTheme::readSettings()
+     if(!schemePath.isEmpty() && settings.value("custom_palette"_L1, false).toBool())
+     {
+         schemePath = Qt6CT::resolvePath(schemePath); //replace environment variables
++        m_schemePath = schemePath;
+         m_palette = Qt6CT::loadColorScheme(schemePath, m_palette);
+     }
+     m_iconTheme = settings.value("icon_theme"_L1).toString();
+@@ -354,3 +387,17 @@ QString Qt6CTPlatformTheme::loadStyleSheets(const QStringList &paths)
+     content.replace(regExp, u"\n"_s);
+     return content;
+ }
++
++//There's such a thing as KColorSchemeManager that lets the user to change the color scheme
++//application-wide and we should re-apply the color scheme if KCSM resets it to the default
++//which leads KColorScheme to get the color scheme from kdeglobals which won't help us.
++bool Qt6CTPlatformTheme::eventFilter(QObject *obj, QEvent *e)
++{
++    if(obj == qApp &&
++            e->type() == QEvent::DynamicPropertyChange &&
++            static_cast<QDynamicPropertyChangeEvent*>(e)->propertyName() == "KDE_COLOR_SCHEME_PATH" &&
++            qApp->property("KDE_COLOR_SCHEME_PATH").toString().isEmpty() &&
++            Qt6CT::isKColorScheme(m_schemePath))
++        applySettings();
++    return QObject::eventFilter(obj, e);
++}
+diff --git a/src/qt6ct-qtplugin/qt6ctplatformtheme.h b/src/qt6ct-qtplugin/qt6ctplatformtheme.h
+index b2a7bcf..f0a4ac7 100644
+--- a/src/qt6ct-qtplugin/qt6ctplatformtheme.h
++++ b/src/qt6ct-qtplugin/qt6ctplatformtheme.h
+@@ -66,10 +66,15 @@ public:
+     //virtual QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size,
+     //                               QPlatformTheme::IconOptions iconOptions = 0) const;
+ 
+-    //virtual QIconEngine *createIconEngine(const QString &iconName) const;
++#ifdef KF_ICONTHEMES_LIB
++    virtual QIconEngine *createIconEngine(const QString &iconName) const override;
++#endif
+     //virtual QList<QKeySequence> keyBindings(QKeySequence::StandardKey key) const;
+     //virtual QString standardButtonText(int button) const;
+ 
++protected:
++    bool eventFilter(QObject *obj, QEvent *e) override;
++
+ private slots:
+     void applySettings();
+ #ifdef QT_WIDGETS_LIB
+@@ -83,7 +88,7 @@ private:
+     bool hasWidgets();
+ #endif
+     QString loadStyleSheets(const QStringList &paths);
+-    QString m_style, m_iconTheme, m_userStyleSheet, m_prevStyleSheet;
++    QString m_style, m_schemePath, m_iconTheme, m_userStyleSheet, m_prevStyleSheet;
+     QPalette m_palette;
+     QFont m_generalFont, m_fixedFont;
+     int m_doubleClickInterval;
+diff --git a/src/qt6ct/CMakeLists.txt b/src/qt6ct/CMakeLists.txt
+index fb0e1f7..578f3b0 100644
+--- a/src/qt6ct/CMakeLists.txt
++++ b/src/qt6ct/CMakeLists.txt
+@@ -31,6 +31,7 @@ if(Qt6LinguistTools_FOUND)
+ endif()
+ 
+ add_executable(qt6ct ${app_SRCS})
+-target_link_libraries(qt6ct PRIVATE Qt6::Widgets Qt6::WidgetsPrivate qt6ct-common)
++target_link_libraries(qt6ct PRIVATE Qt6::Widgets Qt6::WidgetsPrivate $<TARGET_NAME_IF_EXISTS:KF6::ConfigCore> qt6ct-common)
++target_compile_definitions(qt6ct PRIVATE $<$<TARGET_EXISTS:KF6::ConfigCore>:KF_CONFIGCORE_LIB> $<$<TARGET_EXISTS:KF6::ColorScheme>:KF_COLORSCHEME_LIB>)
+ install(TARGETS qt6ct DESTINATION ${CMAKE_INSTALL_BINDIR})
+ install(FILES qt6ct.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
+diff --git a/src/qt6ct/appearancepage.cpp b/src/qt6ct/appearancepage.cpp
+index 2f1faf8..09f753a 100644
+--- a/src/qt6ct/appearancepage.cpp
++++ b/src/qt6ct/appearancepage.cpp
+@@ -35,6 +35,9 @@
+ #include <QMenu>
+ #include <QIcon>
+ #include <QStringList>
++#ifdef KF_CONFIGCORE_LIB
++#include <KConfigGroup>
++#endif
+ #include <qpa/qplatformthemefactory_p.h>
+ #include <qpa/qplatformtheme.h>
+ #include "qt6ct.h"
+@@ -70,7 +73,7 @@ AppearancePage::AppearancePage(QWidget *parent) :
+     QMenu *menu = new QMenu(this);
+     menu->addAction(QIcon::fromTheme(u"document-new"_s), tr("Create"), this, qOverload<>(&AppearancePage::createColorScheme));
+     m_changeColorSchemeAction = menu->addAction(QIcon::fromTheme(u"accessories-text-editor"_s), tr("Edit"), this, &AppearancePage::changeColorScheme);
+-    menu->addAction(QIcon::fromTheme(u"edit-copy"_s), tr("Create a Copy"), this, &AppearancePage::copyColorScheme);
++    m_copyColorSchemeAction = menu->addAction(QIcon::fromTheme(u"edit-copy"_s), tr("Create a Copy"), this, &AppearancePage::copyColorScheme);
+     m_renameColorSchemeAction = menu->addAction(tr("Rename"), this, &AppearancePage::renameColorScheme);
+     menu->addSeparator();
+     m_removeColorSchemeAction = menu->addAction(QIcon::fromTheme(u"edit-delete"_s), tr("Remove"), this, &AppearancePage::removeColorScheme);
+@@ -126,6 +129,15 @@ void AppearancePage::writeSettings(QSettings *settings)
+     settings->endGroup();
+ }
+ 
++#ifdef KF_CONFIGCORE_LIB
++void AppearancePage::writeSettings(KSharedConfigPtr config)
++{
++    KConfigGroup group(config, "KDE");
++    group.writeEntry("widgetStyle", "qt6ct-style");
++    group.sync();
++}
++#endif
++
+ void AppearancePage::on_styleComboBox_textActivated(const QString &text)
+ {
+     QStyle *style = QStyleFactory::create(text);
+@@ -333,6 +345,7 @@ void AppearancePage::setPreviewPalette(const QPalette &p)
+ 
+ void AppearancePage::updateActions()
+ {
++    m_copyColorSchemeAction->setVisible(!Qt6CT::isKColorScheme(m_ui->colorSchemeComboBox->currentData().toString()));
+     if(m_ui->colorSchemeComboBox->count() == 0 ||
+             !QFileInfo(m_ui->colorSchemeComboBox->currentData().toString()).isWritable())
+     {
+@@ -428,11 +441,26 @@ void AppearancePage::findColorSchemes(const QString &path)
+ {
+     QDir dir(path);
+     dir.setFilter(QDir::Files);
+-    dir.setNameFilters({ u"*.conf"_s });
++    QStringList nameFilters;
++    nameFilters << u"*.conf"_s;
++#if defined KF_CONFIGCORE_LIB && defined KF_COLORSCHEME_LIB
++    nameFilters << u"*.colors"_s;
++#endif
++    dir.setNameFilters(nameFilters);
+ 
+     for(const QFileInfo &info : dir.entryInfoList())
+     {
+-        m_ui->colorSchemeComboBox->addItem(info.baseName(), info.filePath());
++        QString name = info.baseName();
++        QString path = info.filePath();
++#if defined KF_CONFIGCORE_LIB && defined KF_COLORSCHEME_LIB
++        if(Qt6CT::isKColorScheme(path))
++        {
++            KSharedConfigPtr config = KSharedConfig::openConfig(path, KConfig::SimpleConfig);
++            KConfigGroup group(config, "General");
++            name = group.readEntry("Name", name) + " (KColorScheme)";
++        }
++#endif
++        m_ui->colorSchemeComboBox->addItem(name, path);
+     }
+ }
+ 
+diff --git a/src/qt6ct/appearancepage.h b/src/qt6ct/appearancepage.h
+index e196b62..8e4902e 100644
+--- a/src/qt6ct/appearancepage.h
++++ b/src/qt6ct/appearancepage.h
+@@ -49,6 +49,10 @@ public:
+ 
+     void writeSettings(QSettings *settings) override;
+ 
++#ifdef KF_CONFIGCORE_LIB
++    void writeSettings(KSharedConfigPtr config) override;
++#endif
++
+ private slots:
+     void on_styleComboBox_textActivated(const QString &text);
+     void on_colorSchemeComboBox_activated(int);
+@@ -73,7 +77,7 @@ private:
+     QStyle *m_selectedStyle = nullptr;
+     QPalette m_customPalette;
+     QWidget *m_previewWidget;
+-    QAction *m_changeColorSchemeAction, *m_renameColorSchemeAction, *m_removeColorSchemeAction;
++    QAction *m_changeColorSchemeAction, *m_copyColorSchemeAction, *m_renameColorSchemeAction, *m_removeColorSchemeAction;
+     Ui::PreviewForm *m_previewUi;
+ };
+ 
+diff --git a/src/qt6ct/iconthemepage.cpp b/src/qt6ct/iconthemepage.cpp
+index 37960f9..9156116 100644
+--- a/src/qt6ct/iconthemepage.cpp
++++ b/src/qt6ct/iconthemepage.cpp
+@@ -34,6 +34,9 @@
+ #include <QProgressBar>
+ #include <QMetaObject>
+ #include <QThread>
++#ifdef KF_CONFIGCORE_LIB
++#include <KConfigGroup>
++#endif
+ #include "qt6ct.h"
+ #include "iconthemepage.h"
+ #include "ui_iconthemepage.h"
+@@ -71,6 +74,19 @@ void IconThemePage::writeSettings(QSettings *settings)
+         settings->setValue("Appearance/icon_theme"_L1, item->data(3, Qt::UserRole));
+ }
+ 
++#ifdef KF_CONFIGCORE_LIB
++void IconThemePage::writeSettings(KSharedConfigPtr config)
++{
++    QTreeWidgetItem *item = m_ui->treeWidget->currentItem();
++    if(!item)
++        return;
++
++    KConfigGroup group(config, "Icons");
++    group.writeEntry("Theme", item->data(3, Qt::UserRole));
++    group.sync();
++}
++#endif
++
+ void IconThemePage::onFinished()
+ {
+     m_ui->treeWidget->addTopLevelItems(m_items);
+diff --git a/src/qt6ct/iconthemepage.h b/src/qt6ct/iconthemepage.h
+index 8938671..9ad3580 100644
+--- a/src/qt6ct/iconthemepage.h
++++ b/src/qt6ct/iconthemepage.h
+@@ -51,6 +51,10 @@ public:
+ 
+     void writeSettings(QSettings *settings) override;
+ 
++#ifdef KF_CONFIGCORE_LIB
++    void writeSettings(KSharedConfigPtr config) override;
++#endif
++
+ private slots:
+     void onFinished();
+ 
+diff --git a/src/qt6ct/mainwindow.cpp b/src/qt6ct/mainwindow.cpp
+index 122dff2..10296a4 100644
+--- a/src/qt6ct/mainwindow.cpp
++++ b/src/qt6ct/mainwindow.cpp
+@@ -91,11 +91,19 @@ void MainWindow::on_buttonBox_clicked(QAbstractButton *button)
+     if(id == QDialogButtonBox::Ok || id == QDialogButtonBox::Apply)
+     {
+         QSettings settings(Qt6CT::configFile(), QSettings::IniFormat);
++#ifdef KF_CONFIGCORE_LIB
++        KSharedConfigPtr config = KSharedConfig::openConfig("kdeglobals");
++#endif
+         for(int i = 0; i < m_ui->tabWidget->count(); ++i)
+         {
+             TabPage *p = qobject_cast<TabPage*>(m_ui->tabWidget->widget(i));
+             if(p)
++            {
+                 p->writeSettings(&settings);
++#ifdef KF_CONFIGCORE_LIB
++                p->writeSettings(config);
++#endif
++            }
+         }
+     }
+ 
+diff --git a/src/qt6ct/tabpage.h b/src/qt6ct/tabpage.h
+index c77b5a7..4e46ddd 100644
+--- a/src/qt6ct/tabpage.h
++++ b/src/qt6ct/tabpage.h
+@@ -32,6 +32,10 @@
+ #include <QWidget>
+ #include <QSettings>
+ 
++#ifdef KF_CONFIGCORE_LIB
++#include <KSharedConfig>
++#endif
++
+ class TabPage : public QWidget
+ {
+     Q_OBJECT
+@@ -39,6 +43,10 @@ public:
+     explicit TabPage(QWidget *parent = nullptr);
+ 
+     virtual void writeSettings(QSettings *settings) = 0;
++
++#ifdef KF_CONFIGCORE_LIB
++    virtual void writeSettings(KSharedConfigPtr config) {}
++#endif
+ };
+ 
+ #endif // TABPAGE_H

diff --git a/qt6ct.spec b/qt6ct.spec
index ce7f7ae..e073f12 100644
--- a/qt6ct.spec
+++ b/qt6ct.spec
@@ -14,18 +14,24 @@ URL:     %{forgeurl}
 
 Source0: %{forgesource}
 # https://www.opencode.net/trialuser/qt6ct/-/merge_requests/9
-Patch:   https://www.opencode.net/trialuser/qt6ct/-/merge_requests/9.patch
+Patch0:  qt6ct-kde.patch
+Patch1:  0001-build-refactor-CMake-build-rules.patch
 
 BuildRequires: cmake
+BuildRequires: extra-cmake-modules
+
+BuildRequires: desktop-file-utils
 BuildRequires: gcc-c++
-BuildRequires: qt6-rpm-macros >= %{version}
-BuildRequires: qt6-qtbase-devel
+BuildRequires: cmake(Qt6Core)
+BuildRequires: cmake(Qt6Widgets)
+BuildRequires: cmake(Qt6QuickControls2)
+BuildRequires: cmake(Qt6LinguistTools)
 BuildRequires: qt6-qtbase-private-devel
-BuildRequires: qt6-qtdeclarative-devel
-BuildRequires: qt6-linguist
-BuildRequires: kf6-kiconthemes-devel
-BuildRequires: kf6-kconfig-devel
-BuildRequires: desktop-file-utils
+BuildRequires: cmake(KF6Config)
+BuildRequires: cmake(KF6ColorScheme)
+BuildRequires: cmake(KF6IconThemes)
+
+%{?_qt6:Requires: %{_qt6}%{?_isa} = %{_qt6_version}}
 
 %description
 This program allows users to configure Qt6 settings (theme, font, icons, etc.)
@@ -36,7 +42,7 @@ under DE/WM without Qt integration.
 
 
 %build
-%cmake
+%cmake -DQT6CT_IN_TREE=ON
 %cmake_build
 
 %install
@@ -48,17 +54,51 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop
 %files
 %doc AUTHORS README.md ChangeLog
 %license COPYING
+%lang(en) %{_qt6_translationdir}/qt6ct_en.qm
+%lang(ru) %{_qt6_translationdir}/qt6ct_ru.qm
+%lang(zh_CN) %{_qt6_translationdir}/qt6ct_zh_CN.qm
+%lang(zh_TW) %{_qt6_translationdir}/qt6ct_zh_TW.qm
+%lang(tr) %{_qt6_translationdir}/qt6ct_tr.qm
+%lang(cs) %{_qt6_translationdir}/qt6ct_cs.qm
+%lang(pt_BR) %{_qt6_translationdir}/qt6ct_pt_BR.qm
+%lang(pt) %{_qt6_translationdir}/qt6ct_pt.qm
+%lang(de) %{_qt6_translationdir}/qt6ct_de.qm
+%lang(pl) %{_qt6_translationdir}/qt6ct_pl.qm
+%lang(fr) %{_qt6_translationdir}/qt6ct_fr.qm
+%lang(it) %{_qt6_translationdir}/qt6ct_it.qm
+%lang(it_IT) %{_qt6_translationdir}/qt6ct_it_IT.qm
+%lang(kk) %{_qt6_translationdir}/qt6ct_kk.qm
+%lang(lt) %{_qt6_translationdir}/qt6ct_lt.qm
+%lang(hu) %{_qt6_translationdir}/qt6ct_hu.qm
+%lang(nl) %{_qt6_translationdir}/qt6ct_nl.qm
+%lang(ja) %{_qt6_translationdir}/qt6ct_ja.qm
+%lang(sk) %{_qt6_translationdir}/qt6ct_sk.qm
+%lang(es_ES) %{_qt6_translationdir}/qt6ct_es_ES.qm
+%lang(es) %{_qt6_translationdir}/qt6ct_es.qm
+%lang(he) %{_qt6_translationdir}/qt6ct_he.qm
+%lang(gl_ES) %{_qt6_translationdir}/qt6ct_gl_ES.qm
+%lang(sr_BA) %{_qt6_translationdir}/qt6ct_sr_BA.qm
+%lang(sr_RS) %{_qt6_translationdir}/qt6ct_sr_RS.qm
+%lang(bg) %{_qt6_translationdir}/qt6ct_bg.qm
+%lang(nl_NL) %{_qt6_translationdir}/qt6ct_nl_NL.qm
+%lang(el) %{_qt6_translationdir}/qt6ct_el.qm
+%lang(sr) %{_qt6_translationdir}/qt6ct_sr.qm
+%lang(ca) %{_qt6_translationdir}/qt6ct_ca.qm
+%lang(ar) %{_qt6_translationdir}/qt6ct_ar.qm
+%lang(da) %{_qt6_translationdir}/qt6ct_da.qm
+%lang(uk) %{_qt6_translationdir}/qt6ct_uk.qm
+%lang(fi) %{_qt6_translationdir}/qt6ct_fi.qm
 %{_bindir}/%{name}
-%{_qt6_plugindir}/platformthemes/libqt6ct.so
-%{_qt6_plugindir}/styles/libqt6ct-style.so
 %{_datadir}/applications/%{name}.desktop
 %dir %{_datadir}/%{name}/
 %dir %{_datadir}/%{name}/colors/
 %{_datadir}/%{name}/colors/*.conf
 %dir %{_datadir}/%{name}/qss/
 %{_datadir}/%{name}/qss/*.qss
-%{_libdir}/libqt6ct-common.so
-%{_libdir}/libqt6ct-common.so.%{version}*
+%exclude %{_libdir}/libqt6ct-common.so
+%{_libdir}/libqt6ct-common.so.%{version}
+%{_qt6_plugindir}/platformthemes/libqt6ct.so
+%{_qt6_plugindir}/styles/libqt6ct-style.so
 
 %changelog
 %autochangelog

                 reply	other threads:[~2026-10-08 20:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179148995900.1.12054578863483471025.rpms-qt6ct-334aa5c492e1@fedoraproject.org \
    --to=git@mochaa.ws \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox