PPOCRLabel icon indicating copy to clipboard operation
PPOCRLabel copied to clipboard

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

Open enyung opened this issue 2 years ago • 3 comments

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'

enyung avatar May 21 '23 20:05 enyung

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

xioahai778 avatar Aug 17 '23 05:08 xioahai778

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'

EdwirdsLy avatar Nov 17 '23 13:11 EdwirdsLy

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

RafiyatnSandya avatar Apr 30 '24 20:04 RafiyatnSandya