Show/hide TabBar and not TabWidget with many tabs

This commit is contained in:
Florian Bruhin 2018-10-04 15:54:07 +02:00
parent 45d2e74f53
commit 0caff547aa

View File

@ -226,15 +226,16 @@ class TabWidget(QTabWidget):
work. work.
""" """
toggle = self.count() > 10 toggle = self.count() > 10
bar = self.tabBar()
if toggle: if toggle:
self.setUpdatesEnabled(False) bar.setUpdatesEnabled(False)
self.setVisible(False) bar.setVisible(False)
yield yield
if toggle: if toggle:
self.setVisible(True) bar.setVisible(True)
self.setUpdatesEnabled(True) bar.setUpdatesEnabled(True)
def update_tab_titles(self): def update_tab_titles(self):
"""Update all texts.""" """Update all texts."""