From 2fcc0b7b95b124ba7e01aa148675cfdb52edf825 Mon Sep 17 00:00:00 2001 From: 3ll3d00d Date: Wed, 30 Oct 2024 10:01:02 +0000 Subject: [PATCH] fix reference to qevent type --- src/main/python/ui/delegates.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/python/ui/delegates.py b/src/main/python/ui/delegates.py index 81ff142..e697b89 100644 --- a/src/main/python/ui/delegates.py +++ b/src/main/python/ui/delegates.py @@ -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