How do I fix a Cannot move to target thread (0x1b10ec0) when creating a QApplication object in PyQT5?

I am developing a PyQT5 application, but it suddenly stopped working. Now if I attempt to create a QApplication object with the following line of code: application = QApplication(), the following is printed to the console:

QObject::moveToThread: Current thread (0x1b10ec0) is not the object's thread (0x1cc97c0).
Cannot move to target thread (0x1b10ec0)

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/oskar/Documents/GitHub/dji-tello-gui/venv/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.

PyQT5 is installed via pip at v5.15.6, on a Linux system running Pop!_OS 21.04 and GNOME.

How would I fix this?


Flutter library that provides useful functions for working with colors

Count missing values under specific date conditions in R