File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -182,9 +182,16 @@ def __init__(
182182 select_gbox .setLayout (select_gbox_layout )
183183
184184 # Edit the selected colormap
185- self .colormap_editor = ColorMapEditor (
186- self , colormap = deepcopy (self ._cmap_choice .currentData ())
187- )
185+ current_cmap = self ._cmap_choice .currentData ()
186+ # This test is necessary because the currentData method returns a QVariant
187+ # object, which may be handled differently by PyQt5, PySide2 and PySide6.
188+ # This is an attempt to fix an issue with PySide6 (segfault).
189+ if isinstance (current_cmap , EditableColormap ):
190+ current_cmap = deepcopy (current_cmap )
191+ else :
192+ current_cmap = None
193+ self .colormap_editor = ColorMapEditor (self , colormap = current_cmap )
194+
188195 self ._edit_gbox = QW .QGroupBox (_ ("Edit the selected colormap" ))
189196 edit_gbox_layout = QW .QVBoxLayout ()
190197 edit_gbox_layout .setContentsMargins (0 , 0 , 0 , 0 )
You can’t perform that action at this time.
0 commit comments