Skip to content

Commit

Permalink
fix reference to qevent type
Browse files Browse the repository at this point in the history
  • Loading branch information
3ll3d00d committed Oct 30, 2024
1 parent 41a0cd2 commit 2fcc0b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/python/ui/delegates.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ def paint(self, painter: QPainter, option: QStyleOptionViewItem, index: QModelIn
def editorEvent(self, event, model, option, index):
'''
Change the data in the model and the state of the checkbox
if the user presses the left mousebutton and this cell is editable. Otherwise do nothing.
if the user presses the left mouse button and this cell is editable otherwise do nothing.
'''
if not int(index.flags() & Qt.ItemFlag.ItemIsEditable) > 0:
if not index.flags() & Qt.ItemFlag.ItemIsEditable:
return False

if event.type() == Qt.MouseButton.MouseButtonPress and event.button() == Qt.MouseButton.LeftButton:
if event.type() == QEvent.Type.MouseButtonPress and event.button() == Qt.MouseButton.LeftButton:
model.toggle(index)
return True

Expand Down

0 comments on commit 2fcc0b7

Please sign in to comment.