Migrate GUI framework from PyQt5 to PyQt6 (Closes #497)#498
Open
GiGiKoneti wants to merge 1 commit intoFOSSEE:masterfrom
Open
Migrate GUI framework from PyQt5 to PyQt6 (Closes #497)#498GiGiKoneti wants to merge 1 commit intoFOSSEE:masterfrom
GiGiKoneti wants to merge 1 commit intoFOSSEE:masterfrom
Conversation
Author
|
Since PyQt5 reached End-of-Life recently, this update ensures eSim remains secure and fully compatible with modern Python environments (3.11+). I've meticulously handled all the Qt6 API changes (module relocations, deprecated I've tested the GUI routing locally and everything boots up cleanly. Let me know if you have any questions or if you'd like me to walk you through any of the changes during your review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
Closes #497
Purpose
The core GUI of eSim currently relies on
PyQt5, which officially reached its End-of-Life (EOL) in May 2024. Continuing to rely on Qt5 bindings presents several risks:The purpose of this PR is to completely migrate the eSim front-end architecture from PyQt5 to PyQt6. This is a massive modernization effort that future-proofs the application, ensures compatibility with modern Python packaging, and aligns the codebase with strict Qt6 typing standards.
Approach
To accomplish this migration safely across the entire codebase, a combination of automated static analysis and manual verification was used to systematically update the framework. The exact architectural changes are detailed below:
1. Dependency Modernization
requirements.txtto removePyQt5andPyQt5-sip.PyQt6>=6.5.0,PyQt6-Qt6, andPyQt6-sipto ensure the application pulls the latest stable GUI bindings.2. Global Import Refactoring
from PyQt5 import QtWidgets→from PyQt6 import QtWidgets).PyQt5.Qtmodule. Objects previously imported from this catch-all module were explicitly routed to their proper PyQt6 homes (e.g.,PyQt6.QtCoreorPyQt6.QtWidgets).3. API Relocations & Signature Updates
QActionwas removed from the widgets module. All instances ofQtWidgets.QActionwere successfully migrated toQtGui.QAction.Application.pywas updated to initializeQSplashScreenusing only the Pixmap and WindowFlags.PyQt6.QtWidgetsin the ModelEditor logic.4. Deprecation Removals
.exec_()method calls (used heavily inQMessageBoxandQDialog) were replaced with the modern.exec().AA_DontUseNativeDialogsflag fromApplication.py, as this attribute was fully removed in Qt6. (Native dialog behavior is now handled viaQFileDialog.Option).5. Strict Enum Scoping
PyQt6 enforces strict typing for all Qt enums, removing the loose integer casting and nested properties allowed in PyQt5. The following domains were strictly typed:
Workspace.pyto useQtCore.Qt.CheckState(int)instead of passing raw integers tosetCheckState().setWindowModality(2)with the explicitQtCore.Qt.WindowModality.ApplicationModal.QMessageBox.Warning→QMessageBox.Icon.Warning).Qt.AlignCenter→Qt.AlignmentFlag.AlignCenter) and size policies (e.g.,QSizePolicy.Expanding→QSizePolicy.Policy.Expanding).QProcess.ExitStatus.NormalExit.Verification:
The application has been successfully tested locally. The main window, workspace initialization, and tool routing successfully launch under the new PyQt6 framework.