Skip to content

PyQt6 Migration (draft) - DO NOT MERGE #3154

Open
ashleymeigh2 wants to merge 9 commits into
mainfrom
qt-install-draft
Open

PyQt6 Migration (draft) - DO NOT MERGE #3154
ashleymeigh2 wants to merge 9 commits into
mainfrom
qt-install-draft

Conversation

@ashleymeigh2

Copy link
Copy Markdown
Collaborator

Issue Closes #

Description

This PR migrates the codebase from Qt5/PyQt5 to Qt6/PyQt6.
Checklist of migration steps:

  • Audit all Qt imports and usage (in progress)
  • Update PyQt5 imports to PyQt6
  • Update Qt API changes (enums, methods, signals)
  • Update requirements and environment files for Qt6
  • Test application and fix Qt6-specific issues

Developer Testing

  • I have verified unit tests pass locally: python -m pytest -vs
  • Manual smoke testing of main workflows after migration

Acceptance Criteria and Reviewer Testing

  • Unit tests pass locally: python -m pytest -vs
  • Application launches and main workflows function as expected
  • All Qt imports and usages are PyQt6-compliant
  • No Qt6 API errors or deprecation warnings

- Changed all PyQt5 imports to PyQt6 equivalents across the codebase
- Updated environment files (environment.yml, environment-dev.yml, meta.yaml, etc.) to require PyQt6
- Updated QAction, QActionGroup, QShortcut imports and usages
- Changed QPalette role usages to QPalette.ColorRole.*
- Updated QImage.Format usages to QImage.Format.*
- Refactored all Qt enum usages (Orientation, AlignmentFlag, MouseButton, ItemDataRole, etc.) to new PyQt6 style
- Fixed IndentationError and removed duplicate lines in main/view.py
- Ensured all enum and role usages follow PyQt6 API requirements
- Updated qt_test_message_handler.py to use QtCore.QtMsgType.QtInfoMsg, QtWarningMsg, etc., resolving AttributeError for Qt message types in PyQt6.
- Replaced deprecated QtWidgets.qApp with QApplication.instance() in spectrum_viewer/view.py for event processing.
Removed pyqt6-sip because pyqt already manages the correct SIP version
Updated vtk pin to ensure Qt6-compatible VTK builds are selected
Removed explicit hdf5 pin to avoid ABI/dependency conflicts with h5py
Kept qt-material=2.14 unchanged since it should still work with Qt6 unless styling issues appear
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.

1 participant