Skip to content

Add PySide6 support to gui.jl #634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add PySide6 support to gui.jl #634

wants to merge 2 commits into from

Conversation

cjdoris
Copy link
Collaborator

@cjdoris cjdoris commented Jul 1, 2025

This PR adds PySide6 support to the GUI compatibility layer.

Changes Made

  • Updated `fix_qt_plugin_path() function to support both Qt5 and Qt6 configurations:

    • Added support for qt6.conf files used by PySide6 (in addition to existing qt.conf support)
    • For Qt6, reads the Libraries entry instead of Prefix
    • Sets QT_PLUGIN_PATH to {libraries}/qt6/plugins for PySide6 compatibility
    • Maintains backward compatibility with existing Qt5 frameworks
  • Added PySide6 to event loop callback by including it in the supported GUI frameworks list and adding the import for PySide6.QtCore

  • Added PySide6 module hook to automatically call `fix_qt_plugin_path() when PySide6 is imported

  • Updated documentation to include PySide6 in all relevant docstrings and parameter descriptions

Technical Details

The key insight from the issue discussion is that Qt6 uses a different configuration file format:

  • Qt5: Uses qt.conf with Prefix entry, plugins at {prefix}/plugins
  • Qt6: Uses qt6.conf with Libraries entry, plugins at {libraries}/qt6/plugins

The updated function checks for qt6.conf first, then falls back to qt.conf for backward compatibility.

Testing

This change is designed to be backward-compatible and follows the exact approach suggested by @cjdoris in the issue comments. The implementation handles the platform-dependent path differences by using the Libraries entry from qt6.conf as recommended.

Fixes #632

- Update fix_qt_plugin_path() to support qt6.conf files used by PySide6
- Use Libraries path from qt6.conf instead of Prefix for Qt6 plugin path
- Set QT_PLUGIN_PATH to {libraries}/qt6/plugins for PySide6
- Add PySide6 to event loop callback function
- Add PySide6 module hook for automatic plugin path fixing
- Update documentation to include PySide6 support

Fixes #632
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.

Support PySide6 in Compat
1 participant