Skip to content

Commit

Permalink
Fix flags for plot column when item is not a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
t-sommer committed Nov 21, 2024
1 parent 7995289 commit 694d932
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions fmpy/gui/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,14 @@ def flags(self, index):

column = self.COLUMN_NAMES[index.column()]

if column == 'Plot':
variable = self.variableForIndex(index)
if not variable or variable.dimensions:
return Qt.ItemIsSelectable
return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable
elif column == 'Start':
if column == 'Start':
return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsEditable
else:
return Qt.ItemIsEnabled | Qt.ItemIsSelectable
elif column == 'Plot':
variable = self.variableForIndex(index)
if variable and not variable.dimensions:
return Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable

return Qt.ItemIsEnabled | Qt.ItemIsSelectable

def setData(self, index: QModelIndex | QPersistentModelIndex, value: Any, role: int):

Expand Down

0 comments on commit 694d932

Please sign in to comment.