Skip to content

Port GUI to Qt6/qtpy>=2.4 and PyQt6: replace deprecated Qt enums/APIs and update deps - #572

Closed
axelvonkamp wants to merge 1 commit into
gui_improvementsfrom
codex/migrate-codebase-to-qt-6.8
Closed

Port GUI to Qt6/qtpy>=2.4 and PyQt6: replace deprecated Qt enums/APIs and update deps#572
axelvonkamp wants to merge 1 commit into
gui_improvementsfrom
codex/migrate-codebase-to-qt-6.8

Conversation

@axelvonkamp

Copy link
Copy Markdown
Member

Motivation

  • Ensure compatibility with newer Qt/PyQt/qtpy stacks (Qt6 / qtpy>=2.4 / PyQt6) by replacing deprecated Qt API usage and enum names.
  • Unify usage of explicit enum types and roles (cursor shapes, color roles, key/mouse/modifier enums, message box icons, header/size policies, etc.) to avoid runtime attribute errors under Qt6.
  • Update packaging metadata to require newer Qt-related packages consistent with the API changes.

Description

  • Replaced many legacy Qt.* enum usages with the Qt6-style names such as Qt.GlobalColor.*, Qt.CursorShape.*, Qt.Key.*, Qt.MouseButton.*, Qt.KeyboardModifier.*, Qt.ApplicationAttribute, Qt.ColorRole/QPalette.ColorRole, QPalette.ColorGroup, QFrame.Shape/QFrame.Shadow, and related enum classes across multiple GUI modules.
  • Updated various Qt container/role/mode APIs to use namespaced enum types from PyQt6/qtpy (e.g. QHeaderView.ResizeMode, QAbstractItemView.SelectionMode, QTableWidget.setEditTriggers with EditTrigger, QCompleter.CompletionMode, QMenu.exec replacement for exec_, QDialog.exec for exec_).
  • Replaced QMessageBox icon and button constants with QMessageBox.Icon.* and QMessageBox.StandardButton.* where appropriate.
  • Made cursor, drag and drop and cursor restore calls use the new CursorShape enums and switched several exec_() calls to exec() for Qt6 compatibility.
  • Adjusted qt high DPI attribute setting to use Qt.ApplicationAttribute lookups to remain safe under Qt5/Qt6.
  • Updated project dependency files: environment.yml and pyproject.toml to require qtpy>=2.4, pyqt6>=6.8 / pyqt6-webengine, and qtconsole>=5.6 (and matching webengine entries) to match the API changes.
  • Changes are mechanical and applied across many GUI modules (e.g., application.py, appdata.py, core_gui.py, numerous files under gui_elements/, utils.py, and more) to modernize enum uses and API calls.

Testing

  • No automated tests were added to this PR and no test suite was executed as part of the rollout; the changes are mechanical API replacements intended to be a compatibility layer for Qt6/qtpy>=2.4 and require running the project's existing unit/UI test suite and a manual UI smoke test on a Qt6-enabled environment to verify runtime behavior.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant