QCustomPlot Discussion and Comments

Displaying plots in a loopReturn to overview

Hello,

I am new to Qt and QCustomPlot. After some time I have managed to compile the library as a shared one and produce a FindQCustomPlot.cmake (copied from here: https://sources.debian.net/patches/qcustomplot/1.2.1-3/). So now I can use QCustomPlot from my own project. However, I see that all the examples create a MainWindow in the main function of the cpp file and that is not quite the same of what I want to do. I have a program that does some computation on some given data and I want to plot the results using QCusstomPlot. My program does the computation for several groups of data (one for each group), and I want the plot to appear at each loop and the loop should wait until I close the window. The loop would look similar to:

for (int i=0;i<n_groups;i++){
    results = compute(data[i]);
    plot(results);
}

Based on the exmaples given in the library, the main.cpp files are:
  
  QApplication a(argc, argv);
  MainWindow w;
  w.show();

and I want to do something like
  
  QApplication a(argc, argv);
  for (int i=0;i<5;i++){
    MainWindow w;
    w.show();
  }

However, when I do this no window apears. Can anybody tell me how to do something like that?

Thankyou very much.

I have solved this and now I am facing a problem that I posted here: https://forum.qt.io/topic/78947/displaying-windows-in-a-loop

this really doesnt have anything to do with qcustomplot... but it also looks like the posts in there explain your problem pretty clearly.