I'm using the code below to add a QPushButton to a ui:
QPushButton *mine[PlayForm->horizontal][PlayForm->vertical];
for(int i=0; i<PlayForm->horizontal; i++)
{
for(int j=0; j<PlayForm->vertical; j++)
{
QWidget wdg;
mine[i][j] = new QPushButton(" ", &wdg);
mine[i][j]->setGeometry(size*i, size*j, size, size);
mine[i][j]->show();
PlayForm->layout()->addWidget(mine[i][j]);
}
}
But I get this message:
QMainWindowLayout::addItem: Please use the public QMainWindow API instead
What should I do?