I am trying to put a grid view that will contain some buttons into a scroll area but I don't know why the grid layout only fits into the initial size of the scroll area (it doesn't go downside so I could use the scroll bar to see all elements).
ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
QGridLayout* lay=new QGridLayout(this);
QPushButton *name[100];
for(int i=0;i<10;i++){
QString str1="project"+QString::number(i);
QString str2="3/6task";
QString str3="ALEX";
name[i]=new QPushButton(str1);
name[i]->setObjectName("btn_1");
name[i]->setStyleSheet("QPushButton#btn_1{background:transparent;Text-align:left;font-family:century gothic;font-size:18px;color:red;}"
"QPushButton#btn_1:hover{color:yellow;Font-size:22px;}");
name[i]->setFixedSize(100,40);
lay->addWidget(name[i]);
}
ui->scrollArea->setLayout(lay);
The result is in the next photo: