Back out the change that removed delegates for read-only columns

This commit is contained in:
Charles Haley 2023-04-27 16:03:13 +01:00
parent 952dbdf508
commit 7b0cecdcbd

View File

@ -1153,10 +1153,9 @@ class BooksView(QTableView): # {{{
elif cc['datatype'] == 'enumeration': elif cc['datatype'] == 'enumeration':
set_item_delegate(colhead, self.cc_enum_delegate) set_item_delegate(colhead, self.cc_enum_delegate)
else: else:
if colhead in self._model.editable_cols: dattr = colhead+'_delegate'
dattr = colhead+'_delegate' delegate = colhead if hasattr(self, dattr) else 'text'
delegate = colhead if hasattr(self, dattr) else 'text' set_item_delegate(colhead, getattr(self, delegate+'_delegate'))
set_item_delegate(colhead, getattr(self, delegate+'_delegate'))
self.restore_state() self.restore_state()
self.set_ondevice_column_visibility() self.set_ondevice_column_visibility()