PDA

View Full Version : Scrollable QLayout



Luc4
7th June 2010, 10:30
Hi! I created a toolbar where I add buttons in a QVBoxLayout. It happens that the QVBoxLayout cannot place all the buttons inside the layout. Would it be possible to insert the layout in a QScrollArea so that, in case the layout cannot place all the buttons, it automatically creates the scrollbar to scroll the buttons?
Thanks!

tbscope
7th June 2010, 14:19
Did you try it?

Luc4
7th June 2010, 14:26
What? Placing all the buttons? Yes, it resizes the buttons, but I can't allow this.

reticent
2nd August 2010, 11:43
I have similar kind of situation where instead of buttons I have widgets but not listWidgets. Does anyone have any idea how it can be done.

aamer4yu
2nd August 2010, 12:58
You can set the size policy of the buttons so that they dont increase in size.
QScrollArea should be fine.

sherbs
2nd August 2010, 14:49
I did something similar to this with checkboxes...

I ended up putting a QFrame inside a QScrollArea... Adding a vbox layout to the frame and then adding my checkboxes to the layout gave the results that you are looking for...

I'm kind of new to Qt though so others might know a better way to do it...