Show/hide TabBar and not TabWidget with many tabs
This commit is contained in:
parent
45d2e74f53
commit
0caff547aa
@ -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."""
|
||||
|
Loading…
Reference in New Issue
Block a user