def __init__(self, parent=None): CTreeModel.__init__(self, parent, CPaymentSchemeRootTreeItem(self)) self._types = range(2) # 2 - количество типов схемы оплаты self._clientId = None self._enrollmentIsOpen = None self._begDate = QtCore.QDate.currentDate() self._endDate = None
def __init__(self, parent): CTreeModel.__init__(self, parent, CJobTicketProbeRootItem(self)) self.rootItemVisible = False self._actionList = [] self._mapContainerTypeIdToActionList = {} self._parent = parent self.resetCache() self._currentTakenTissueExternalId = None
def __init__(self, parent, actionModelsItemList, clientId): self._actionModelsItemList = actionModelsItemList self._clientId = clientId CTreeModel.__init__(self, parent, CEventJobTicketsRootItem(self)) self.rootItemVisible = False self._jobIdToTicketDuration = {} self.getRootItem().setChecked(True) self.fromEvent = False
def __init__(self, parent=None): self._root = CActionsRootItem(self) self._parent = parent CTreeModel.__init__(self, parent, self._root) self._items = dict() self.setRootItemVisible(False) self.notDeletedActionTypes = {} self.eventEditor = None self.init()
def __init__(self, parent, orgId=None, orgStructureId=None, emptyRootName=None, purpose=None, filter=None, headerName=u'Структура ЛПУ'): self.orgId = orgId self.orgStructureId = orgStructureId self.emptyRootName = emptyRootName self.purpose = purpose self.filter = filter self.headerName = headerName CTreeModel.__init__(self, parent, None) self.connect(QtGui.qApp, QtCore.SIGNAL('currentUserIdChanged()'), self.updateItems)
def __init__(self, parent=None, enabledActionTypeIdList=None): CTreeModel.__init__(self, parent, CActionTypeRootTreeItem(self)) self._enabledActionTypeIdList = enabledActionTypeIdList self._classes = ActionClass.All self._classesVisible = False self._allSelectable = False self._leavesVisible = True self._disabledActionTypeIdList = self.getDisabledForProfileActionTypeIdList( ) self._clientSex = 0 self._clientAge = None
def __init__(self, parent, view): self._root = CJobTicketRealRootItem(self) CTreeModel.__init__(self, parent, self._root) self.rootItemVisible = False self._actionList = [] self._tissueTypes = dict() self._actionTree = dict() self._parent = parent self._view = view # type: CJobTicketProbeTreeView2 self._editable = True for record in QtGui.qApp.db.getRecordList('rbTissueType', '*'): self._tissueTypes[forceRef(record.value('id'))] = record
def __init__(self, parent, actionTypeId, personId, specialityId, clientSex, clientAge, removeEmptyNodes=True): CTreeModel.__init__( self, parent, CActionTemplateRootTreeItem( self, CActionTemplateModel.CFilter(actionTypeId, personId, specialityId, clientSex, clientAge, removeEmptyNodes))) self.rootItemVisible = False
def flags(self, index): column = index.column() flags = CTreeModel.flags(self, index) item = index.internalPointer() if self._editable and (column == TreeColumns.EXTERNAL_ID or column == TreeColumns.TISSUE_TYPE and isinstance(item, CJobTicketTreeActionItem)): return flags | QtCore.Qt.ItemIsEditable else: return flags
def __init__(self, parent): CTreeModel.__init__( self, parent, CQueryFieldsHeadTreeItem(None, u'все', '', 0, self)) self.tableTableName = 'rcTable' self.tableFieldName = 'rcField' self.idColName = 'id' self.groupColName = 'rcTable_id' self.nameColName = 'name' self.refColName = 'ref_id' self.fieldColName = 'field' self._filter = None self.order = self.nameColName self.leavesVisible = False self._defaultRootItem = self._rootItem self.rootItemVisible = False self._items = {} self._tables = {} self._modelParams = None self._modelFunctions = None
def data(self, index, role=QtCore.Qt.DisplayRole): if not index.isValid(): return QtCore.QVariant() column = index.column() if role == QtCore.Qt.EditRole: item = index.internalPointer() if item: return item.data(index.column()) else: return CTreeModel.data(self, index, role)
def __init__(self, parent, baseModel, modelParams): CTreeModel.__init__( self, parent, CRCConditionTreeItem(None, '', 0, self, name=u'Все')) self._table = 'rcQuery_Conditions' self.idColName = 'id' self.groupColName = 'parent_id' self.nameColName = 'field' self._masterIdFieldName = 'master_id' self._parent = parent self._baseModel = baseModel self._items = {} self._modelConditionType = CRCConditionTypeItemModel( self, ['code', 'name', 'sign'], 'rcConditionType') self._modelValueType = CRCItemModel(self, ['code', 'name'], 'rcValueType') self._modelParams = modelParams self._modelConditionType.loadItems() self._modelValueType.loadItems() self._maxId = None self.rootItemVisible = False self.loadDefault()
def data(self, index, role): if index.column() == TreeColumns.CONTAINER_TYPE: bg = index.internalPointer().containerColor() if isinstance(bg, QtGui.QColor): if role == QtCore.Qt.BackgroundRole: return QtGui.QBrush(bg) elif role == QtCore.Qt.ForegroundRole: # http://stackoverflow.com/a/1855903/5139327 a = 1 - (.299 * bg.red() + .587 * bg.green() + .114 * bg.blue()) / 255 return QtGui.QBrush( QtCore.Qt.black if a < .5 else QtCore.Qt.white) return CTreeModel.data(self, index, role)
def data(self, index, role=QtCore.Qt.DisplayRole): if not index.isValid(): return QtCore.QVariant() column = index.column() if role == QtCore.Qt.CheckStateRole and column == CEventJobTicketsItem.nameColumn: item = index.internalPointer() if item: return QtCore.QVariant(QtCore.Qt.Checked if item.checked() else QtCore.Qt.Unchecked) elif role == QtCore.Qt.EditRole: item = index.internalPointer() if item: if column == CEventJobTicketsItem.jobTicketColumn: return QtCore.QVariant(item.jobTicketId()) elif column == CEventJobTicketsItem.jobTicketLIDColumn and item._ttjRecord: return toVariant(forceString(item._ttjRecord.value('externalId'))) return CTreeModel.data(self, index, role)
def flags(self, index): flags = CTreeModel.flags(self, index) item = index.internalPointer() if not item.bookkeeperCode(): flags = flags & ~QtCore.Qt.ItemIsEnabled return flags
def reset(self): self.buildActionTree() self._root.updateChildren() CTreeModel.reset(self) self._view.expandAll()
def __init__(self, parent=None, filter=None): if not filter: filter = {} CTreeModel.__init__(self, parent, CActionBlankRootTreeItem(filter))
def rowCount(self, parent=QtCore.QModelIndex()): return CTreeModel.rowCount(self, parent)
def __init__(self, id, parent=None): CTreeModel.__init__(self, parent, CPharmGroupRootTreeItem(id))
def __init__(self, parent=None): CTreeModel.__init__(self, parent, CActionPropertyTemplateRootTreeItem())
def __init__(self, parent=None, filter=None): if not filter: filter = {} CTreeModel.__init__(self, parent, CHospitalBedRootTreeItem(filter))
def match(self, start, role, value, hits=1, flags=None, *args, **kwargs): start = self.index(start.row(), 1, start.parent()) return CTreeModel.match(self, start, role, value, hits, flags, *args, **kwargs)
def __init__(self, id, parent=None): CTreeModel.__init__(self, parent, CATCRootTreeItem(id))
def __init__(self, parent=None): self._orgStructure = None CTreeModel.__init__(self, parent, CRootItem(None)) self.rootItemVisible = False