I have added few pushbuttons dynamically inside a qframe,but I want to edit the names of the pushbuttons.
QPushButton* newButton = new QPushButton("new button " + QString::number(ui->frame->findChildren<QPushButton*>().count()));
newButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
newButton->setFixedSize(100, 50);
newButton->setParent(ui->frame_6);
int buttonWidth = newButton->width();
int buttonHeight = newButton->height();
int numRows = ui->frame_6->width() / (buttonWidth + 10);
int row = ui->frame_6->findChildren<QPushButton*>().count() / numRows;
int col = ui->frame_6->findChildren<QPushButton*>().count() % numRows;
QPoint buttonPos = QPoint(col * (buttonWidth + 10), row * (buttonHeight + 10));
newButton->move(buttonPos);
newButton->show();
I have used this code snippet to add pushbuttons each time I press the addnew button.Now I want help to edit the names of the newly added pushbuttons.