I need to change QT theme for root applications. The other solution said that you need to run systemsettings5 as root that can change QT theme for root user.
but sudo systemsettings5 can not open KDE system setting as root.
❯ sudo systemsettings5
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
kf.dbusaddons: DBus session bus not found. To circumvent this problem try the following command (with bash):
export $(dbus-launch)
kdesu systemsettings5 does not work.
I checked it in Manjaro KDE VM, same issue.
OpenSUSE the last version has no issue in VM.
pkexec systemsettings5
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
It seems like you already found a solution but I think a much safer alternative solution is to use a tool like konsave to transfer your user config to root. That way you don’t have to run any GUI tools which could potentially have side effects as root.