File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
python/plugins/processing/gui Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ def textChanged(self, text=None):
138138 text = str (text .lower ())
139139 else :
140140 text = str (self .searchBox .text ().lower ())
141- self ._filterItem (self .model .invisibleRootItem (), text )
141+ found = self ._filterItem (self .model .invisibleRootItem (), text )
142142
143143 self .auto_adjust_columns = False
144144 if text :
@@ -150,18 +150,17 @@ def textChanged(self, text=None):
150150 self .auto_adjust_columns = True
151151
152152 if text :
153- return True
153+ return found
154154 else :
155155 self .tree .collapseAll ()
156156 return False
157157
158158 def _filterItem (self , item , text ):
159159 if item .hasChildren ():
160- show = False
160+ show = isinstance ( item , QStandardItem ) and bool ( text ) and ( text in item . text (). lower ())
161161 for i in range (item .rowCount ()):
162162 child = item .child (i )
163- showChild = self ._filterItem (child , text )
164- show = (showChild or show )
163+ show = self ._filterItem (child , text ) or show
165164 self .tree .setRowHidden (item .row (), item .index ().parent (), not show )
166165 return show
167166
You can’t perform that action at this time.
0 commit comments