"layout" is not a QWidget, QScrollArea::setWidget expects one.
Cheers,
_
"layout" is not a QWidget, QScrollArea::setWidget expects one.
Cheers,
_
Right! I should have know that! Haha. So I need to use .setLayout instead of .setWidget.
Thanks Again!
Last edited by Nfrancisj; 9th May 2016 at 17:15.
Nope...well that didn't work for me either. Now I get an error on window.setLayout because that's expecting a layout, not widget.
So how do I do this? How do I get a GridLayout to work with ScrollArea. I also tried this in the designer, and it kinda didn't work either. I added the scroll to the form, buttons inside the scroll, and set the scroll to GridLayout. The scroll did size with the window, but the scroll bars didn't appear.
No.
setWidget() is correct, it sets the content widget of the scrollarea.
setLayout() would change the layout of the scrollarea, you definitely don't want that.
As I said in my initial reply, add a widget to the scroll area, put the buttons onto that widget using an appropriate layout.
Cheers,
_
Bookmarks