Indeed, you don't understand.
void UserInterface::addButtons()
{
for (quint8 x = 1; x <= 10; x++) {
for (quint8 y = 1; y <= 10; y++) {
button->setGeometry(x * 30, y * 30, 30, 30);
buttonList.push_back(button);
}
}
}
void UserInterface::addButtons()
{
for (quint8 x = 1; x <= 10; x++) {
for (quint8 y = 1; y <= 10; y++) {
QPushButton* button = new QPushButton(this);
button->setGeometry(x * 30, y * 30, 30, 30);
buttonList.push_back(button);
}
}
}
To copy to clipboard, switch view to plain text mode
If I call this function from constructor it's all good, everything works. But if I call it from a slot function (at random time) then widgets doesn't appear on the main window. Do you see my problem now?
Bookmarks