mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Tools: Fix recursive filtering (#4597)
* check for 'filterRegExp' first * use recursive filtering option if is available
This commit is contained in:
parent
a7f0d57638
commit
86184a8ee0
6 changed files with 33 additions and 23 deletions
|
|
@ -27,10 +27,10 @@ class RecursiveSortFilterProxyModel(QtCore.QSortFilterProxyModel):
|
|||
if not parent.isValid():
|
||||
return False
|
||||
|
||||
if hasattr(self, "filterRegularExpression"):
|
||||
regex = self.filterRegularExpression()
|
||||
else:
|
||||
if hasattr(self, "filterRegExp"):
|
||||
regex = self.filterRegExp()
|
||||
else:
|
||||
regex = self.filterRegularExpression()
|
||||
|
||||
pattern = regex.pattern()
|
||||
if pattern and regex.isValid():
|
||||
|
|
@ -111,10 +111,10 @@ class SearchEntitiesDialog(QtWidgets.QDialog):
|
|||
|
||||
def _on_filter_timer(self):
|
||||
text = self._filter_edit.text()
|
||||
if hasattr(self._proxy, "setFilterRegularExpression"):
|
||||
self._proxy.setFilterRegularExpression(text)
|
||||
else:
|
||||
if hasattr(self._proxy, "setFilterRegExp"):
|
||||
self._proxy.setFilterRegExp(text)
|
||||
else:
|
||||
self._proxy.setFilterRegularExpression(text)
|
||||
|
||||
# WARNING This expanding and resizing is relatively slow.
|
||||
self._view.expandAll()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue