Fix _is_pinned() during init
This commit is contained in:
parent
45a3611b62
commit
c7c9a2cb84
@ -599,7 +599,13 @@ class TabBar(QTabBar):
|
|||||||
if not 0 <= index < self.count():
|
if not 0 <= index < self.count():
|
||||||
raise IndexError("Tab index ({}) out of range ({})!".format(
|
raise IndexError("Tab index ({}) out of range ({})!".format(
|
||||||
index, self.count()))
|
index, self.count()))
|
||||||
return self.parent().widget(index).data.pinned
|
|
||||||
|
widget = self.parent().widget(index)
|
||||||
|
if widget is None:
|
||||||
|
# This could happen when Qt calls tabSizeHint while initializing
|
||||||
|
# tabs.
|
||||||
|
return False
|
||||||
|
return widget.data.pinned
|
||||||
|
|
||||||
def tabSizeHint(self, index: int):
|
def tabSizeHint(self, index: int):
|
||||||
"""Override tabSizeHint to customize qb's tab size.
|
"""Override tabSizeHint to customize qb's tab size.
|
||||||
|
Loading…
Reference in New Issue
Block a user