Resize Tabs from QTabWidget to Content [duplicate]
问题 This question already has an answer here : Resize QMainWindow to minimal size after content of layout changes (1 answer) Closed 12 days ago . I'm using QTabWidget to show content with different sizes. How do I resize my tabs in a way that it matches my content? Goal: Tab1: Tab2: I tried to write a function that connects to QTabWidget.currentChanged(), I managed to ignore QSizePolicy, but the resize doesn't come into effect. I can however resize manually without problem. import sys from PyQt5