def createEditor(self, parent, option, index):
     # special combobox for field type
     if index.column() == 1:
         cbo = QComboBox(parent)
         cbo.setEditable(True)
         cbo.setFrame(False)
         for item in self.fieldTypes:
             cbo.addItem(item)
         return cbo
     return QItemDelegate.createEditor(self, parent, option, index)
示例#2
0
 def createEditor(self, parent, option, index):
     # special combobox for field type
     if index.column() == 1:
         cbo = QComboBox(parent)
         cbo.setEditable(True)
         cbo.setFrame(False)
         for item in self.fieldTypes:
             cbo.addItem(item)
         return cbo
     return QItemDelegate.createEditor(self, parent, option, index)
示例#3
0
 def createEditor(self, parent, option, index):
     """
     Creates a custom editor to edit value map data
     """
     # special combobox for field type
     if index.column() == self.column:
         cbo = QComboBox(parent)
         for item in self.itemsDict:
             cbo.addItem(item, self.itemsDict[item])
         return cbo
     return QItemDelegate.createEditor(self, parent, option, index)
示例#4
0
 def createEditor(self, parent, option, index):
     """
     Creates a custom editor to edit value relation data
     """
     # special combobox for field type
     if index.column() == self.column:
         list = QListWidget(parent)
         for item in self.itemsDict:
             listItem = QListWidgetItem(item)
             listItem.setCheckState(Qt.Unchecked)
             list.addItem(listItem)
         return list
     return QItemDelegate.createEditor(self, parent, option, index)