def __init__(self, parent=None): QComboBox.__init__(self, parent) self.setEditable(True) self.setLineEdit(EnLineEdit(self)) for item in self.ENCODINGS: self.addItem(item)
def __init__(self, parent=None, add_clear_action=True): QComboBox.__init__(self, parent) self.normal_background = 'rgb(255, 255, 255, 0%)' self.line_edit = SearchLineEdit(self) self.setLineEdit(self.line_edit) if add_clear_action: self.clear_action = self.add_action('clear_left.png') self.clear_action.triggered.connect(self.clear_clicked) c = self.line_edit.completer() c.setCompletionMode(c.PopupCompletion) c.highlighted[str].connect(self.completer_used) self.line_edit.key_pressed.connect(self.key_pressed, type=Qt.DirectConnection) # QueuedConnection as workaround for https://bugreports.qt-project.org/browse/QTBUG-40807 self.activated[str].connect(self.history_selected, type=Qt.QueuedConnection) self.setEditable(True) self.as_you_type = True self.timer = QTimer() self.timer.setSingleShot(True) self.timer.timeout.connect(self.timer_event, type=Qt.QueuedConnection) self.setInsertPolicy(self.NoInsert) self.setMaxCount(self.MAX_COUNT) self.setSizeAdjustPolicy(self.AdjustToMinimumContentsLengthWithIcon) self.setMinimumContentsLength(25) self._in_a_search = False self.tool_tip_text = self.toolTip()
def __init__(self, name, layout): QComboBox.__init__(self) self.setEditable(False) opt = options[name] self.choices = opt.choices tuple(map(self.addItem, opt.choices)) self.currentIndexChanged.connect(self.changed_signal.emit) init_opt(self, opt, layout)
def __init__(self, parent): QComboBox.__init__(self, parent) self.addItems([_('Normal'), _('Regex')]) self.setToolTip('<style>dd {margin-bottom: 1.5ex}</style>' + _( '''Select how the search expression is interpreted <dl> <dt><b>Normal</b></dt> <dd>The search expression is treated as normal text, calibre will look for the exact text.</dd> <dt><b>Regex</b></dt> <dd>The search expression is interpreted as a regular expression. See the User Manual for more help on using regular expressions.</dd> </dl>'''))
def __init__(self, parent): QComboBox.__init__(self, parent) self.addItems([_('Down'), _('Up')]) self.setToolTip('<style>dd {margin-bottom: 1.5ex}</style>' + _( ''' Direction to search: <dl> <dt><b>Down</b></dt> <dd>Search for the next match from your current position</dd> <dt><b>Up</b></dt> <dd>Search for the previous match from your current position</dd> </dl>'''))
def __init__(self, parent=None, is_half_star=False): QComboBox.__init__(self, parent) self.undo_stack = QUndoStack(self) self.undo, self.redo = self.undo_stack.undo, self.undo_stack.redo self.allow_undo = False self.is_half_star = is_half_star self._model = RatingModel(is_half_star=is_half_star, parent=self) self.setModel(self._model) self.delegate = QStyledItemDelegate(self) self.view().setItemDelegate(self.delegate) self.view().setStyleSheet("QListView { background: palette(window) }\nQListView::item { padding: 6px }") self.setMaxVisibleItems(self.count()) self.currentIndexChanged.connect(self.update_font)
def __init__(self, parent=None): QComboBox.__init__(self, parent) self.normal_background = 'rgb(255, 255, 255, 0%)' self.line_edit = SearchLineEdit(self) self.setLineEdit(self.line_edit) self.line_edit.key_pressed.connect(self.key_pressed, type=Qt.DirectConnection) self.activated[str].connect(self.saved_search_selected) # Turn off auto-completion so that it doesn't interfere with typing # names of new searches. completer = QCompleter(self) self.setCompleter(completer) self.setEditable(True) self.setInsertPolicy(self.NoInsert) self.setSizeAdjustPolicy(self.AdjustToMinimumContentsLengthWithIcon) self.setMinimumContentsLength(10) self.tool_tip_text = self.toolTip()
def __init__(self, parent, emphasize=False): QComboBox.__init__(self) self.addItems([_('Current file'), _('All text files'), _('Selected files')]) self.setToolTip('<style>dd {margin-bottom: 1.5ex}</style>' + _( ''' Where to search/replace: <dl> <dt><b>Current file</b></dt> <dd>Search only inside the currently opened file</dd> <dt><b>All text files</b></dt> <dd>Search in all text (HTML) files</dd> <dt><b>Selected files</b></dt> <dd>Search in the files currently selected in the Files Browser</dd> </dl>''')) self.emphasize = emphasize self.ofont = QFont(self.font()) if emphasize: f = self.emph_font = QFont(self.ofont) f.setBold(True), f.setItalic(True) self.setFont(f)
def __init__(self, parent=None): QComboBox.__init__(self, parent) self.normal_background = 'rgb(255, 255, 255, 0%)' self.line_edit = SearchLineEdit(self) self.setLineEdit(self.line_edit) c = self.line_edit.completer() c.setCompletionMode(c.PopupCompletion) c.highlighted[str].connect(self.completer_used) c.activated[str].connect(self.history_selected) self.line_edit.key_pressed.connect(self.key_pressed, type=Qt.DirectConnection) self.activated.connect(self.history_selected) self.setEditable(True) self.as_you_type = True self.timer = QTimer() self.timer.setSingleShot(True) self.timer.timeout.connect(self.timer_event, type=Qt.QueuedConnection) self.setInsertPolicy(self.NoInsert) self.setMaxCount(self.MAX_COUNT) self.setSizeAdjustPolicy(self.AdjustToMinimumContentsLengthWithIcon) self.setMinimumContentsLength(25) self._in_a_search = False self.tool_tip_text = self.toolTip()
def __init__(self, parent=None): QComboBox.__init__(self, parent) self.currentIndexChanged[int].connect(self.index_changed) self.help_text = '' self.state_set = False
def __init__(self, *args): QComboBox.__init__(self, *args) self.setEditable(True) self.setInsertPolicy(self.NoInsert) self.setMaxCount(10) self.setClearButtonEnabled = self.lineEdit().setClearButtonEnabled
def __init__(self, *args): QComboBox.__init__(self, *args) self.setLineEdit(EnLineEdit(self)) self.completer().setCaseSensitivity(Qt.CaseInsensitive) self.setMinimumContentsLength(20)
def __init__(self, parent, values, selected_key): QComboBox.__init__(self, parent) self.values = values self.populate_combo(selected_key)
def __init__(self, *args): QComboBox.__init__(self, *args) self.setEditable(True) self.setInsertPolicy(self.NoInsert) self.setMaxCount(10)
def __init__(self, parent, custom_columns, selected_column, initial_items=['']): QComboBox.__init__(self, parent) self.populate_combo(custom_columns, selected_column, initial_items)
def __init__(self, *args): QComboBox.__init__(self, *args) self.setEditable(True) self.setInsertPolicy(self.NoInsert) self.setMaxCount(10) self.setClearButtonEnabled = self.lineEdit().setClearButtonEnabled
def __init__(self, parent): QComboBox.__init__(self, parent) items = [_('All'), _('Installed'), _('Update available'), _('Not installed')] self.addItems(items)
def __init__(self, *args): QComboBox.__init__(self, *args) self.setEditable(True) self.setInsertPolicy(self.NoInsert) self.setMaxCount(10)
def __init__(self, parent, custom_columns={}, selected_column=''): QComboBox.__init__(self, parent) self.populate_combo(custom_columns, selected_column)
def __init__(self, parent, custom_columns={}, selected_column='', initial_items=['']): QComboBox.__init__(self, parent) self.populate_combo(custom_columns, selected_column, initial_items)
def __init__(self, parent, custom_columns={}, selected_column=''): QComboBox.__init__(self, parent) self.populate_combo(custom_columns, selected_column)
def __init__(self, parent): QComboBox.__init__(self, parent)
def __init__(self, parent=None): QComboBox.__init__(self, parent) self.setEditable(True)
def __init__(self, parent, series_columns): QComboBox.__init__(self, parent) self.series_columns = series_columns for key, column in six.iteritems(series_columns): self.addItem('%s (%s)' % (key, column['name'])) self.insertItem(0, 'Series')
def __init__(self, parent, values, selected_key): QComboBox.__init__(self, parent) self.values = values self.populate_combo(selected_key)
def __init__(self, parent): QComboBox.__init__(self, parent)
def __init__(self, *args): QComboBox.__init__(self, *args) self.setLineEdit(EnLineEdit(self)) self.completer().setCaseSensitivity(Qt.CaseInsensitive) self.setMinimumContentsLength(20)
def __init__(self, parent=None): QComboBox.__init__(self, parent) self.setEditable(True)
def __init__(self, parent=None): QComboBox.__init__(self, parent) self.currentIndexChanged[int].connect(self.index_changed) self.help_text = '' self.state_set = False
def __init__(self, parent, values, selected_value=None): QComboBox.__init__(self, parent) self.values = values if selected_value is not None: self.populate_combo(selected_value)
def __init__(self, parent): QComboBox.__init__(self, parent) items = [_('All'), _('Installed'), _('Update available'), _('Not installed')] self.addItems(items)
def __init__(self, parent, values, selected_value=None): QComboBox.__init__(self, parent) self.values = values if selected_value is not None: self.populate_combo(selected_value)