Skip to content

Commit

Permalink
Hide empty grouptabs after filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
jfeil committed Oct 8, 2022
1 parent 279ceb4 commit a0cd628
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,10 @@ def add_filter(self, list_entry: QListWidgetItem | bool = False):
self.refresh_column_filter()

def refresh_column_filter(self):
for (_, filter_model, _) in self.question_group_tabs:
for index, (_, filter_model, _) in enumerate(self.question_group_tabs):
filter_model = filter_model # type: RuleSortFilterProxyModel
filter_model.invalidateFilter()
self.ui.tabWidget.setTabVisible(index, filter_model.rowCount() != 0)

def create_ruletabs(self, question_groups: List[QuestionGroup]):
self.ui.tabWidget.setTabsClosable(True)
Expand Down

0 comments on commit a0cd628

Please sign in to comment.