def flags(self, index): if index.column() == 0: return QAbstractItemModel.flags( self, index) | Qt.ItemFlag.ItemIsUserCheckable return QAbstractItemModel.flags(self, index)
def flags(self, index): ans = QAbstractItemModel.flags(self, index) ip = index.internalPointer() if getattr(ip, 'is_shortcut', False): ans |= Qt.ItemFlag.ItemIsEditable return ans