Expand compatibility using qtpy for PyQt6, PyQt5, PySide6, and PySide2 #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The qtpy abstraction layer allows projects to simultaneously support backends including PyQt6, PyQt5, PySide6, and PySide2.
This is a lot more convenient than users having to make edits like this one #6 to the code if they happen to use a different version of Qt, and it's a lot nicer than asking users to check out a specific commit to use the code - now one install works for all situations.
I've tested this PR locally, and the
demo.py
script runs well for all four backends. I have another branch where I've added CI tests with github actions and can submit that as a separate PR if you like.