Пример #1
0
 def createEditor(self, parent, option, index):
     qde = QStyledItemDelegate.createEditor(self, parent, option, index)
     qde.setDisplayFormat(self.format)
     qde.setMinimumDateTime(UNDEFINED_QDATETIME)
     qde.setSpecialValueText(_('Undefined'))
     qde.setCalendarPopup(True)
     return qde
Пример #2
0
 def createEditor(self, parent, option, index):
     qde = QStyledItemDelegate.createEditor(self, parent, option, index)
     qde.setDisplayFormat(self.format)
     qde.setMinimumDateTime(UNDEFINED_QDATETIME)
     qde.setSpecialValueText(_('Undefined'))
     qde.setCalendarPopup(True)
     return qde
Пример #3
0
 def createEditor(self, parent, option, index):
     """
     Set double validator to default editor.
     """
     editor = QStyledItemDelegate.createEditor(self, parent, option,
                                               index)
     validator = QDoubleValidator(editor)
     editor.setValidator(validator)
     return editor
Пример #4
0
 def createEditor(self, parent, option, index):
     m = index.model()
     col = m.column_map[index.column()]
     key = m.db.field_metadata.key_to_label(col)
     if m.db.field_metadata[col]['datatype'] != 'comments':
         editor = EditWithComplete(parent)
         editor.set_separator(None)
         complete_items = sorted(list(m.db.all_custom(label=key)), key=sort_key)
         editor.update_items_cache(complete_items)
     else:
         editor = QStyledItemDelegate.createEditor(self, parent, option, index)
     return editor
Пример #5
0
 def createEditor(self, parent, option, index):
     m = index.model()
     col = m.column_map[index.column()]
     key = m.db.field_metadata.key_to_label(col)
     if m.db.field_metadata[col]['datatype'] != 'comments':
         editor = EditWithComplete(parent)
         editor.set_separator(None)
         complete_items = sorted(list(m.db.all_custom(label=key)),
                                 key=sort_key)
         editor.update_items_cache(complete_items)
     else:
         editor = QStyledItemDelegate.createEditor(self, parent, option,
                                                   index)
     return editor
Пример #6
0
 def createEditor(self, parent, option, index):
     sb = QStyledItemDelegate.createEditor(self, parent, option, index)
     sb.setMinimum(0)
     sb.setMaximum(5)
     sb.setSuffix(' ' + _('stars'))
     return sb
Пример #7
0
 def createEditor(self, parent, option, index):
     sb = QStyledItemDelegate.createEditor(self, parent, option, index)
     sb.setMinimum(0)
     sb.setMaximum(5)
     sb.setSuffix(' ' + _('stars'))
     return sb