My QMainWindow is using QMdiArea. The viewMode of the QMdiArea is set to TabbedView. The Tab size of MdiArea takes entire width of the MdiArea:
If more tabs are added, they divide MdiArea width and consume entire width:
I understand that the MdiArea in tabbedView uses QTabBar, but I'm not able to find a way to set MdiArea's TabBar setExpanding property to false.
Any clue (Qt, PyQt or PySide) will be helpful.


The tab-bar of a QMdiArea can be accessed, but there's currently no public API for it. A work-around is to first ensure the view-mode is set to
TabbedView, and then use findChild to get theQTabBarobject. It will then be possible to change the expanding property of the tab-bar: