Skip to content

Fix PySide6 stylesheet usage#3371

Draft
C-Achard wants to merge 3 commits into
cy/update-gui-assets-importsfrom
cy/fix-pyside6-theme
Draft

Fix PySide6 stylesheet usage#3371
C-Achard wants to merge 3 commits into
cy/update-gui-assets-importsfrom
cy/fix-pyside6-theme

Conversation

@C-Achard

@C-Achard C-Achard commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

The GUI was still using a pyside2-only stylesheet rather than the updated PySide6 one.

The qdarkstyle version was also not dynamically resolved based on OS (unlike PySide6 itself), leading to potential inconsistencies.

This PR updates the dependencies and stylesheet usage to address this.

Note

I would suggest merging #3350 and #3370 together first, and once the pathlib overhaul is over, merge this into main instead, as it may not belong directly in the pathlib-related work.

Automated summary

This pull request updates how the application's dark mode stylesheet is loaded and improves platform compatibility for dependencies. The main changes are focused on improving stylesheet loading logic in the GUI and making the qdarkstyle dependency more robust across different platforms.

GUI stylesheet loading improvements:

  • Replaced the manual loading of the style.qss file with the new get_style_qss() function to set the initial stylesheet in launch_script.py [1] [2].
  • Improved error handling when loading the qdarkstyle stylesheet for PySide6: if loading fails, the code logs a warning and falls back to the PySide2 stylesheet.

Dependency management updates:

  • Updated the qdarkstyle dependency in pyproject.toml to use version-specific and platform-specific selectors, ensuring compatibility with different operating systems and architectures.

C-Achard added 3 commits June 15, 2026 10:27
Load the GUI stylesheet via get_style_qss (from gui_assets) instead of reading BASE_DIR/style.qss, and switch qdarkstyle to the PySide6 loader. Also adjust pyproject.toml to declare qdarkstyle for non-Linux x86_64 platforms and pin qdarkstyle==3.1 only for Linux x86_64 (matching the conditional pyside6 pin). This centralizes style handling in gui_assets and aligns the qdarkstyle loader and dependency constraints with PySide6 usage.
Add logging and a try/except around qdarkstyle.load_stylesheet_pyside6() to catch failures and fall back to load_stylesheet_pyside2(). This prevents the app from crashing if the PySide6 stylesheet cannot be loaded and logs a warning with the exception details.
@C-Achard C-Achard self-assigned this Jun 15, 2026
@C-Achard C-Achard added enhancement New feature or request GUI issues relating to GUI labels Jun 15, 2026
@C-Achard C-Achard changed the title Cy/fix pyside6 theme Fix PySide6 theme usage Jun 15, 2026
@C-Achard C-Achard changed the title Fix PySide6 theme usage Fix PySide6 stylesheet usage Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request GUI issues relating to GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant