Skip to content

Fix TypeError when using middle-click scroll in GNS3 3.0.6 with Python 3.13 #3851

Closed as duplicate

Description

@pavel-gorin

Environment

  • OS: Debian (Trixie)
  • Python: 3.13.5
  • GNS3: 3.0.6 (installed via pipx)

Problem

When pressing the middle mouse button in the topology view, GNS3 throws a traceback:

Traceback (most recent call last):
File ".../gns3/graphics_view.py", line 637, in mouseMoveEvent
hBar.setValue(hBar.value() + (delta.x() if QtWidgets.QApplication.isRightToLeft() else -delta.x()))
TypeError: setValue(self, a0: int): argument 1 has unexpected type 'float'

Same for vertical scroll at line 639:
File ".../gns3/graphics_view.py", line 639, in mouseMoveEvent
vBar.setValue(vBar.value() - delta.y())
TypeError: setValue(self, a0: int): argument 1 has unexpected type 'float'

Root cause

PyQt's setValue() expects int, but delta.x() and delta.y() return float in Python 3.13.

Proposed fix

Wrap arguments in int():

hBar.setValue(int(hBar.value() + (delta.x() if QtWidgets.QApplication.isRightToLeft() else -delta.x())))
vBar.setValue(int(vBar.value() - delta.y()))

Activity

  1. grossmj commented on Oct 1, 2026

    @grossmj
    Member

    This has been fixed already, please try v3.1.0a6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions