On 5/27/22 06:03, stan via users wrote:
On Thu, 26 May 2022 14:29:31 -0700
Samuel Sieb <samuel@xxxxxxxx> wrote:
On 5/26/22 06:18, stan via users wrote:
So, the problem is in this function,
def wheelEvent(self, e):
h = self.horizontalScrollBar()
if not self.verticalScrollBar().isVisible() and
h.isVisible(): numsteps = e.angleDelta().y() / 5
Python3 changed the default for division. Python2 would always give
you an integer result from dividing integers, but Python3 will give
you a float if the numbers are not evenly divisible. The simplest
fix would be to change the "/" to a "//" (integer division).
Good catch! I attached to the argument 1 and got caught by the off by 1
error, the argument count starts at zero, not 1, and so was looking at
h.value() instead of numsteps.
TypeError: setValue(self, int): argument 1 has unexpected type 'float'
h.setValue(h.value() - numsteps) <-------- here
e.accept()
else:
QTableView.wheelEvent(self, e)
Argument 1 is "h.value() - numsteps". Argument 0 is the "self"
parameter that you don't see. It's a class method call, so the first
argument is the instance variable. (Referred to as "this" in several
other languages.)
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure