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

Unexpected type 'float' when scrolling and trying to draw rectbox #54

Open
enyung opened this issue May 21, 2023 · 3 comments
Open

Unexpected type 'float' when scrolling and trying to draw rectbox #54

enyung opened this issue May 21, 2023 · 3 comments

Comments

@enyung
Copy link

enyung commented May 21, 2023

When scrolling:

Traceback (most recent call last):
File "C:\Users\thomas\AppData\Local\Programs\Python\Python310\lib\site-packages\PPOCRLabel\PPOCRLabel.py", line 1425, in scrollRequest
bar.setValue(bar.value() + bar.singleStep() * units)
TypeError: setValue(self, a0: int): argument 1 has unexpected type 'float'

When trying to draw RectBox:

Traceback (most recent call last):
File "C:\Users\thomas\AppData\Local\Programs\Python\Python310\lib\site-packages\PPOCRLabel\libs\canvas.py", line 596, in paintEvent
p.drawRect(leftTop.x(), leftTop.y(), rectWidth, rectHeight)
TypeError: arguments did not match any overloaded call:
drawRect(self, rect: QRectF): argument 1 has unexpected type 'float'
drawRect(self, x: int, y: int, w: int, h: int): argument 1 has unexpected type 'float'
drawRect(self, r: QRect): argument 1 has unexpected type 'float'

@xioahai778
Copy link

lines 597 p.drawRect(int(leftTop.x()), int(leftTop.y()), int(rectWidth), int(rectHeight))

@EdwirdsLy
Copy link

There is another error scrolling in any view
[2023/11/17 10:41:44] ppocr WARNING: When args.layout is false, args.ocr is automatically set to false
Traceback (most recent call last):
File "F:\ProgramData\anaconda3\lib\site-packages\PPOCRLabel\PPOCRLabel.py", line 1425, in scrollRequest
bar.setValue(bar.value() + bar.singleStep() * units)
TypeError: setValue(self, int): argument 1 has unexpected type 'float'

@RafiyatnSandya
Copy link

Add int, bar.setValue(int(bar.value()) + (int(bar.singleStep()) * units)

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

4 participants