Hi All,
I am trying to achieve something like the following:
flow_Layout_QPushButtons.jpg
Here's my code for it.
Qt Code:
Window::Window() { FlowLayout *flowLayout = new FlowLayout(); flowWidget->setLayout(flowLayout); int n=20; for (int ii=0;ii<n;ii++) { pb->setMinimumSize(200,200); buttons.push_back(pb); // adding buttons to qvector flowLayout->addWidget(pb); } scroll->setWidget(flowWidget); a->setCentralWidget(scroll); a->show(); setWindowTitle(tr("Flow Layout")); }To copy to clipboard, switch view to plain text mode
It seems like flowLayout is not working after the use of scrollArea widget. I want the content of window-2 to be displayed within window-1.
Please suggest how to achieve it?
Thanks!
Bookmarks