Skip to content

Commit

Permalink
Casting input value to setData to a CheckState for correct comparison (
Browse files Browse the repository at this point in the history
  • Loading branch information
pshriwise authored Jun 6, 2024
1 parent f58d349 commit c2761a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions openmc_plotter/plotmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1314,10 +1314,10 @@ def setData(self, index, value, role=Qt.EditRole):
self.domains.set_color(key, value)
elif column == MASK:
if role == Qt.CheckStateRole:
self.domains.set_masked(key, value == Qt.Checked)
self.domains.set_masked(key, Qt.CheckState(value) == Qt.Checked)
elif column == HIGHLIGHT:
if role == Qt.CheckStateRole:
self.domains.set_highlight(value == Qt.Checked)
self.domains.set_highlight(Qt.CheckState(value) == Qt.Checked)

self.dataChanged.emit(index, index)
return True
Expand Down Expand Up @@ -1367,7 +1367,7 @@ def setEditorData(self, editor, index):
def editorEvent(self, event, model, option, index):

if index.column() in (COLOR, COLORLABEL):
if not (index.flags() & Qt.ItemIsEditable).value > 0:
if not int(index.flags() & Qt.ItemIsEditable) > 0:
return False
if event.type() == QEvent.MouseButtonRelease \
and event.button() == Qt.RightButton:
Expand Down

0 comments on commit c2761a0

Please sign in to comment.