How can i make one form unique for different buttons? For example:
QVector<QString> text { "Iter FIRST", "Iter SECOND" };
for(size_t i = 0; i < 2; ++i)
{
Form2 * form2 = new Form2(); //creating form
connect(this, &MainWindow::SendCurretIteration, fitr,
&CurrentIterationForm::ShowCurrentIteration);//connect to the second form`
emit MainWindow::SendCurretIteration(text[i]);
QPushButton *btnShowForm = new QPushButton(this);
btnShowForm->setGeometry(i + 40, i + 100, 50, 50);
connect(btnShowForm, &QPushButton::clicked, this, [=]()
{
form2->show();
});
}//end for()
And what i see by clicking on each button? ->Iter SECOND by clicking on button 1. ->Iter SECOND by clicking on button 2.
How to fix?