def __init__(self, parent, id, model, **kwargs): self._id = id self._model = model self._isChecked = False self._externalId = None self._canBeChecked = kwargs.get('canBeChecked', False) self._editableExternalId = kwargs.get('editableExternalId', False) CTreeItem.__init__(self, parent, self._getValue())
def __init__(self, parent, field, id, model, name=None): CTreeItem.__init__(self, parent, '') self.model = model self._field = field self._id = id self._deleted = 0 if name: self._name = name else: self.initName()
def __init__(self, parent, model, action): CTreeItem.__init__(self, parent, u'') self._model = model # type: CJobTicketProbeModel self._action = action # type: CAction self._ttj = action.takenTissueJournal if not self._ttj.tissueType: self._ttj.tissueType = self._parent.tissueTypeID() self._actionType = action.getType() # type: CActionType self._tissueTypes = self.loadTissueTypes()
def data(self, column): if column == EXTERNAL_ID_COLUMN: if self._externalId: return QtCore.QVariant(self._externalId) return QtCore.QVariant() elif column == ITEM_AMOUNT_COLUMN: return self.amount(column) else: return CTreeItem.data(self, column)
def flags(self, index=None): flags = CTreeItem.flags(self) if not self.saved(): if index and index.isValid() and self.canBeChecked(index.column()): flags |= QtCore.Qt.ItemIsUserCheckable if index and index.isValid() and self.editableExternalId(index.column()): flags |= QtCore.Qt.ItemIsEditable else: flags &= ~QtCore.Qt.ItemIsEnabled return flags
def __init__(self, parent, name, field, id, model, isTable=False, type='', comment='', number=1): CTreeItem.__init__(self, parent, name) self.model = model self._field = field self._id = id self._baseId = id self._isTable = isTable self._selected = False self._type = type self._comment = comment self._number = number self.setName()
def __init__(self, model, parent, cls, name): self._model = model # type: CActionsTreeModel self._cls = cls CTreeItem.__init__(self, parent, name)
def __init__(self, model, parent, action): self._model = model self._action = action # type: CAction self._amount = 1 self._mkb = '' CTreeItem.__init__(self, parent, action.getType().name)
def __init__(self, model): self._model = model # type: CActionsModel CTreeItem.__init__(self, None, u'')
def __init__(self, parent, model): self._model = model CTreeItem.__init__(self, parent, self._getName())
def __init__(self, parent, model, record): self._model = model # type: CJobTicketProbeModel self._record = record # type: QtSql.QSqlRecord self._id = forceRef(record.value('id')) CTreeItem.__init__(self, parent, u'')
def __init__(self, model): self._model = model # type: CJobTicketProbeModel self._items = [] CTreeItem.__init__(self, None, u'')
def flags(self): flags = CTreeItem.flags(self) if self._deleted == 1: flags = flags & ~QtCore.Qt.ItemIsEnabled return flags