user1834249
user1834249

Reputation:

height of QListWidget same as window's height

How can I make my QListWidget's height same as my main window's?

So if I change the main windows it has to resize, make a scrollbar visible if lists can't all be viewed in widget, etc.

Upvotes: 0

Views: 109

Answers (1)

sashoalm
sashoalm

Reputation: 79685

Qt has this nifty thing called layouts which does just what you want.

If the list widget is the only widget in the main window, then simply setting the main window's layout to horizontal or vertical should be enough.

Here's a link to a video tutorial about layouts.

Upvotes: 3

Related Questions