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 means that bisections are easier in case I missed something which might well be the case.

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. Please stay focused so this PR can be merged quickly.

-- Vekhir

Vekhir added 30 commits June 25, 2024 14:12
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant