Thank you for the replies so far.

My initial problem is that I add a QTableWidget in a window, the content of the table widget is filled in later. When it is filled in, I call resizeColumnsToContents() to resize the table widget, and that works
perfectly. But then my window doesn't resize itself so I get window with only part of the table widget visualized. I want to have the window also to be resized so I can have a complete view.