You don't, at least not in programs that behave in the way most people expect.So how to force the MainWindow to resize to the width of the table showing all columns ?
If you really must do it then you probably need to start with QHeaderView::length() and force the minimum width of the QTableView. Don't forget to handle the case of the able content being wider than the screen.
Bookmarks