I'm trying to add scrolling to a drag and drop example source that I modified. The example simply draws several draggable QLabel widgets. I was modifying it in a way that a larger number of various different length widgets would be created.
I made a class that would be called by main and would contain the scrolling widget, that in turn would contain the original widget that draws the QLabels. The only method on this class is the constructor, and here's its implementation:
layoutWidget::layoutWidget(QWidget *parent) : QWidget(parent){
QScrollArea *scroll = new QScrollArea();
QVBoxLayout *layout = new QVBoxLayout();
//widget that draws the draggable labels
Widget *w = new Widget();
scroll->setWidget(w);
scroll->setBackgroundRole(QPalette::Light);
layout->addWidget(scroll);
setLayout(layout);
}
I'm using setMinimumSize() on the Widget constructor. When I run the program, only what's inside the area defined by setMinimumSize() is drawn, the rest is clipped off. Am I missing something?