ui->scrollArea->setWidget(w);
// this->setFixedSize(this->geometry().width(),this->geometry().height());
for(row=0;row <= 49 ;row++)
{
grid->addWidget(pb, row/4, row%4);
}
w->setLayout(grid);
QWidget *w = new QWidget(this);
QGridLayout *grid = new QGridLayout();
ui->scrollArea->setWidget(w);
// this->setFixedSize(this->geometry().width(),this->geometry().height());
QMap<int,QPushButton*> mapp;
for(row=0;row <= 49 ;row++)
{
QPushButton *pb = new QPushButton(w);
grid->addWidget(pb, row/4, row%4);
pb->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding);
}
w->setLayout(grid);
To copy to clipboard, switch view to plain text mode
Here it is
when I have tried
centralWidget()->setLayout(grid);
it ll shrink with window size but it wont fit in to the layout
Bookmarks