Jak przekazac *mainLineEdit do makePlot()
void MainWindow::makePlot()
{
QVector<double> x(ilosc), y(ilosc);
for(double i=0;i<ilosc;i++)
{
x[i] = ui->myLineEdit[i]->text().toFloat;
y[i] = ui->myLineEdit2[i]->text().toFloat
}
ui->customPlot->addGraph();
ui->customPlot->graph(0)->setData(x, y);
ui->customPlot->xAxis->setLabel("x");
ui->customPlot->yAxis->setLabel("czas[t]");
ui->customPlot->xAxis->setRange(0, 50);
ui->customPlot->yAxis->setRange(0, 50);
ui->customPlot->replot();
}
void MainWindow::on_pushButton_clicked()
{
{
int ilosc = ui->lineEdit->text().toInt();
for(int a = 0; a < ilosc; a++)
{
QLabel *label1 = new QLabel("X");
QLabel *label2 = new QLabel("Y");
QLineEdit *myLineEdit = new QLineEdit;
QLineEdit *myLineEdit2 = new QLineEdit;
ui->gridLayout->addWidget(myLineEdit);
ui->gridLayout->addWidget(label1);
ui->gridLayout->addWidget(myLineEdit2);
ui->gridLayout->addWidget(label2);
}
}
}