Im creating a program that reads from a text file and plots the integers. Here is what I have so far
#include "realtime.h"
#include "ui_realtime.h"
#include <QFile>
#include<QIODevice>
Realtime::Realtime(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Realtime)
{
    ui->setupUi(this);
    int size = 1000;
    QVector<double> x(size), y(size);
    for (int i=0; i<size; i++)
    {
        x[i]= i;
        y[i]= i ;
    }
    ui->plot->addGraph();
    ui->plot->graph(0)->setData(x,y);
    ui->plot->xAxis->setRange(0,10);
    ui->plot->yAxis->setRange(0,10);
}
Realtime::~Realtime()
{
    delete ui;
} 
int main()
{
    std::vector<int>ints;
    QFile file("2dplotarray.txt");
    if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
        while (!file.atEnd())
        {
            QByteArray line = file.readLine();
            QDataStream ds(line);
            int int_in_line = 0;
            ds >> int_in_line;
            ints.push_back(int_in_line);
        }
    return 0    ;
}
Ignore the current x and y values, that was me testing the plotting features. How do i put the text file into the y values of my plot? The text file looks like this(NOT CODE just the best way to display it)
    1
    2
    3
    4
    etc...
 
    