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.
"""
toggle = self.count() > 10
bar = self.tabBar()
if toggle:
self.setUpdatesEnabled(False)
self.setVisible(False)
bar.setUpdatesEnabled(False)
bar.setVisible(False)
yield
if toggle:
self.setVisible(True)
self.setUpdatesEnabled(True)
bar.setVisible(True)
bar.setUpdatesEnabled(True)
def update_tab_titles(self):
"""Update all texts."""