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

Upgrading from Qt5 #1589

Closed
wants to merge 8 commits into from
Closed

Conversation

Robberduckzilla
Copy link
Contributor

@Robberduckzilla Robberduckzilla commented Feb 13, 2023

Re-opens PR-1425 from Benoit.

Summary of changes

With the Qt5 LTS support moved to commercial only, the only maintained version seems to be the KDE version, which is shipped by some distributions.

The first Q6 LTS release is also available, and there are now alternatives to PyQt5 / PyQt6: the official PySide2 / PySide6 bindings.

The 4 sets of bindings are mostly compatible.

By switching to QtPy, an abstraction layer for PyQt5/PyQt4/PySide2/PySide, and with a few compatibility fixes, we can target PyQt5, PySide2, PyQt6 and PySide6, making the transition to another set of bindings easier (and transparent for plugins).

Main changes:

  • import from qtpy
  • don't use QVariant when declaring signals (just use object).
  • use scoped enums accesses: e.g. QDialogButtonBox.StandardButton.Ok instead of QDialogButtonBox.Ok. Necessary for Qt6 compatibility, increases our minimum supported version of PyQt5 to 5.11 (released in 2018).
  • load resources directly from filesystem (no need for pyrcc5 anymore).
  • use the QComboBox textActivated(QString) signal instead of activated(QString). Necessary for Qt6 compatibility,
  • increases our minimum supported version of PyQt5 to 5.14 (released in 2019).
  • a few other minor compatibility fixes for supporting PySide2 / PySide6 / PyQt6 / Qt6.

Known issues:

Pull Request Checklist

  • Changes have tests
  • News fragment added in news.d. See documentation for details

@Robberduckzilla Robberduckzilla marked this pull request as ready for review February 13, 2023 18:38
@Robberduckzilla
Copy link
Contributor Author

Just tested this for a few hours and it definitely does not work as intended, needs more work before it's ready for PR.
I'll close this for now and raise another in future when it's ready.

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