Important: Please read the Qt Code of Conduct -

QwtPlot Not able to update(replot) in QMainWindow

  • I have recently started utilizing Qwt, as it seemed a suitable solution. I am sub classing QwtPlot to create my own graph class. Everything was going well until i tried to actually plot to a QMainWindow. For some reason whenever i call replot() no update occurs. At first I thought it was losing reference to my QwtPlotCurve but i have since tested that. So now I am not sure what to do. I even tried reimplementing the replot() method to see if i could force a redraw of the points. If i do the same process that i am in the main.cpp everything works just fine. So why is QMainWindow preventing the update of my QwtPlot widget? Any direction would be greatly appreciated.

    Here is the function in which i am setting the RawSamples to the QwtPlotCurve
    @ void LineGraph::setCurveData(double xData[], double yData[],int setPlotMargine)

     cCurve = new QwtPlotCurve();


    and here is where i am trying to set it to a frame in MainWindow

    @MainWindow::MainWindow(QWidget *parent) :
    ui(new Ui::MainWindow)

    LineGraph *plot = new LineGraph();
    double x = 100.0;
    double px = 0.0;
    double y = 0.0;
    double py = 100.0;
    double x1[50];
    double y1[50];
    for(int i =0; i<50; i++)
        x1[i] = i * 6;
        y1[i] = i*6;
    QGridLayout *layout = new QGridLayout;



  • no one wants to touch this one huh? lol

  • Come on! Not even 24 hours and you're crying? It's not always the case that someone comes back with a solution within 30 minutes....

  • lol i know, i know. I get impatient sometimes, i apologize.

Log in to reply