Hi.
When i add some buttons to my grid widget, i use the center align (default).
However if i use removeAllWidgets before i add my buttons to grid the alignment is getting top-left.
I use the 0.7.4
One solution is to use this code insted of "removeAllWidgets()"
When i add some buttons to my grid widget, i use the center align (default).
However if i use removeAllWidgets before i add my buttons to grid the alignment is getting top-left.
I use the 0.7.4
Code Select
pGrid->removeAllWidgets();
int index = 0;
for (unsigned int row = 0; row < 2; ++row)
for (unsigned int col = 0; col < 2; ++col) {
pGrid->addWidget(pGridButtons[index++], row, col);
One solution is to use this code insted of "removeAllWidgets()"
Code Select
auto& widgets = pGrid->getWidgets();
for (int i = 0; i < widgets.size(); i++)
{
pGrid->remove(widgets[i]);
}