Skip to content

Commit c8d1d2d

Browse files
nyalldawson3nids
authored andcommittedFeb 5, 2018
Fix hang in options search widget
1 parent 8d55cad commit c8d1d2d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed
 

‎python/plugins/processing/gui/ConfigDialog.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def helpKey(self):
8787

8888

8989
class ProcessingTreeHighlight(QgsOptionsDialogHighlightWidget):
90+
9091
def __init__(self, config_dialog):
9192
super(ProcessingTreeHighlight, self).__init__(config_dialog.tree)
9293
self.config_dialog = config_dialog
@@ -130,15 +131,25 @@ def __init__(self, showSearch=True):
130131

131132
self.saveMenus = False
132133
self.tree.expanded.connect(self.itemExpanded)
134+
self.auto_adjust_columns = True
133135

134136
def textChanged(self, text=None):
135137
if text is not None:
136138
text = str(text.lower())
137139
else:
138140
text = str(self.searchBox.text().lower())
139141
self._filterItem(self.model.invisibleRootItem(), text)
142+
143+
self.auto_adjust_columns = False
140144
if text:
141145
self.tree.expandAll()
146+
else:
147+
self.tree.collapseAll()
148+
149+
self.adjustColumns()
150+
self.auto_adjust_columns = True
151+
152+
if text:
142153
return True
143154
else:
144155
self.tree.collapseAll()
@@ -329,7 +340,8 @@ def accept(self):
329340
def itemExpanded(self, idx):
330341
if idx == self.menusItem.index():
331342
self.saveMenus = True
332-
self.adjustColumns()
343+
if self.auto_adjust_columns:
344+
self.adjustColumns()
333345

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

0 commit comments

Comments
 (0)
Please sign in to comment.