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

Error starting an application #2

Open
MrMizinov opened this issue Jun 6, 2023 · 1 comment
Open

Error starting an application #2

MrMizinov opened this issue Jun 6, 2023 · 1 comment
Labels
solved solved

Comments

@MrMizinov
Copy link

Hello, the first time I ran the application I got this error:
starting key listener.. listening resetKeyPrsd() 148 2 showWindow() WARNING: QApplication was not created in the main() thread. QObject::moveToThread: Current thread (0x7fdacc000ee0) is not the object's thread (0x7fdacc23fa50). Cannot move to target thread (0x55bd23364d10) qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/paul/.local/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.

Reinstalled the opencv library:

pip uninstall opencv-python && pip install opencv-python-headless

After restarting I get the following error:

starting key listener.. listening resetKeyPrsd() 76 2 showWindow() WARNING: QApplication was not created in the main() thread. QWidget subclass __init__ 1300 500 QWidget subclass __init__ finish QWidget subclass paintEvent Traceback (most recent call last): File "/home/paul/Desktop/vimouse/viscreen.py", line 380, in paintEvent self.paintLabel(''.join(kpc['keyp']) , kpc['cord'][0] , kpc['cord'][1] ) File "/home/paul/Desktop/vimouse/viscreen.py", line 343, in paintLabel qp.fillRect( x-w/2-w_ex , y-h/2-h_ex , w+2*w_ex, h+2*h_ex , b_color ) TypeError: arguments did not match any overloaded call: fillRect(self, a0: QRectF, a1: Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'numpy.float64' fillRect(self, a0: QRect, a1: Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'numpy.float64' fillRect(self, x: int, y: int, w: int, h: int, b: Union[QBrush, QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'numpy.float64' fillRect(self, a0: QRectF, color: Union[QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'numpy.float64' fillRect(self, a0: QRect, color: Union[QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'numpy.float64' fillRect(self, x: int, y: int, w: int, h: int, b: Union[QColor, Qt.GlobalColor, QGradient]): argument 1 has unexpected type 'numpy.float64' fillRect(self, x: int, y: int, w: int, h: int, c: Qt.GlobalColor): argument 1 has unexpected type 'numpy.float64' fillRect(self, r: QRect, c: Qt.GlobalColor): argument 1 has unexpected type 'numpy.float64' fillRect(self, r: QRectF, c: Qt.GlobalColor): argument 1 has unexpected type 'numpy.float64' fillRect(self, x: int, y: int, w: int, h: int, style: Qt.BrushStyle): argument 1 has unexpected type 'numpy.float64' fillRect(self, r: QRect, style: Qt.BrushStyle): argument 1 has unexpected type 'numpy.float64' fillRect(self, r: QRectF, style: Qt.BrushStyle): argument 1 has unexpected type 'numpy.float64' fillRect(self, x: int, y: int, w: int, h: int, preset: QGradient.Preset): argument 1 has unexpected type 'numpy.float64' fillRect(self, r: QRect, preset: QGradient.Preset): argument 1 has unexpected type 'numpy.float64' fillRect(self, r: QRectF, preset: QGradient.Preset): argument 1 has unexpected type 'numpy.float64' [1] 5726 IOT instruction (core dumped) python3.11 viscreen.py

@garywill
Copy link
Owner

garywill commented Jun 6, 2023

argument 1 has unexpected type 'numpy.float64'

that means the numbers are decimals not integers.

vimouse/viscreen.py

Lines 343 to 353 in 2e4d9a2

qp.fillRect( x-w/2-w_ex , y-h/2-h_ex , w+2*w_ex, h+2*h_ex , b_color )
# 框
qp.setPen(r_color)
qp.setBrush(Qt.transparent)
qp.drawRect( x-w/2-w_ex , y-h/2-h_ex , w+2*w_ex, h+2*h_ex )
qp.setPen(QPen(t_color))
qp.setBrush(QBrush(t_color))
qp.drawText( x-w/2 , y+h/2 , text)

try modify above / to //, or use int() to convert them

@garywill garywill added the solved solved label Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved solved
Projects
None yet
Development

No branches or pull requests

2 participants