def flags(self, index): row = index.row() editable = True if forceRef(self.value(row, 'quotaType_id')) in self.disabledTypeIdList: editable = False flags = CInDocTableModel.flags(self, index) if not editable: flags &= ~Qt.ItemIsEditable return flags
def flags(self, index): row = index.row() column = index.column() if column == self.ciCash: payable = forceInt(self.items()[row].value('payable')) if self.wholeEventForCash or payable == 2: return QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsUserCheckable elif payable == 0: return QtCore.Qt.ItemIsSelectable return CInDocTableModel.flags(self, index)
def flags(self, index=QtCore.QModelIndex()): result = CInDocTableModel.flags(self, index) row = index.row() if row < len(self._items): column = index.column() if self.isManualSwitchDiagnosis and index.isValid(): if column == self.columnHandleDiagnosis: characterId = forceRef( self.items()[row].value('character_id')) if characterId != self.characterIdForHandleDiagnosis: result = (result & ~QtCore.Qt.ItemIsUserCheckable) # return result if self.isMKBMorphology and index.isValid(): if column == self._mapFieldNameToCol.get('morphologyMKB'): mkb = forceString(self.items()[row].value('MKB')) if not (bool(mkb) and mkb[0] in CF106DiagnosticsModel.MKB_allowed_morphology): result = (result & ~QtCore.Qt.ItemIsEditable) if QtGui.qApp.isPNDDiagnosisMode() and ( row == len(self.items()) or index.column() != self._mapFieldNameToCol.get('result_id')): result = (result & ~QtCore.Qt.ItemIsEditable) return result