for (int x = 0; x < size; x++) {
for (int y = 0; y < size; y++) {
QLineEdit *newEdit = new QLineEdit(" ");
newEdit->setGeometry(y * 50, x * 25, 50, 25);
newEdit->setText("0");
layout()->addWidget(newEdit);
objMatrix[y + x * size] = newEdit;
}
}
I am using that code to add widgets dynamicly. Then i get this error:
QMainWindowLayout::addItem: Please use the public QMainWindow API instead
As many times, as code layout()->addWidget(newEdit);
has worked.
What should i do to prevent it?
Sorry for my english.