Skip to content

Fix PyQt5 checkStateChanged AttributeError on QCheckBox#1479

Open
wong-ziyi wants to merge 1 commit into
MouseLand:mainfrom
wong-ziyi:fix-pyqt5-signal-compat
Open

Fix PyQt5 checkStateChanged AttributeError on QCheckBox#1479
wong-ziyi wants to merge 1 commit into
MouseLand:mainfrom
wong-ziyi:fix-pyqt5-signal-compat

Conversation

@wong-ziyi

Copy link
Copy Markdown

Description

Recent updates to QCheckBox signals in gui.py migrated stateChanged to checkStateChanged. While this correctly aligns with PyQt6, it breaks compatibility with PyQt5 and PySide2 where checkStateChanged does not exist on QCheckBox, causing an AttributeError upon starting the GUI.

Solution

This PR adds a simple try-except AttributeError fallback that attempts to connect checkStateChanged (for PyQt6 / PySide6) and gracefully falls back to stateChanged (for PyQt5 / PySide2), ensuring Cellpose's GUI remains compatible across older Conda environments.

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.

1 participant