Drop code for pre Qt 5.15 versions

This commit is contained in:
Veronica Berglyd Olsen
2024-04-16 23:45:59 +02:00
parent 1733938eb4
commit ac7b0bc9a2
5 changed files with 21 additions and 54 deletions
+1 -11
View File
@@ -370,17 +370,7 @@ class DocSearch:
def _buildPattern(self, search: str) -> str:
"""Build the search pattern string."""
if self._escape:
if CONFIG.verQtValue >= 0x050f00:
search = QRegularExpression.escape(search)
else:
# For older Qt versions, we escape manually
escaped = ""
for c in search:
if c.isalnum() or c == "_":
escaped += c
else:
escaped += f"\\{c}"
search = escaped
search = QRegularExpression.escape(search)
if self._words:
search = f"(?:^|\\b){search}(?:$|\\b)"
return search