Example #1
0
 def __init__(self, parent):
     '''
     Delegate for custom_column bool data.
     '''
     QStyledItemDelegate.__init__(self, parent)
     self.disallow_edit = gprefs[
         'edit_metadata_templates_only_F2_on_booklist']
Example #2
0
 def __init__(self, parent, tweak_name='gui_timestamp_display_format',
         default_format='dd MMM yyyy'):
     QStyledItemDelegate.__init__(self, parent)
     self.table_widget = parent
     self.tweak_name = tweak_name
     self.format = tweaks[self.tweak_name]
     if self.format is None:
         self.format = default_format
Example #3
0
 def __init__(self, parent):
     '''
     Delegate for text data. If auto_complete_function needs to return a list
     of text items to auto-complete with. If the function is None no
     auto-complete will be used.
     '''
     QStyledItemDelegate.__init__(self, parent)
     self.table_widget = parent
     self.auto_complete_function = None
Example #4
0
 def __init__(self, *args, **kwargs):
     QStyledItemDelegate.__init__(self, *args)
     self.is_half_star = kwargs.get('is_half_star', False)
     self.table_widget = args[0]
     self.rf = QFont(rating_font())
     self.em = Qt.TextElideMode.ElideMiddle
     delta = 0
     if iswindows and sys.getwindowsversion().major >= 6:
         delta = 2
     self.rf.setPointSize(QFontInfo(QApplication.font()).pointSize()+delta)
Example #5
0
 def __init__(self, parent=None):
     QStyledItemDelegate.__init__(self, parent)
Example #6
0
 def __init__(self, parent):
     '''
     Delegate for custom_column bool data.
     '''
     QStyledItemDelegate.__init__(self, parent)
     self.table_widget = parent
Example #7
0
 def __init__(self, parent):
     QStyledItemDelegate.__init__(self, parent)
     self.document = QTextDocument()
Example #8
0
 def __init__(self, parent):
     QStyledItemDelegate.__init__(self, parent)
     self.table_widget = parent
     self.longest_text = ''
Example #9
0
 def __init__(self, parent):
     QStyledItemDelegate.__init__(self, parent)
     self.table_widget = parent
Example #10
0
 def __init__(self, parent, sep, items_func_name, space_before_sep=False):
     QStyledItemDelegate.__init__(self, parent)
     self.sep = sep
     self.items_func_name = items_func_name
     self.space_before_sep = space_before_sep
     self.table_widget = parent
Example #11
0
 def __init__(self, *args, **kwargs):
     QStyledItemDelegate.__init__(self, *args, **kwargs)
     self.format = tweaks['gui_pubdate_display_format']
     self.table_widget = args[0]
     if self.format is None:
         self.format = 'MMM yyyy'
Example #12
0
 def __init__(self, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.item_size = QSize(32, 32)
     self.np_pat = re.compile(r'(sp|j|nj|ss|fs|ds)$')
Example #13
0
 def __init__(self, view):
     QStyledItemDelegate.__init__(self, view)
     self.view = view
Example #14
0
 def __init__(self, parent=None):
     QStyledItemDelegate.__init__(self, parent)
     self.editing_indices = {}
     self.closeEditor.connect(self.editing_done)
Example #15
0
 def __init__(self, parent):
     QStyledItemDelegate.__init__(self, parent)
     self.animator = SpinAnimator(self)
     self.animator.updated.connect(self.needs_redraw)
     self.color = parent.palette().color(QPalette.ColorRole.WindowText)
     self.spinner_width = 64
Example #16
0
 def __init__(self, parent=None, max_width=160):
     QStyledItemDelegate.__init__(self, parent)
     self.max_width = max_width
     self.dummy_model = QStringListModel([' '], self)
     self.dummy_index = self.dummy_model.index(0)
Example #17
0
 def __init__(self, all_authors, parent):
     QStyledItemDelegate.__init__(self, parent)
     self.all_authors = all_authors