Scrolling inside a Qtoolbox
-
I have following hierarchy designed in Designer:
QToolbox -> VerticalLayout -> GridLayout -> Pushbutton_1, Pushbutton_2,.... Pushbutton_n
Basically, I have laid out many pushbuttons using a gridlayout which in turn is inside a VerticalLayout which in turn is inside a QToolbox page.
There are many pushbuttons in the grid layout. I have set minimum width/height for all of them. Area required to layout all these push buttons can be larger than the area available in the page of the qtoolbox. I would like to automatically add a scroll bars to the page when this happens. I tried to use a scroll area as the parent of the vertical layout but it does not work. Any idea why?
-
Hi and welcome to devnet,
You should set the layout on a QWidget that you set on the QScrollArea.
-
Hi and welcome to devnet,
You should set the layout on a QWidget that you set on the QScrollArea.
-
No need for a QFrame, use a QWidget.
-
Since you have scrollAreaWidgetContent, remove "widget" and set the layout on scrollAreaWidgetContent.
-
Since you have scrollAreaWidgetContent, remove "widget" and set the layout on scrollAreaWidgetContent.
-
Did you remove the "widget" and applied the vertical layout on scrollAreaWidgetContent as suggested ?