Have a column in a QTreeWidget occupy as much space as possible

I’m building an application which uses a QTreeWidget to display a directory tree
On Dolphin (KDE’s default file manager), the list view by default has the filename column occupy the full width of the tree view, minus the space for other columns
(video)
Is it possible to achieve something similar? My guess is that I need to set some sizePolicy, but I’m not sure how

I figured it out: setStretchLastSection and setSectionResizeMode

from Qt import QHeaderView
...
tree_widget_instance.header().setStretchLastSection(False)
tree_widget_instance.header().setSectionResizeMode(0, QHeaderView.ResizeMode.Stretch)