Resize button with window and layout
I have Grid layout within that I have scrollArea where I am creating dynamic buttons, layout is within the centralWidget , When I resize (shrink , expand ) i want to resize my layout as well as button inside that .
How can I do that
I have tried adjustSize and setSizePolicy fixed and expanding but nothing works on layout
when I shrink the window button are hidden in stand of it I want it to be shrink with window size
Re: Resize button with window and layout
In all likelihood you have not applied the layout to the widget (i.e. myCentralWidget->setLayout(myGridLayout) ). Hard to say as we see no code.
Re: Resize button with window and layout
Code:
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);
Here it is
when I have tried
centralWidget()->setLayout(grid);
it ll shrink with window size but it wont fit in to the layout