Skip to content

Use qtpy Signal in DiscreteColorWidget for PySide6 compatibility#399

Open
fjorka wants to merge 1 commit into
scverse:mainfrom
fjorka:fix/pyside6-qtpy-signal
Open

Use qtpy Signal in DiscreteColorWidget for PySide6 compatibility#399
fjorka wants to merge 1 commit into
scverse:mainfrom
fjorka:fix/pyside6-qtpy-signal

Conversation

@fjorka

@fjorka fjorka commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Problem

import napari_spatialdata fails under PySide6:

ImportError: cannot import name 'pyqtSignal' from 'pyqtgraph.Qt.QtCore'

_scatterwidgets.py takes pyqtSignal (a PyQt-only name) from pyqtgraph's shim for DiscreteColorWidget.paletteChanged. Since __init__.py imports _view_scatterwidgets, the whole package is unimportable under PySide6, not just the scatter widget. These are the only PyQt-only names in the codebase, so this is the complete fix.

Fix

Use qtpy's Signal, already imported in this file and already used by ScatterListWidget.attrChanged.

Verification

  • PyQt5: import succeeds before and after (no regression).
  • PySide6: fails before, succeeds after.

Context

I introduced this in #270; it went unnoticed because the all extra installs napari[pyqt5].
Same breakage as #397, this is a minimal internal fix.

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