Skip to content

TypeError in qtDisplay when using PySide6 #1485

@vector-space

Description

@vector-space

I'm using PySide6.11.0 and pythonocc7.9.3 on win11. When I run the demo core_display_activate_manipulator.py I got an error:

Error calling Python override of QWidget::mouseMoveEvent(): Traceback (most recent call last):
File "D:\anaconda3\envs\occqt\Lib\site-packages\OCC\Display\qtDisplay.py", line 411, in mouseMoveEvent
buttons = int(evt.buttons())
^^^^^^^^^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'MouseButton'

The place where error raises is:

def mouseMoveEvent(self, evt: Any) -> None:
    """
    Called when the mouse is moved.
    """
    pt = evt.pos()
    buttons = int(evt.buttons()) # looks like int() can't convert the thing that evt.buttons() returned
    modifiers = evt.modifiers()

Could you please fix that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions