Can't start Dolphin: Could not load the Qt platform plugin “xcb”

,

manjaro 20.2.1
python 3.9.2
i3 wm

I cant start dolphin in the i3 wm error message shows

QObject::moveToThread: Current thread (0x556ecdb7aec0) is not the object’s thread (0x556ecdb871f0).
Cannot move to target thread (0x556ecdb7aec0)

qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “/home/lizhe/.local/lib/python3.9/site-packages/cv2/qt/plugins” 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: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.

fish: Job 1, “dolphin . $argv” terminated by signal SIGABRT (Abort)

I install reinstall qt5 and libxcb opencv. All this occurs in i3 wm. KDE works fine.
HOw to solve it?

Since you installed i3wm after KDE Plasma you might have to make use of:
export QT_PLUGIN_PATH=/usr/lib/qt/plugins
or
export XDG_DATA_DIRS="/usr/local/share:/usr/share"
when you start the i3wm session …

Maybe in .profile file inside your home directory, but maybe there is a better way, so is not influencing also when you log into plasma-session, and make sure the xdg path are set if nothing filed up some defaults yet, by using something like:

if [ -z "$XDG_DATA_DIRS" ]; then
    export XDG_DATA_DIRS="/usr/local/share:/usr/share"
fi

and probably that code should go inside /etc/profile.d … like dolphin.sh file …