Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to typed enums from QtCore.Qt #5548

Open
wants to merge 33 commits into
base: develop
Choose a base branch
from

Conversation

Vekhir
Copy link

@Vekhir Vekhir commented Jun 25, 2024

The codebase currently accesses the fields of QtCore.Qt directly, e.g. Qt.white. Qt.white is part of the Qt.GlobalColor enum, so can also be accessed via Qt.GlobalColor.white. The latter access method is mandatory with PyQt6 to achieve better type safety.

The full list of enums is available at https://www.riverbankcomputing.com/static/Docs/PyQt5/api/qtcore/qt.html. I've checked for each and every literal name whether it is used in OpenShot, and then committed the changes by enum type. The commit header and message are essentially the same each time, mostly noting the enum type contained within it and a note that it's required for PyQt6 compatibility. The split into 33 commits is supposed to make the code review easier; if you'd rather like a single commit, I can squash them.

The idea is more thoroughly explained in #4833. This PR is a subset of the changes there - this is by no means complete. I've tried to keep the changes as small and simple as possible, being basically find and replace.

Feedback and comments are appreciated.

-- Vekhir

Copy link

github-actions bot commented Jul 7, 2024

Merge conflicts have been detected on this PR, please resolve.

@github-actions github-actions bot added the conflicts A PR with unresolved merge conflicts label Jul 7, 2024
Vekhir added 28 commits July 24, 2024 14:40
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
PyQt6 requires typed enums; they are already available in PyQt5.
@Vekhir
Copy link
Author

Vekhir commented Jul 24, 2024

@jonoomph Is there something that prevents this PR from being merged? It's a small step toward PyQt6 support and referencing the scope of the enums is recommended by PyQt5 aswell.

@github-actions github-actions bot removed the conflicts A PR with unresolved merge conflicts label Jul 31, 2024
@github-actions github-actions bot added the conflicts A PR with unresolved merge conflicts label Sep 12, 2024
Copy link

Merge conflicts have been detected on this PR, please resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts A PR with unresolved merge conflicts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant