Migrate from PySide2 to PySide6 to Fix Qt Symbol Compatibility Issues #3
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.
Problem Statement
PhotoGlimmer users on modern Ubuntu systems (particularly Ubuntu 24.04 with Python 3.12) were encountering critical import errors that prevented the application from starting:
This error occurs due to ABI (Application Binary Interface) incompatibilities between PySide2's Qt 5 libraries and the system's Qt libraries, which is a common issue on newer Linux distributions where Qt library versions may conflict.
Root Cause Analysis
The
_ZdlPvm, version Qt_5
symbol error indicates that PySide2 was built against a different version of Qt than what's available on the system, creating binary compatibility issues. This problem is exacerbated by:opencv-contrib-python
package includes its own Qt libraries that can conflict with PySide2Solution: Migration to PySide6
PySide6 provides better compatibility with modern systems and resolves these ABI conflicts because:
Changes Made
1. Dependency Updates
PySide2~=5.15
→PySide6~=6.5
pyproject.toml
dependenciesopencv-contrib-python-headless==4.8.1.78
to eliminate Qt conflicts2. Import Statement Migration
Updated import statements across all Python files:
3. API Compatibility Fixes
QAction
moved fromQtWidgets
toQtGui
photoglimmer_ui.py
and other affected files4. Files Modified
src/photoglimmer/photoglimmer_ui.py
- Main UI imports and QAction fixsrc/photoglimmer/customfiledialog.py
- File dialog importssrc/photoglimmer/imagewidget.py
- Image widget importssrc/photoglimmer/colorcurverwidget.py
- Color curve widget importssrc/photoglimmer/threadwork.py
- Threading importssrc/photoglimmer/uihelper_transparency.py
- UI helper imports + indentation fixessrc/photoglimmer/prefs/settings_config.py
- Settings importssrc/photoglimmer/prefs/preferences_dialog.py
- Preferences importssrc/photoglimmer/requirements.txt
- Dependency updatespyproject.toml
- Build configuration updatesTesting Results
✅ Application Startup: PhotoGlimmer now starts successfully on Ubuntu 24.04 with Python 3.12
✅ Core Functionality: All photo editing features work as expected
✅ UI Rendering: No visual regressions, all Qt widgets render correctly
✅ File Operations: Image loading, saving, and processing work without issues
✅ Backwards Compatibility: Existing user preferences and workflows preserved
Benefits of This Migration
opencv-contrib-python-headless
reduces potential conflictsMigration Impact
This migration ensures PhotoGlimmer remains accessible to users on modern Linux systems while maintaining all existing functionality and improving overall stability.