Skip to content

Support PyQt6 (default in Qubes 4.3) #1494

@deeplow

Description

@deeplow

Description

PyQt6 is available by default in Qubes 4.3. Theoretically we could also install PyQt5 there, but if we can spare dom0 from another dependency, that's a positive. Therefore we should make our current code work with both versions, at least while Qubes 4.2 is around.

Relevant PyQt5 → PyQt6 changes

They are practically all backwards compatible, but some are not forward compatible. In order words, PyQt6 is more stringent, but this should keep working on PyQt5. Here are some of the relevant changes to be adopted:

  • replace "exec_()" with exec() (Qt5 targeted also python2, which meant that it had "exec" reserved. This is no longer the case, so we can use the more aptly named "exec()" (NOTE: check if this works on PyQt5, otherwise add a try...except)
  • Expand enums like QMessageBox.Ok to have its full name: QMessageBox.StandardButtons.Ok

A good overview of the upgrade notes can be found at https://www.pythonguis.com/faq/pyqt5-vs-pyqt6/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions