save fit parameter does not confirm overwrite; export graphics with try-catch around get_data_opts;

This commit is contained in:
dominik
2022-11-08 20:07:16 +01:00
parent a746afadff
commit 091677991b
4 changed files with 17 additions and 8 deletions

View File

@ -596,7 +596,12 @@ class QGraphWindow(QtWidgets.QGraphicsView, Ui_GraphWindow):
legend_shown = True
break
in_legend.append(legend_shown)
item_dic = plot_item.get_data_opts()
try:
item_dic = plot_item.get_data_opts()
except Exception as e:
print(f'{item} could not exported because {e.args}')
continue
if len(item) == 2:
# plot can show errorbars
item_dic['yerr'] = item[1].opts['topData']
@ -607,9 +612,10 @@ class QGraphWindow(QtWidgets.QGraphicsView, Ui_GraphWindow):
for item in self._external_items:
try:
dic['items'].append(item.get_data_opts())
except AttributeError:
print(f'{item} is missing "get_data_opts()"')
except Exception as e:
print(f'{item} could not be exported because {e.args}')
continue
in_legend.append(False)
dic['in_legend'] = in_legend