I want to plot a waterfall using Realtime data and I am Reading the data from file which updates in every 2.5 millisecond. I have include my demo code where I tried to implement waterfall which is working but not as intended, Since the data updates every 2.5 millisecond the waterfall can't keep up with the data, its plotting very slowly. Since I am a beginner in Qt I find it difficult to solve.
I would appreciate solutions and it would be great if anyone could include some demo code. Thanks in advance.

    double fft_array[1024];
    for(int x=0; x<=1024; x++)
//Reading FFT_data from file
        QFile file("data.txt");
        if(!file.open(QFile::ReadWrite | QFile::Text))
            qDebug() << "unable to open the file";
        QTextStream in(&file);
        for(int i=0; i < 1024; ++i)
             QString data = in.readLine();
             int fftdata = data.toDouble();


//Plotting Data in waterfall
        for(int y=0; y<1024; y++)