Esempio n. 1
0
 def setModelData(self, editor, model, index):
     """ Get the data from our custom editor and stuffs it into the model.
     """
     if index.column() == 6:
         model.setData(index, editor.starRating.starCount)
     else:
         QStyledItemDelegate.setModelData(self, editor, model, index)
Esempio n. 2
0
 def setModelData(self, editor, model, index):
     """ Get the data from our custom editor and stuffs it into the model.
     """
     if index.column() == 3:
         model.setData(index, editor.starRating.starCount)
     else:
         QStyledItemDelegate.setModelData(self, editor, model, index)
    def setModelData(self, editor, model, index):
#        if index.column() == TEU:
#            model.setData(index, QVariant(editor.value()))
#        elif index.column() in (OWNER, COUNTRY):
#            model.setData(index, QVariant(editor.currentText()))
#        elif index.column() == NAME:
#            model.setData(index, QVariant(editor.text()))
#        elif index.column() == DESCRIPTION:
#            model.setData(index, QVariant(editor.toSimpleHtml()))
        if index.model().dataMode == sbml_entities.TYPE.REACTION:
            self.setModelDataReaction(editor, model, index)
        else:
            QStyledItemDelegate.setModelData(self, editor, model, index)
Esempio n. 4
0
 def setModelData(self, editor, model, index):
     #        if index.column() == TEU:
     #            model.setData(index, QVariant(editor.value()))
     #        elif index.column() in (OWNER, COUNTRY):
     #            model.setData(index, QVariant(editor.currentText()))
     #        elif index.column() == NAME:
     #            model.setData(index, QVariant(editor.text()))
     #        elif index.column() == DESCRIPTION:
     #            model.setData(index, QVariant(editor.toSimpleHtml()))
     if index.model().dataMode == sbml_entities.TYPE.REACTION:
         self.setModelDataReaction(editor, model, index)
     else:
         QStyledItemDelegate.setModelData(self, editor, model, index)
 def setModelData(self, editor, model, index):
     # send modification to model
     if index.column() in (NODE_NAME, NODE_FILE):
         index_str = index.model().data(index, Qt.DisplayRole)
         if index_str != editor.text():
             if index.column() == NODE_FILE \
                     and not MTTSettings.value('showRealAttributeValue'):
                 if not index_str.startswith('\\'):
                     index_str = cmds.workspace(projectPath=index_str)
                 if index_str == editor.text():
                     return
             model.setData(index, editor.text())
     else:
         QStyledItemDelegate.setModelData(self, editor, model, index)
Esempio n. 6
0
 def setModelData(self, editor, model, index):
     # send modification to model
     if index.column() in (NODE_NAME, NODE_FILE):
         index_str = index.model().data(index, Qt.DisplayRole)
         if index_str != editor.text():
             if index.column() == NODE_FILE \
                     and not MTTSettings.value('showRealAttributeValue'):
                 if not index_str.startswith('\\'):
                     index_str = cmds.workspace(projectPath=index_str)
                 if index_str == editor.text():
                     return
             model.setData(index, editor.text())
     else:
         QStyledItemDelegate.setModelData(self, editor, model, index)
 def setModelDataReaction(self, editor, model, index):
     if index.column() == sbml_entitytablemodel.REACTION_ROW.REACTANTS:
         model.setData(index, editor.currentText())
     else:
         QStyledItemDelegate.setModelData(self, editor, model, index)
Esempio n. 8
0
 def setModelDataReaction(self, editor, model, index):
     if index.column() == sbml_entitytablemodel.REACTION_ROW.REACTANTS:
         model.setData(index, editor.currentText())
     else:
         QStyledItemDelegate.setModelData(self, editor, model, index)