Skip to content

Modifiers not working in qtDisplay.py using Pyqt5 5.15.5 on Windows 11 #1463

@idclifford

Description

@idclifford

I have been unable to get any shift modifiers to work in the class qtViewer3dWithManipulator using Pyqt5 on Windows 11.

After some playing around, it seems that this is related to the way the modifiers are tested in this module. The current code does the following:

# Code doesn't work
modifiers = event.modifiers()
if modifiers == QtCore.Qt.Modifier.SHIFT:
    doSomething

If you explicitly convert modifiers to an int then the code works as expected.

# Code doesn't work
modifiers = int(event.modifiers())
if modifiers == QtCore.Qt.Modifier.SHIFT:
    doSomething

I don't know if this issue to specific to any version of Qt, PyQt or operating system, but please consider updating the source to address this issue.

Thanks in advance
Ivor

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