Skip to content

[Bug]: Media Rep Menu not working with PySide2 #943

@vcandelam

Description

@vcandelam

What happened?

When creating several media repr with an OpenRV build using PySide2 instead of PySide6, the menu doesn't pop up since the QAction creation command doesn't provide backward compatibility.

Issue on: src/plugins/rv-packages/multiple_source_media_rep/multiple_source_media_rep.py
line 364: title = QtGui.QAction("Media Playback", menu) is the PySide6 method since QAction was moved from QtWidgets.QAction in PySide2.

Proposed fix:
Directly importing QAction in the PySide version check already provided at the start on line 12, extending it with:

try:
    from PySide2 import QtCore, QtGui, QtWidgets
    from PySide2.QtWidgets import QAction
except ImportError:
    try:
        from PySide6 import QtCore, QtGui, QtWidgets
        from PySide6.QtGui import QAction
    except ImportError:
        pass

and then title would be defined as: title = QAction("Media Playback", menu)

List all the operating systems versions where this is happening

All

On what computer hardware is this happening?

All

Relevant console log output

Environment variables

No response

Extra information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions