Skip to content

Conversation

@crwood
Copy link
Member

@crwood crwood commented Apr 30, 2022

This PR adds preliminary support for Qt 6 by means of the "QtPy" shim/abstraction layer (which aims to provide a common API between different Qt versions and their bindings). Accordingly, most of the code-changes here consist of rather trivial updates to import statements (i.e., to import Qt-related classes from the qtpy package instead of PyQt5), however, some additional changes were needed along the way to ensure working compatibility between Qt5 and Qt6 (such as replacing the old QtDBus-based Linux desktop notification provider with a txdbus-based one, accounting for removed or renamed Qt enums and constants in Qt6, and adding/updating container images to facilitate reproducible Qt6-based builds/deployments).

With this PR landed, switching out Gridsync's underlying Qt binding/library is simply a matter of setting a QT_API environment variable to the name of any API currently supported by QtPy -- which must be one of pyqt5, pyqt6, pyside2 or pyside6 -- and installing, testing, building, or launching the application normally. For example:

$ QT_API=pyqt5 tox   # Run the tests with PyQt5
$ QT_API=pyqt6 make  # Build the application with PyQt6

Note that, as per the above, this support for different Qt bindings is intended to be preliminary; Gridsync will continue to use and ship with PyQt5 for the foreseeable future (and will default to using PyQt5 in any/all contexts where QT_API is unset). The purpose of this PR is mainly to enforce writing binding-agnostic code in order to facilitate CI/testing against forthcoming versions of Qt so that potential compatibility issues can be identified and addressed as early as possible. (To this end, this PR also updates the project's GitHub Actions configuration to run all workflows against both PyQt5 and PyQt6; all tests are passing with both versions).

@crwood crwood merged commit dadb131 into master May 1, 2022
@crwood crwood deleted the qtpy branch May 1, 2022 18:26
@crwood crwood mentioned this pull request May 9, 2024
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.

2 participants