我们从Python开源项目中,提取了以下16个代码示例,用于说明如何使用PyQt5.QtCore.Qt.CaseInsensitive()。
def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.createMenu() self.completingTextEdit = TextEdit() self.completer = QCompleter(self) self.completer.setModel(self.modelFromFile(':/resources/wordlist.txt')) self.completer.setModelSorting(QCompleter.CaseInsensitivelySortedModel) self.completer.setCaseSensitivity(Qt.CaseInsensitive) self.completer.setWrapAround(False) self.completingTextEdit.setCompleter(self.completer) self.setCentralWidget(self.completingTextEdit) self.resize(500, 300) self.setWindowTitle("Completer")
def __init__(self): super(self.__class__, self).__init__() self.setCaseSensitivity(Qt.CaseInsensitive) self.setMaxVisibleItems(5) #self.setCompletionMode(QCompleter.UnfilteredPopupCompletion) self.setCompletionMode(QCompleter.InlineCompletion)
def setCompleter(self, completer): self.cmp = completer self.cmp.setWidget(self) self.cmp.setCompletionMode(QCompleter.PopupCompletion) self.cmp.setCaseSensitivity(Qt.CaseInsensitive) self.textChanged.connect(self.tag_names_changed) self.cmp.activated.connect(self.insert_completion)
def setCompleter(self, completer): self.cmp = completer self.cmp.setWidget(self) self.cmp.setCompletionMode(QCompleter.PopupCompletion) self.cmp.setCaseSensitivity(Qt.CaseInsensitive) self.textChanged.connect(self.tag_names_changed) self.cmp.activated.connect(self.insertCompletion)
def set_completer(self, completer): self.cmp = completer if not self.cmp: return self.cmp.setWidget(self) self.cmp.setCompletionMode(QCompleter.PopupCompletion) self.cmp.setCaseSensitivity(Qt.CaseInsensitive)
def refresh(self): self.setUpdatesEnabled(False) pattern = self.patternComboBox.currentText() text = self.textComboBox.currentText() escaped = str(pattern) escaped.replace('\\', '\\\\') escaped.replace('"', '\\"') self.escapedPatternLineEdit.setText('"' + escaped + '"') rx = QRegExp(pattern) cs = Qt.CaseSensitive if self.caseSensitiveCheckBox.isChecked() else Qt.CaseInsensitive rx.setCaseSensitivity(cs) rx.setMinimal(self.minimalCheckBox.isChecked()) syntax = self.syntaxComboBox.itemData(self.syntaxComboBox.currentIndex()) rx.setPatternSyntax(syntax) palette = self.patternComboBox.palette() if rx.isValid(): palette.setColor(QPalette.Text, self.textComboBox.palette().color(QPalette.Text)) else: palette.setColor(QPalette.Text, Qt.red) self.patternComboBox.setPalette(palette) self.indexEdit.setText(str(rx.indexIn(text))) self.matchedLengthEdit.setText(str(rx.matchedLength())) for i in range(self.MaxCaptures): self.captureLabels[i].setEnabled(i <= rx.captureCount()) self.captureEdits[i].setEnabled(i <= rx.captureCount()) self.captureEdits[i].setText(rx.cap(i)) self.setUpdatesEnabled(True)
def setCompleter(self, c): if self._completer is not None: self._completer.activated.disconnect() self._completer = c c.setWidget(self) c.setCompletionMode(QCompleter.PopupCompletion) c.setCaseSensitivity(Qt.CaseInsensitive) c.activated.connect(self.insertCompletion)
def isSummary(self, text): re = QRegExp("(In )?((The|This) )?(%s )?.*(tutorial|example|demo|application)" % self.name, Qt.CaseInsensitive) return ('[' not in text) and (re.indexIn(text) >= 0)