I have a QFrame with a QLabel and a QListView in a vertical layout. I want to resize the QListView exactly to its contents when I add an item to it and have the QFrame adapt to it.

How would I do that? This problem must be pretty common, but I have not found a solution anywhere. Thanks.