File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -325,19 +325,17 @@ def filterFunc(self):
325325 def filterAcceptsRow (self , row , parent = QModelIndex ()):
326326 flat_model = self .sourceModel ()
327327 index = flat_model .index (row , self .filterKeyColumn (), parent )
328- keywords = flat_model .data (index , role = QtWidgetRegistry .WIDGET_DESC_ROLE ).keywords
328+ description = flat_model .data (index , role = QtWidgetRegistry .WIDGET_DESC_ROLE )
329+ name = description .name
330+ keywords = description .keywords
329331
330- # match keywords
332+ # match name and keywords
331333 accepted = False
332- for keyword in keywords :
334+ for keyword in [ name ] + keywords :
333335 if self .filterRegExp ().indexIn (keyword ) > - 1 :
334336 accepted = True
335337 break
336338
337- # if does not match keywords, match title
338- if not accepted :
339- accepted = QSortFilterProxyModel .filterAcceptsRow (self , row , parent )
340-
341339 # if matches query, apply filter function (compatibility with paired widget)
342340 if accepted and self .__filterFunc is not None :
343341 model = self .sourceModel ()
You can’t perform that action at this time.
0 commit comments