Create a new QStyleOptionTab object for each tab.

It seems under some circumstances (on Gentoo?), the existing QStyleOptionTab
object was reused, causing subsequent tabs to have the same title as the first
one.

Fixes #778.
This commit is contained in:
Franz Fellner 2015-06-24 21:27:37 +02:00 committed by Florian Bruhin
parent 75b894a186
commit 534a85cf8f

View File

@ -391,9 +391,9 @@ class TabBar(QTabBar):
def paintEvent(self, _e):
"""Override paintEvent to draw the tabs like we want to."""
p = QStylePainter(self)
tab = QStyleOptionTab()
selected = self.currentIndex()
for idx in range(self.count()):
tab = QStyleOptionTab()
self.initStyleOption(tab, idx)
if idx == selected:
bg_color = config.get('colors', 'tabs.bg.selected')