mirror of
https://github.com/SELinuxProject/setools
synced 2025-04-11 03:51:26 +00:00
TERuleQueryTab: only set column sizing once (on setupUi)
This commit is contained in:
parent
7af8c276cf
commit
ff5c2dfde1
@ -72,6 +72,13 @@ class TERuleQueryTab(SEToolsWidget, QWidget):
|
|||||||
self.sort_proxy = QSortFilterProxyModel(self)
|
self.sort_proxy = QSortFilterProxyModel(self)
|
||||||
self.sort_proxy.setSourceModel(self.table_results_model)
|
self.sort_proxy.setSourceModel(self.table_results_model)
|
||||||
self.table_results.setModel(self.sort_proxy)
|
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)
|
||||||
|
|
||||||
# check expanders to make sure the display
|
# check expanders to make sure the display
|
||||||
# is consistent with the initial .ui state
|
# is consistent with the initial .ui state
|
||||||
@ -189,15 +196,6 @@ class TERuleQueryTab(SEToolsWidget, QWidget):
|
|||||||
results = list(self.query.results())
|
results = list(self.query.results())
|
||||||
self.table_results_model.set_rules(results)
|
self.table_results_model.set_rules(results)
|
||||||
|
|
||||||
# Column sizing
|
|
||||||
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)
|
|
||||||
|
|
||||||
# update raw results
|
# update raw results
|
||||||
self.raw_results.clear()
|
self.raw_results.clear()
|
||||||
for line in results:
|
for line in results:
|
||||||
|
Loading…
Reference in New Issue
Block a user