mirror of
https://github.com/SELinuxProject/setools
synced 2025-03-25 04:26:28 +00:00
TERuleQueryTab: change result table column to resize only once
Only resize columns to content once, when results are generated. This will generally provide a reasonable column width, while still allowing the user to resize the columns, such as when the permission list is very long.
This commit is contained in:
parent
72530ff531
commit
124cdd32df
@ -86,13 +86,6 @@ class TERuleQueryTab(SEToolsWidget, QScrollArea):
|
||||
self.sort_proxy = QSortFilterProxyModel(self)
|
||||
self.sort_proxy.setSourceModel(self.table_results_model)
|
||||
self.table_results.setModel(self.sort_proxy)
|
||||
headerview = self.table_results.horizontalHeader()
|
||||
headerview.setSectionResizeMode(0, QHeaderView.ResizeToContents)
|
||||
headerview.setSectionResizeMode(1, QHeaderView.ResizeToContents)
|
||||
headerview.setSectionResizeMode(2, QHeaderView.ResizeToContents)
|
||||
headerview.setSectionResizeMode(3, QHeaderView.ResizeToContents)
|
||||
headerview.setSectionResizeMode(4, QHeaderView.Stretch)
|
||||
headerview.setSectionResizeMode(5, QHeaderView.ResizeToContents)
|
||||
|
||||
# Ensure settings are consistent with the initial .ui state
|
||||
self.set_source_regex(self.source_regex.isChecked())
|
||||
@ -269,6 +262,7 @@ class TERuleQueryTab(SEToolsWidget, QScrollArea):
|
||||
# update results table
|
||||
results = list(self.query.results())
|
||||
self.table_results_model.set_rules(results)
|
||||
self.table_results.resizeColumnsToContents()
|
||||
|
||||
# update raw results
|
||||
self.raw_results.clear()
|
||||
|
Loading…
Reference in New Issue
Block a user