Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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