Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QObject::moveToThread Cannot move to target thread. #61

Open
nicolinux72 opened this issue Feb 12, 2024 · 2 comments
Open

QObject::moveToThread Cannot move to target thread. #61

nicolinux72 opened this issue Feb 12, 2024 · 2 comments

Comments

@nicolinux72
Copy link

Hi,

I got this error when try to launch PPOCRLabel:

$ PPOCRLabel
QObject::moveToThread: Current thread (0x213f630) is not the object's thread (0x51f3a50).
Cannot move to target thread (0x213f630)

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/nicola/miniconda3/envs/head-less/lib/python3.11/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.

Any idea?

Thank you.

@wh1t3h47
Copy link

wh1t3h47 commented Nov 7, 2024

Hi,
I have no idea if this will work for you
Either try this:

apt install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev

Or:

export QT_QPA_PLATFORM=offscreen

Let me know if worked

@wh1t3h47
Copy link

wh1t3h47 commented Nov 7, 2024

You can set QT_QPA_PLATFORM to any of the provided values (in the error message)

Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.

I.e.:

export QT_QPA_PLATFORM=xcb
# or
export QT_QPA_PLATFORM=eglfs
# or
export QT_QPA_PLATFORM=linuxfb
# or
export QT_QPA_PLATFORM=minimal
# or
export QT_QPA_PLATFORM=minimalegl
# or
export QT_QPA_PLATFORM=offscreen
# or
export QT_QPA_PLATFORM=vnc # I think this one will work only if you have vnc server/ client
# or
export QT_QPA_PLATFORM=wayland-egl
# or
export QT_QPA_PLATFORM=wayland
# or
export QT_QPA_PLATFORM=wayland-xcomposite-egl
# or
export QT_QPA_PLATFORM=wayland-xcomposite-glx
# or
export QT_QPA_PLATFORM=webgl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants