How to get Kate to respect qt6ct window color theme again

I obviously do not use plasma as the title suggests. I have set:

export QT_QPA_PLATFORMTHEME=qt6ct

And have a custom color scheme located at ~/.config/qt6ct/colors/Darkgrey.conf.

Kate has settings -> application style -> qt6ct set. Before, I had settings -> window color scheme -> default set which seemed to select this color scheme but after what seems to be the frameworks update to 6.9.0 this default option now seems to select the breeze light option. Thus leaving only two options, breeze dark and breeze light. QT6CT also has many other themes aside from my custom one in it, none selectable in that list.

On top of that:

$ strace kate --new --block  2>&1 | grep -E colors/Darkgrey.conf
access("/home/user/.config/qt6ct/colors/Darkgrey.conf", F_OK) = 0
openat(AT_FDCWD, "/home/user/.config/qt6ct/colors/Darkgrey.conf", O_RDONLY|O_CLOEXEC) = 8
statx(AT_FDCWD, "/home/user/.config/qt6ct/colors/Darkgrey.conf", AT_STATX_SYNC_AS_STAT|AT_NO_AUTOMOUNT, STATX_ALL, {stx_mask=STATX_ALL|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFREG|0644, stx_size=783, ...}) = 0

Does suggest it is aware of and opens the file, but it doesn’t use it as the color theme either.

Hi! The details at these links are a bit over my head, but some of the comments on the following issues in the KDE Bugtracking System might provide some leads?

This seems to be related by the bug I’m affected by. The thread implies that Kate never respected qt6ct in the first place (what’s even the point then?) but I’m fairly certain it did before a recent update and when selecting “default” as the “window color scheme” it would follow it. The way I read this thread, Kate would really only have two options of colors, “Breeze Light” and “Breeze Dark”. I can’t imagine that that was actually intentional so maybe it was misworded.

In case anyone else later come across this thread. This is what is going on and how to solve it. It turns out it’s a feature, not a bug caused by that kde applications now rely on kcolorscheme entirely and no longer use the normal Qt color definitions which have less values.

  • first get your hands on some kind of kcolorscheme definition file. I simply installed kvantum which contained a lot in /usr/share/color-schemes
  • copy any of them to ~/.local/share/color-schemes, rename appropriately, and edit by hand. Apparently the only way to do this graphically is with kde-systemsettings but the format though overwhelming at first shouldn’t be that hard to understand, it’s just RGB values
  • importantly: install the qt6ct-kde fork of qt6ct, this can handle these and select them as color themes that qt6ct cannot
  • after selected, the “default” in kate now works fine, and kate also sees them under color themes in general even when not selected with qt6ct-kde

JFYI, in general it’s recommend to avoid qt6ct as it overrides KDE’s platform theme and thus changes the behavior of KDE apps in many unpredictable ways.

Is there something else outside of resorting to Plasma?

If you’re using Kate outside of Plasma, in Kate’s Settings menu, there’s a sub-menu that allows you to choose the color scheme. You can use that to change the app-wide color scheme.

Ah yes, I simply now have that set to “default” as well as on konsole which causes it to respect qt6ct’s wishes.

So you’re saying it’s better to ditch qt6ct and simply set it manually in each application? I suppose the issue is that many Qt6 applications that are not under KDE’s umbrella do require qt6ct to set it. But does Kate ignore qt6ct’s entire existence when set manually?

qt6ct will work for your Qt apps in general, but it’s a full platform theme that replaces the KDE one. This means you won’t have access to the KDE open/save dialogs anymore, for example. What it replaces is quite extensive, which is generally why we don’t recommend using it.