Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Solve Type Error in scroll_request method #982

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sohang3112
Copy link

The following error occurs in scroll_request method:

Traceback (most recent call last):
  File "C:\Users\SohangChopra\AppData\Local\Programs\Python\Python311\Lib\site-packages\labelImg\labelImg.py", line 965, in scroll_request
    bar.setValue(bar.value() + bar.singleStep() * units)
TypeError: setValue(self, a0: int): argument 1 has unexpected type 'float'

This is because units = - delta / (8 * 15) is a float, so bar.value() + bar.singleStep() * units is also coerced to a float. The solution is to use // (integer division) instead of /.

The following error occurs in `scroll_request` method:
```
Traceback (most recent call last):
  File "C:\Users\SohangChopra\AppData\Local\Programs\Python\Python311\Lib\site-packages\labelImg\labelImg.py", line 965, in scroll_request
    bar.setValue(bar.value() + bar.singleStep() * units)
TypeError: setValue(self, a0: int): argument 1 has unexpected type 'float'
```
This is because ` units = - delta / (8 * 15)` is a `float`, so `bar.value() + bar.singleStep() * units` is also coerced to a `float`. The solution is to use `//` (integer division) instead of `/`.
@sohang3112
Copy link
Author

@tzutalin Please review this pull request, and let me know if there are any issues. Thanks in advance 🙂

@sohang3112
Copy link
Author

@tzutalin Did you have a chance to review this PR yet?

1 similar comment
@sohang3112
Copy link
Author

@tzutalin Did you have a chance to review this PR yet?

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

Successfully merging this pull request may close these issues.

None yet

1 participant