HomePhabricator

[electrum] Qt6 transition, step 1: wrap PyQt5 with qtpy

Description

[electrum] Qt6 transition, step 1: wrap PyQt5 with qtpy

Summary:
qtpy s a small abstraction layer that lets you write applications using a single API call to either PyQt or PySide. It aims at mimicking the Qt5 API, so this is a good first minimal step to transition to PyQt6 or PySide6 (with the added benefit that we now also support PySide2 for Qt5)

PyQt5 remains the default binding, so this does not change any behavior and is mostly (to the exception of some doc and requirements files) an automated replacement:

  • PyQt5 -> qtpy
  • QtCore.QT_VERSION_STR -> QtCore.version
  • pyqtSignal -> Signal
  • pyqtProperty -> Property
  • pyqtSlot -> Slot
  • pyqtBoundSignal -> SignalInstance

This is a the minimal diff to make the code work with qtpy while still using PyQt5. In a following step we will make the necessary changes to be compatible also with PyQt6 and PySide6

Test Plan:
run all tests (but coverage is nonexistent for the GUI/qt package)
Run the application and do some basic transaction spending / receiving tests

Build the AppImage and windows .exe release, check that it runs

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D18306

Details

Provenance
PiRKAuthored on Jul 1 2025, 07:48
PiRKPushed on Jul 2 2025, 06:18
Reviewer
Restricted Project
Differential Revision
D18306: [electrum] Qt6 transition, step 1: wrap PyQt5 with qtpy
Parents
rABCbcc9865db391: [e.cash] Add developers section
Branches
Unknown
Tags
Unknown