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.
|
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."""
|
||||||
|
Loading…
Reference in New Issue
Block a user