Skip to content
Permalink
Browse files

Fix hang in options search widget

  • Loading branch information
nyalldawson authored and 3nids committed Feb 5, 2018
1 parent 8d55cad commit c8d1d2d58897ee9709d4bb1c7c80a391d6514f43
Showing with 13 additions and 1 deletion.
  1. +13 −1 python/plugins/processing/gui/ConfigDialog.py
@@ -87,6 +87,7 @@ def helpKey(self):


class ProcessingTreeHighlight(QgsOptionsDialogHighlightWidget):

def __init__(self, config_dialog):
super(ProcessingTreeHighlight, self).__init__(config_dialog.tree)
self.config_dialog = config_dialog
@@ -130,15 +131,25 @@ def __init__(self, showSearch=True):

self.saveMenus = False
self.tree.expanded.connect(self.itemExpanded)
self.auto_adjust_columns = True

def textChanged(self, text=None):
if text is not None:
text = str(text.lower())
else:
text = str(self.searchBox.text().lower())
self._filterItem(self.model.invisibleRootItem(), text)

self.auto_adjust_columns = False
if text:
self.tree.expandAll()
else:
self.tree.collapseAll()

self.adjustColumns()
self.auto_adjust_columns = True

if text:
return True
else:
self.tree.collapseAll()
@@ -329,7 +340,8 @@ def accept(self):
def itemExpanded(self, idx):
if idx == self.menusItem.index():
self.saveMenus = True
self.adjustColumns()
if self.auto_adjust_columns:
self.adjustColumns()

def adjustColumns(self):
self.tree.resizeColumnToContents(0)

0 comments on commit c8d1d2d

Please sign in to comment.
You can’t perform that action at this time.