def editorEvent(self, event, model, option, index): if index.column() in (COLOR, COLORLABEL): if not int(index.flags() & Qt.ItemIsEditable) > 0: return False if event.type() == QEvent.MouseButtonRelease \ and event.button() == Qt.RightButton: self.setModelData(None, model, index) return True return False else: return QItemDelegate.editorEvent(self, event, model, option, index)
def editorEvent(self, event, model, option, index): if self._is_relationship_index(index): return super().editorEvent(event, model, option, index) return QItemDelegate.editorEvent(self, event, model, option, index)