Hello everybody. I quite new to the QT/Qwt scheme and I've run into a difficulty.
I am trying to plot a histogram using the QwtPlot, based on the example found in Qwt. When the user clicks a button a new window opens and a histogram is drawn in it. My problem is that the histogram is just plotted and then vanishes, leaving the window open but empty. The part of the code inside the clicked button section is like that:

Qt Code:
  1. QWidget* nw= new QWidget(0, Qt::Window);
  2. QwtPlot plot(nw);
  3. // ....
  4. //Passing Data to histogram
  5. // ...
  6. plot.show();
  7. nw->show();
To copy to clipboard, switch view to plain text mode 

If I create a Modal MessageBox right after the nw->show part, I can see the histogram. But as soon as the OK is pressed, it disappears ....

Please any help would be really appreciated!!!