include "mainwindow.h"
include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
MainWindow::makePlot();
}

MainWindow::~MainWindow()
{
delete ui;
}

void MainWindow::makePlot()
{
QVector<double> x(4), y(4);

  x[0] = 5;
  y[0] = 5;
  x[1] = 10;
  y[1] = 6;
  x[2] = 10;
  y[2] = 23;
  x[3] = 20;
  y[3] = 35;

ui->customPlot->addGraph();
ui->customPlot->graph(0)->setData(x, y);

ui->customPlot->xAxis->setLabel("x");
ui->customPlot->yAxis->setLabel("y");

ui->customPlot->xAxis->setRange(0, 50);
ui->customPlot->yAxis->setRange(0, 50);
ui->customPlot->replot();

}

jak przerobic ten kod zeby mozna bylo podawac dane do rysowania wykrsu?