AcademySoftwareFoundation / AcademySoftwareFoundation/OpenRV
[Bug]: Media Rep Menu not working with PySide2
- Dominant language
- C++
- Stars
- 764
- Forks
- 246
- Avg merge
- 6d 12h
- Merged PRs (30d)
- 13
Description
### 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
```shell
```
### Environment variables
_No response_
### Extra information
_No response_
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Contributor guide
Research direction
Open src/plugins/rv-packages/multiple_source_media_rep/multiple_source_media_rep.py and start with the PySide version check near line 12, then inspect the QAction creation at line 364. Done means the Media Playback menu appears when creating several media representations with both PySide2 and PySide6.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100