That way there is no need to change the argument order in get_str_list (which makes it more consistent with get_md) and it remove the if statement in the data method:
def data(self, index, role=None):
# display data
if role == QtCore.Qt.DisplayRole:
uid = self.uidList()[index.row()]
run = self.catalog()[uid]
label = self.columnLabels[index.column()]
action = self.actions_library[label]
return action(run)
I found an alternative using lambda:
That way there is no need to change the argument order in
get_str_list
(which makes it more consistent withget_md
) and it remove theif
statement in thedata
method:what do you think?
Originally posted by @rodolakis in https://github.com/BCDA-APS/gemviz/issues/126#issuecomment-1679577209