Ejemplo n.º 1
0
 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())
Ejemplo n.º 2
0
 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()
Ejemplo n.º 3
0
    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()
Ejemplo n.º 4
0
 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)
Ejemplo n.º 5
0
 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
Ejemplo n.º 6
0
 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()
Ejemplo n.º 7
0
 def __init__(self, model, parent, cls, name):
     self._model = model  # type: CActionsTreeModel
     self._cls = cls
     CTreeItem.__init__(self, parent, name)
Ejemplo n.º 8
0
 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)
Ejemplo n.º 9
0
 def __init__(self, model):
     self._model = model  # type: CActionsModel
     CTreeItem.__init__(self, None, u'')
Ejemplo n.º 10
0
 def __init__(self, parent, model):
     self._model = model
     CTreeItem.__init__(self, parent, self._getName())
Ejemplo n.º 11
0
 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'')
Ejemplo n.º 12
0
 def __init__(self, model):
     self._model = model  # type: CJobTicketProbeModel
     self._items = []
     CTreeItem.__init__(self, None, u'')
Ejemplo n.º 13
0
 def flags(self):
     flags = CTreeItem.flags(self)
     if self._deleted == 1:
         flags = flags & ~QtCore.Qt.ItemIsEnabled
     return flags