本文整理汇总了Python中spyderlib.widgets.comboboxes.PatternComboBox.add_text方法的典型用法代码示例。如果您正苦于以下问题:Python PatternComboBox.add_text方法的具体用法?Python PatternComboBox.add_text怎么用?Python PatternComboBox.add_text使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spyderlib.widgets.comboboxes.PatternComboBox
的用法示例。
在下文中一共展示了PatternComboBox.add_text方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: FindOptions
# 需要导入模块: from spyderlib.widgets.comboboxes import PatternComboBox [as 别名]
# 或者: from spyderlib.widgets.comboboxes.PatternComboBox import add_text [as 别名]
#.........这里部分代码省略.........
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
@Slot(bool)
def toggle_more_options(self, state):
for layout in self.more_widgets:
for index in range(layout.count()):
if state and self.isVisible() or not state:
layout.itemAt(index).widget().setVisible(state)
if state:
icon = ima.icon('options_less')
tip = _('Hide advanced options')
else:
icon = ima.icon('options_more')
tip = _('Show advanced options')
self.more_options.setIcon(icon)
self.more_options.setToolTip(tip)
def update_combos(self):
self.search_text.lineEdit().returnPressed.emit()
self.include_pattern.lineEdit().returnPressed.emit()
self.exclude_pattern.lineEdit().returnPressed.emit()
def detect_hg_repository(self, path=None):
if path is None:
path = getcwd()
hg_repository = is_hg_installed() and get_vcs_root(path) is not None
self.hg_manifest.setEnabled(hg_repository)
if not hg_repository and self.hg_manifest.isChecked():
self.custom_dir.setChecked(True)
def set_search_text(self, text):
if text:
self.search_text.add_text(text)
self.search_text.lineEdit().selectAll()
self.search_text.setFocus()
def get_options(self, all=False):
# Getting options
utext = to_text_string(self.search_text.currentText())
if not utext:
return
try:
texts = [(utext.encode('ascii'), 'ascii')]
except UnicodeEncodeError:
texts = []
for enc in self.supported_encodings:
try:
texts.append((utext.encode(enc), enc))
except UnicodeDecodeError:
pass
text_re = self.edit_regexp.isChecked()
include = to_text_string(self.include_pattern.currentText())
include_re = self.include_regexp.isChecked()
exclude = to_text_string(self.exclude_pattern.currentText())
exclude_re = self.exclude_regexp.isChecked()
python_path = self.python_path.isChecked()
hg_manifest = self.hg_manifest.isChecked()
path = osp.abspath( to_text_string( self.dir_combo.currentText() ) )
# Finding text occurrences
if not include_re:
include = fnmatch.translate(include)
if not exclude_re:
exclude = fnmatch.translate(exclude)