File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 100100 from cdl .core .model .signal import NewSignalParam , SignalObj
101101
102102
103+ def is_plot_item_serializable (item : ShapeTypes ) -> bool :
104+ """Return True if plot item is serializable"""
105+ try :
106+ plotpy .io .item_class_from_name (item .__class__ .__name__ )
107+ return True
108+ except AssertionError :
109+ return False
110+
111+
103112class ObjectProp (QW .QWidget ):
104113 """Object handling panel properties"""
105114
@@ -792,8 +801,10 @@ def __separate_view_finished(self, result: int) -> None:
792801 """Separate view was closed"""
793802 dlg : PlotDialog = self .sender ()
794803 if result == QW .QDialog .DialogCode .Accepted :
795- items = dlg .get_plot ().get_items ()
796- rw_items = [item for item in items if not item .is_readonly ()]
804+ rw_items = []
805+ for item in dlg .get_plot ().get_items ():
806+ if not item .is_readonly () and is_plot_item_serializable (item ):
807+ rw_items .append (item )
797808 obj = self .__separate_views [dlg ]
798809 obj .annotations = items_to_json (rw_items )
799810 self .selection_changed (update_items = True )
You can’t perform that action at this time.
0 commit comments