eric6/Preferences/ShortcutsDialog.py

changeset 7775
4a1db75550bd
parent 7360
9190402e4505
child 7900
72b88fb20261
child 7924
8a96736d465e
--- a/eric6/Preferences/ShortcutsDialog.py	Sat Oct 10 16:03:53 2020 +0200
+++ b/eric6/Preferences/ShortcutsDialog.py	Sun Oct 11 17:54:52 2020 +0200
@@ -8,8 +8,9 @@
 shortcuts.
 """
 
+import re
 
-from PyQt5.QtCore import pyqtSignal, QRegExp, Qt, pyqtSlot
+from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt
 from PyQt5.QtGui import QKeySequence
 from PyQt5.QtWidgets import QHeaderView, QDialog, QTreeWidgetItem
 
@@ -462,6 +463,7 @@
         
         @param txt text of the search edit (string)
         """
+        rx = re.compile(re.escape(txt), re.IGNORECASE)
         for topIndex in range(self.shortcutsList.topLevelItemCount()):
             topItem = self.shortcutsList.topLevelItem(topIndex)
             childHiddenCount = 0
@@ -469,8 +471,7 @@
                 itm = topItem.child(index)
                 if (
                     (self.actionButton.isChecked() and
-                     not QRegExp(txt, Qt.CaseInsensitive).indexIn(
-                        itm.text(0)) > -1) or
+                     rx.search(itm.text(0)) is not None) or
                     (self.shortcutButton.isChecked() and
                      not txt.lower() in itm.text(1).lower() and
                      not txt.lower() in itm.text(2).lower())

eric ide

mercurial