Package Details: qt5ct-kde 1.8-15

Git Clone URL: https://aur.archlinux.org/qt5ct-kde.git (read-only, click to copy)
Package Base: qt5ct-kde
Description: Qt5 Configuration Utility, patched to work correctly with KDE applications
Upstream URL: https://qt5ct.sourceforge.io/
Licenses: BSD
Conflicts: qt5ct
Provides: qt5ct
Submitter: ilya-fedin
Maintainer: ilya-fedin
Last Packager: ilya-fedin
Votes: 20
Popularity: 0.83
First Submitted: 2021-07-11 08:02 (UTC)
Last Updated: 2024-10-25 18:56 (UTC)

Dependencies (3)

Required by (9)

Sources (2)

Pinned Comments

ilya-fedin commented on 2025-02-17 06:27 (UTC) (edited on 2025-02-17 06:28 (UTC) by ilya-fedin)

Looks like it's over, Plasma 5 is removed from the repos. Now the only things possible to do are to remove the package somehow (how? I don't see such a button) or to wait, maybe someone will re-package the deps in the AUR.

ilya-fedin commented on 2021-07-11 08:04 (UTC) (edited on 2025-03-04 14:40 (UTC) by ilya-fedin)

Some user guide:

My patchset contains multiple fixes/features in comparison to vanilla qt5ct:

  1. KDE color schemes support
  2. KDE QML applications theming support
  3. KDE's icon engine is used, fixing monochrome icons colors (I saw problems with e.g. Adapta Kvantum theme on KDE applications toolbars, like dolphin, they're grey when should be white)

It's important to set a KDE color scheme (marked as (KColorScheme) in the list) for proper theming of KDE apps.

Additionally, if one wants KDE dialogs, this could be reached either with plasma-integration or xdg-desktop-portal (both work with vanilla qt5ct, too).

To get them with plasma-integration:

  1. Install plasma-integration
  2. Choose KDE as standard dialogs in qt5ct configurator

To get them with xdg-desktop-portal-kde:

  1. Install xdg-desktop-portal + xdg-desktop-portal-kde
  2. Configure xdg-desktop-portal's FileChooser to kde, see https://wiki.archlinux.org/title/XDG_Desktop_Portal#Configuration
  3. Ensure that session dbus instance is running correctly
  4. Choose XDG Desktop Portal as standard dialogs in qt5ct configurator

How to ensure that session dbus instance is running correctly when using xinit (DMs should already do the right thing for you):

  1. Ensure you don't have dbus-launch nor dbus-session-run in .xinitrc
  2. Ensure you copied the for f in /etc/X11/xinit/xinitrc.d/?*.sh loop from /etc/X11/xinit/xinitrc to your .xinitrc
  3. Ensure you have no errors in systemctl --user status dbus and the service is running. You shouldn't enable the service, it should be activated by dbus.socket.

In case of Wayland, you may need to integrate your WM with systemd (that's what one of the scripts in /etc/X11/xinit/xinitrc.d does for X11): https://github.com/swaywm/sway/wiki#gtk-applications-take-20-seconds-to-start

Latest Comments

« First ‹ Previous 1 2 3 4

q234rty commented on 2023-03-15 17:19 (UTC)

FWIW, here's the rebased patch onto 1.6:

diff -Naur qt5ct-1.6/CMakeLists.txt qt5ct-kde-1.6/CMakeLists.txt
--- qt5ct-1.6/CMakeLists.txt    2023-02-26 16:39:25.000000000 +0000
+++ qt5ct-kde-1.6/CMakeLists.txt    2023-03-12 18:31:39.766040816 +0000
@@ -25,8 +25,11 @@

 ADD_DEFINITIONS(-DQT_DISABLE_DEPRECATED_BEFORE=0x050C00 -DUSE_WIDGETS)

-find_package(Qt5 ${QT_MINIMUM_VERSION} COMPONENTS Widgets Concurrent LinguistTools DBus ThemeSupport REQUIRED)
+find_package(Qt5 ${QT_MINIMUM_VERSION} COMPONENTS Widgets Concurrent LinguistTools DBus QuickControls2 ThemeSupport REQUIRED)
 find_package(Qt5Gui ${QT_MINIMUM_VERSION} CONFIG REQUIRED Private)
+find_package(KF5Config REQUIRED)
+find_package(KF5ConfigWidgets REQUIRED)
+find_package(KF5IconThemes REQUIRED)

 get_target_property(QT_LRELEASE_EXECUTABLE Qt5::lrelease IMPORTED_LOCATION)

@@ -45,7 +48,9 @@
     message(FATAL_ERROR "Could NOT find qtpaths executable")
 endif()

-execute_process(COMMAND ${QT_QTPATHS_EXECUTABLE} --plugin-dir OUTPUT_VARIABLE PLUGINDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
+if(NOT PLUGINDIR)
+    execute_process(COMMAND ${QT_QTPATHS_EXECUTABLE} --plugin-dir OUTPUT_VARIABLE PLUGINDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
 message(STATUS "Plugin path: " ${PLUGINDIR})

 message(STATUS "Generating translations ...")
diff -Naur qt5ct-1.6/src/qt5ct/appearancepage.cpp qt5ct-kde-1.6/src/qt5ct/appearancepage.cpp
--- qt5ct-1.6/src/qt5ct/appearancepage.cpp  2023-02-26 16:39:25.000000000 +0000
+++ qt5ct-kde-1.6/src/qt5ct/appearancepage.cpp  2023-03-12 18:41:38.195132763 +0000
@@ -378,7 +378,7 @@
 {
     QDir dir(path);
     dir.setFilter(QDir::Files);
-    dir.setNameFilters(QStringList() << "*.conf");
+    dir.setNameFilters(QStringList() << "*.conf" << "*.colors");

     for(const QFileInfo &info : dir.entryInfoList())
     {
diff -Naur qt5ct-1.6/src/qt5ct-common/qt5ct.cpp qt5ct-kde-1.6/src/qt5ct-common/qt5ct.cpp
--- qt5ct-1.6/src/qt5ct-common/qt5ct.cpp    2023-02-26 16:39:25.000000000 +0000
+++ qt5ct-kde-1.6/src/qt5ct-common/qt5ct.cpp    2023-03-12 18:37:10.842983985 +0000
@@ -112,6 +112,7 @@
     for(const QString &p : QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation))
     {
         paths << (p + QLatin1String("/qt5ct/colors"));
+        paths << (p + QLatin1String("/color-schemes"));
     }
     paths << QLatin1String(QT5CT_DATADIR"/qt5ct/colors");
     paths.removeDuplicates();
diff -Naur qt5ct-1.6/src/qt5ct-qtplugin/CMakeLists.txt qt5ct-kde-1.6/src/qt5ct-qtplugin/CMakeLists.txt
--- qt5ct-1.6/src/qt5ct-qtplugin/CMakeLists.txt 2023-02-26 16:39:25.000000000 +0000
+++ qt5ct-kde-1.6/src/qt5ct-qtplugin/CMakeLists.txt 2023-03-12 18:38:42.957051979 +0000
@@ -9,5 +9,5 @@

 add_library(qt5ct-qtplugin MODULE ${app_SRCS})
 set_target_properties(qt5ct-qtplugin PROPERTIES OUTPUT_NAME qt5ct)
-target_link_libraries(qt5ct-qtplugin PRIVATE Qt5::Widgets Qt5::GuiPrivate Qt5::DBus Qt5::ThemeSupportPrivate qt5ct-common)
+target_link_libraries(qt5ct-qtplugin PRIVATE Qt5::Widgets Qt5::GuiPrivate Qt5::DBus Qt5::QuickControls2 Qt5::ThemeSupportPrivate qt5ct-common KF5::ConfigCore KF5::ConfigWidgets KF5::IconThemes)
 install(TARGETS qt5ct-qtplugin DESTINATION ${PLUGINDIR}/platformthemes)
diff -Naur qt5ct-1.6/src/qt5ct-qtplugin/qt5ctplatformtheme.cpp qt5ct-kde-1.6/src/qt5ct-qtplugin/qt5ctplatformtheme.cpp
--- qt5ct-1.6/src/qt5ct-qtplugin/qt5ctplatformtheme.cpp 2023-02-26 16:39:25.000000000 +0000
+++ qt5ct-kde-1.6/src/qt5ct-qtplugin/qt5ctplatformtheme.cpp 2023-03-12 18:37:10.846317482 +0000
@@ -45,6 +45,7 @@
 #endif
 #include <QFile>
 #include <QFileSystemWatcher>
+#include <QQuickStyle>

 #include "qt5ct.h"
 #include "qt5ctplatformtheme.h"
@@ -58,6 +59,11 @@
 #include <QStringList>
 #include <qpa/qplatformthemefactory_p.h>

+#include <ksharedconfig.h>
+#include <kcolorscheme.h>
+#include <kiconengine.h>
+#include <kiconloader.h>
+
 Q_LOGGING_CATEGORY(lqt5ct, "qt5ct", QtWarningMsg)

 //QT_QPA_PLATFORMTHEME=qt5ct
@@ -73,12 +79,17 @@
         QMetaObject::invokeMethod(this, "createFSWatcher", Qt::QueuedConnection);
 #endif
         QGuiApplication::setFont(m_generalFont);
+        //if the user has explicitly set something else, don't meddle
+        if (QQuickStyle::name().isEmpty()) {
+            QQuickStyle::setStyle(QLatin1String("org.kde.desktop"));
+        }
     }
     qCDebug(lqt5ct) << "using qt5ct plugin";
 #ifdef QT_WIDGETS_LIB
     if(!QStyleFactory::keys().contains("qt5ct-style"))
         qCCritical(lqt5ct) << "unable to find qt5ct proxy style";
 #endif
+   QCoreApplication::instance()->installEventFilter(this);
 }

 Qt5CTPlatformTheme::~Qt5CTPlatformTheme()
@@ -185,6 +196,11 @@
 }
 #endif

+QIconEngine *Qt5CTPlatformTheme::createIconEngine(const QString &iconName) const
+{
+    return new KIconEngine(iconName, KIconLoader::global());
+}
+
 void Qt5CTPlatformTheme::applySettings()
 {
     if(!QGuiApplication::desktopSettingsAware() || m_isIgnored)
@@ -299,7 +315,15 @@
     if(!schemePath.isEmpty() && settings.value("custom_palette", false).toBool())
     {
         schemePath = Qt5CT::resolvePath(schemePath); //replace environment variables
-        m_palette = new QPalette(loadColorScheme(schemePath));
+        if(schemePath.endsWith(".colors"))
+        {
+            m_palette = new QPalette(KColorScheme::createApplicationPalette(KSharedConfig::openConfig(schemePath)));
+            qApp->setProperty("KDE_COLOR_SCHEME_PATH", schemePath);
+        }
+        else
+        {
+            m_palette = new QPalette(loadColorScheme(schemePath));
+        }
     }
     m_iconTheme = settings.value("icon_theme").toString();
     //load dialogs
@@ -464,3 +488,30 @@

     return customPalette;
 }
+
+bool Qt5CTPlatformTheme::eventFilter(QObject *obj, QEvent *e)
+{
+    if(obj == qApp && e->type() == QEvent::DynamicPropertyChange)
+    {
+        QDynamicPropertyChangeEvent *ee = static_cast<QDynamicPropertyChangeEvent*>(e);
+        if(ee->propertyName() == "KDE_COLOR_SCHEME_PATH")
+        {
+            if(qApp->property("KDE_COLOR_SCHEME_PATH").isNull())
+            {
+                QSettings settings(Qt5CT::configFile(), QSettings::IniFormat);
+                settings.beginGroup("Appearance");
+                QString schemePath = settings.value("color_scheme_path").toString();
+                if(!schemePath.isEmpty() && settings.value("custom_palette", false).toBool())
+                {
+                    schemePath = Qt5CT::resolvePath(schemePath); //replace environment variables
+                    if(schemePath.endsWith(".colors"))
+                    {
+                        qApp->setProperty("KDE_COLOR_SCHEME_PATH", schemePath);
+                        applySettings();
+                    }
+                }
+            }
+        }
+    }
+    return QObject::eventFilter(obj, e);
+}
diff -Naur qt5ct-1.6/src/qt5ct-qtplugin/qt5ctplatformtheme.h qt5ct-kde-1.6/src/qt5ct-qtplugin/qt5ctplatformtheme.h
--- qt5ct-1.6/src/qt5ct-qtplugin/qt5ctplatformtheme.h   2023-02-26 16:39:25.000000000 +0000
+++ qt5ct-kde-1.6/src/qt5ct-qtplugin/qt5ctplatformtheme.h   2023-03-12 18:37:10.846317482 +0000
@@ -87,10 +87,13 @@
     //virtual QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size,
     //                               QPlatformTheme::IconOptions iconOptions = 0) const;

-    //virtual QIconEngine *createIconEngine(const QString &iconName) const;
+    virtual QIconEngine *createIconEngine(const QString &iconName) const;
     //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

TheKarion commented on 2023-02-27 20:56 (UTC)

Not out of date, package is the only proper working version of qt5ct

ilya-fedin commented on 2022-09-12 16:19 (UTC)

Would be nice to get stack trace

DroidFreak32 commented on 2022-09-11 10:52 (UTC)

While this works great on non KDE environments, it seems to break KDE itself in some cases.

Ex running systemsettings5:

Using fontconfig file: "/home/horcrux/.config/fontconfig/fonts.conf"
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/mailto" not found
kf.coreaddons: "Could not load plugin from kcm_kaccounts: The shared library was not found."
kf.coreaddons: "Could not load plugin from kcm_kscreen: The shared library was not found."
kf.coreaddons: "Could not load plugin from kcm_pulseaudio: The shared library was not found."
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
file:///usr/lib/qt/qml/org/kde/kirigami.2/ScrollablePage.qml:189:9: QML MouseArea: Binding loop detected for property "width"
QQmlEngine::setContextForObject(): Object already has a QQmlContext
[1]    41752 segmentation fault (core dumped)  systemsettings5

UN-setting QT_QPA_PLATFORMTHEME works, however, this isn't needed in the vanilla qt5ct package (which instead messes up the font and colors)

Kaos_Bunny commented on 2022-02-07 23:22 (UTC) (edited on 2022-02-07 23:33 (UTC) by Kaos_Bunny)

For adding the file to NoExtract in pacman.conf (as mentioned in the pinned comment), is this a hard requirement (what will happen if it's not done), and am I doing this correctly?

NoExtract = usr/share/xdg-desktop-portal/portals/zz-gtk.portal

Also, for the session dbus check, I'm getting this error but it's still active (triggered by dbus.socket). Is this okay?

digital_mystik commented on 2021-09-05 18:21 (UTC)

this package is awesome! I have been exporting KDE as my DE in sway but it was messing with a few things, and vanilla qt5ct couldn't match my regular setup; really glad I stumbled upon this

yochananmarqos commented on 2021-07-11 16:51 (UTC)

This should provide and conflict with qt5ct.

ilya-fedin commented on 2021-07-11 08:04 (UTC) (edited on 2025-03-04 14:40 (UTC) by ilya-fedin)

Some user guide:

My patchset contains multiple fixes/features in comparison to vanilla qt5ct:

  1. KDE color schemes support
  2. KDE QML applications theming support
  3. KDE's icon engine is used, fixing monochrome icons colors (I saw problems with e.g. Adapta Kvantum theme on KDE applications toolbars, like dolphin, they're grey when should be white)

It's important to set a KDE color scheme (marked as (KColorScheme) in the list) for proper theming of KDE apps.

Additionally, if one wants KDE dialogs, this could be reached either with plasma-integration or xdg-desktop-portal (both work with vanilla qt5ct, too).

To get them with plasma-integration:

  1. Install plasma-integration
  2. Choose KDE as standard dialogs in qt5ct configurator

To get them with xdg-desktop-portal-kde:

  1. Install xdg-desktop-portal + xdg-desktop-portal-kde
  2. Configure xdg-desktop-portal's FileChooser to kde, see https://wiki.archlinux.org/title/XDG_Desktop_Portal#Configuration
  3. Ensure that session dbus instance is running correctly
  4. Choose XDG Desktop Portal as standard dialogs in qt5ct configurator

How to ensure that session dbus instance is running correctly when using xinit (DMs should already do the right thing for you):

  1. Ensure you don't have dbus-launch nor dbus-session-run in .xinitrc
  2. Ensure you copied the for f in /etc/X11/xinit/xinitrc.d/?*.sh loop from /etc/X11/xinit/xinitrc to your .xinitrc
  3. Ensure you have no errors in systemctl --user status dbus and the service is running. You shouldn't enable the service, it should be activated by dbus.socket.

In case of Wayland, you may need to integrate your WM with systemd (that's what one of the scripts in /etc/X11/xinit/xinitrc.d does for X11): https://github.com/swaywm/sway/wiki#gtk-applications-take-20-seconds-to-start