本文整理汇总了Python中PyQt5.QtCore.Qt.CaseInsensitive方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.CaseInsensitive方法的具体用法?Python Qt.CaseInsensitive怎么用?Python Qt.CaseInsensitive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.CaseInsensitive方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import CaseInsensitive [as 别名]
def __init__(self, model, linktypes, fromname, parent=None):
super(DialogLinkTo, self).__init__(parent) # overrride accept method
self.linktype = None
self.linkitem = None
self.linktypes = linktypes
self.model = model
self.setupUi()
completer = QtWidgets.QCompleter()#[x['name'] for x in model.nativedata])
completer.setCompletionMode(QtWidgets.QCompleter.InlineCompletion)
completer.setCompletionColumn(0)
completer.setCompletionRole(Qt.DisplayRole)
completer.setCaseSensitivity(Qt.CaseInsensitive)
completer.setModel(model)
self.lineEdit.setCompleter(completer)
self.combo.setModel(linktypes)
self.setWindowTitle('Create link to %s'%fromname)
self.setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed);
示例2: set_pattern
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import CaseInsensitive [as 别名]
def set_pattern(self, val):
"""Setter for pattern.
Args:
val: The value to set.
"""
self._pattern = val
val = re.sub(r' +', r' ', val) # See #1919
val = re.escape(val)
val = val.replace(r'\ ', '.*')
rx = QRegExp(val, Qt.CaseInsensitive)
self.setFilterRegExp(rx)
self.invalidate()
sortcol = 0
self.sort(sortcol)
示例3: filter_table
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import CaseInsensitive [as 别名]
def filter_table(self, text):
reg_exp = QRegExp(text, Qt.CaseInsensitive)
self.setFilterRegExp(reg_exp)
示例4: _on_user_find_success
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import CaseInsensitive [as 别名]
def _on_user_find_success(self, job):
users = job.ret
completer = QCompleter(users)
completer.setCaseSensitivity(Qt.CaseInsensitive)
self.line_edit_share.setCompleter(completer)
self.line_edit_share.completer().complete()
示例5: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import CaseInsensitive [as 别名]
def __init__(
self,
message,
placeholder="",
default_text="",
completion=None,
button_text=None,
validator=None,
):
super().__init__()
self.setupUi(self)
self.dialog = None
button_text = button_text or _("ACTION_OK")
self.button_ok.setText(button_text)
self.label_message.setText(message)
self.line_edit_text.setPlaceholderText(placeholder)
self.line_edit_text.setText(default_text)
if validator:
self.line_edit_text.setValidator(validator)
if completion:
completer = QCompleter(completion)
completer.setCaseSensitivity(Qt.CaseInsensitive)
completer.popup().setStyleSheet("border: 1px solid rgb(30, 78, 162);")
self.line_edit_text.setCompleter(completer)
self.button_ok.clicked.connect(self._on_button_clicked)
self.setFocus()
self.line_edit_text.setFocus()
示例6: setCompleter
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import CaseInsensitive [as 别名]
def setCompleter(self, completer):
self.completer.setWidget(self)
completer.setCompletionMode(QCompleter.PopupCompletion)
completer.setCaseSensitivity(Qt.CaseInsensitive)
self.completer = completer
self.completer.insertText.connect(self.insertCompletion)
示例7: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import CaseInsensitive [as 别名]
def __init__(self, parent=None, show_linenumes=False, completer=True):
super(JsCodeEditor, self).__init__(parent)
self.setFont(get_os_monospace_font())
self._show_linenums = show_linenumes
keywords = []
keywords_path = home_path() + 'keywords.json'
if os.path.exists(keywords_path):
with open(keywords_path, 'r') as f:
try:
keywords = json.load(f)
except:
pass
if self._show_linenums:
self.ui_line_numbers = JsCodeEditLineNums(self)
self.blockCountChanged.connect(self.update_linenum_width)
self.updateRequest.connect(self.update_line_numbers)
self.update_linenum_width(0)
self.setAutoFillBackground(True)
# default distance is 80
self.setTabStopDistance(self.fontMetrics().width('9999'))
self.highlighter = JsHighlighter(keywords, parent=self.document())
if completer:
# code completion
self.completer = DwarfCompleter(keywords)
self.completer.setWidget(self)
self.completer.setCompletionMode(QCompleter.PopupCompletion)
self.completer.setCaseSensitivity(Qt.CaseInsensitive)
self.completer.insertText.connect(self.insertCompletion)
else:
self.completer = None
示例8: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import CaseInsensitive [as 别名]
def __init__(self, string_list, parent=None):
super(ExtendedComboBox, self).__init__(parent)
self.setFocusPolicy(Qt.StrongFocus)
self.setEditable(True)
# add a filter model to filter matching items
self.pFilterModel = QSortFilterProxyModel(self)
self.pFilterModel.setFilterCaseSensitivity(Qt.CaseInsensitive)
self.pFilterModel.setSourceModel(self.model())
# add a completer, which uses the filter model
self.completer = QCompleter(self.pFilterModel, self)
# always show all (filtered) completions
self.completer.setCompletionMode(QCompleter.UnfilteredPopupCompletion)
self.setCompleter(self.completer)
# connect signals
self.lineEdit().textEdited.connect(self.pFilterModel.setFilterFixedString)
self.completer.activated.connect(self.on_completer_activated)
# either fill the standard model of the combobox
self.addItems(string_list)
# or use another model
# combo.setModel(QStringListModel(string_list))
# on selection of an item from the completer, select the corresponding item from combobox
示例9: setAutocomplete
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import CaseInsensitive [as 别名]
def setAutocomplete(self):
# Setando Auto complete
self.completer = QCompleter(self)
self.completer.setCaseSensitivity(Qt.CaseInsensitive)
self.completer.setCompletionMode(QCompleter.PopupCompletion)
self.model = QStringListModel(self)
self.completer.setModel(self.model)
self.tx_BuscaItem.setCompleter(self.completer)
self.tx_NomeFantasia.setCompleter(self.completer)
# AutoComplete Produtos