How to program QScrollArea thorugh QtCreator
-
Hi i am trying to make an application which will have QStackedWidget on top of Widget and i have taken a QScrollArea and added multiple groupboxes to a verticalLayout but i was unable to see the scrollbar for QScrollArea. Even if i am increasing the number of groupboxes the groupboxes are adjusting on top of scrollarea but i am unable to see the scrollbar for scrollArea
Here is my creation hierarchy and application output
Please go through the below screenshots
http://img4.imagetitan.com/img.php?image=16_screenshotfrom2017-06-3017-43-29.png
http://img4.imagetitan.com/img.php?image=16_screenshotfrom2017-06-3017-43-41.png
http://img4.imagetitan.com/img.php?image=16_screenshotfrom2017-06-3017-44-23.png
Regard's
Rohith.G -
@Rohith
HiThe layout you have used, is that one you dragged from the widget box ?
Normally, you place one groupbox, right click and use the layout menu to add the layout.
Then add the rest of the groupboxes. (or add all, then right click and apply layout)Those floating layouts (red) are to insert into another layout.
The reason no scrollbars come (it seems ) is that there is no minimum height for the group box.
so when you add a new the others are just compressed more.Try setting a minimum height / add other widgets to them so they cant be small as a line
-
Thanks for replying i have done what you have said, but the layout is not getting added to the scrollAreaWidgetContents but it is adding seperately. You can check the below screen shot
Before Adding Layout:
http://img4.imagetitan.com/img.php?image=16_screenshotfrom2017-07-0115-30-14.pngAfter Adding Layout:
http://img4.imagetitan.com/img.php?image=16_screenshotfrom2017-07-0115-45-58.pngHow i want to add through QtCreator
http://img4.imagetitan.com/img.php?image=16_screenshotfrom2017-07-0115-30-38.pngRegard's,
Rohith.G -
@Rohith
Hi
Im not sure what goes wrong.
I guess you are still not using the RIGHT click layout menu ?
Do not drag layouts from left box.Please see this video.
https://www.dropbox.com/s/t3icclcqb446jkm/scroll.mp4?dl=0