I've got my own plot class CDataPlot

Qt Code:
  1. class CDataPlot : public QwtPlot
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. CDataPlot(QWidget* parent = 0);
  7. virtual ~CDataPlot();
  8. void SetPlotConfiguration(const QString& title = "", const QString& curvetitle="",
  9. const QString& xtitle = "", const QString& ytitle = "",
  10. double xlen = 0.0, double ylen = 0.0);
  11. };
To copy to clipboard, switch view to plain text mode 

In the constructor
Qt Code:
  1. CDataPlot::CDataPlot(QWidget* parent):QwtPlot(parent)
  2. {
  3. setupQWTUi();
  4. this->SetPlotConfiguration("This can !");
  5. // I can update the title of the plot here. For sure, this is just the constructor of the plot !!!!
  6. }
To copy to clipboard, switch view to plain text mode 

Then, I've got another class CObjectDetectionPlots


Qt Code:
  1. // Object detection figures
  2. class CObjectDetectionPlots : public QMainWindow
  3. {
  4. Q_OBJECT
  5.  
  6. public:
  7. CObjectDetectionPlots(QWidget *parent = 0, Qt::WFlags flags = 0);
  8. ~CObjectDetectionPlots();
  9.  
  10. CDataPlot* m_pDataPlot;
  11. };
To copy to clipboard, switch view to plain text mode 

In the constructor

Qt Code:
  1. CObjectDetectionPlots::CObjectDetectionPlots(QWidget *parent, Qt::WFlags flags)
  2. : QMainWindow(parent, flags)
  3. {
  4. // private ui
  5. m_pDataPlot = new CDataPlot(this);
  6. m_pDataPlot->SetPlotConfiguration("Can the title be updated?"); // no updating at all !!!
  7. m_pDataPlot->replot(); // even if replot(), no use!!!!
  8. ui.setupUi(this);
  9. }
To copy to clipboard, switch view to plain text mode 

I just want to update the title of CDataPlot* m_pDataPlot; after having created the plot. Can I?
If so, how to do it?


As you can see, if I updated the title from within plot's constructor, I can get it done.
However, if I try to update the plot's title from outside, no updating at all !!!!!!!!!
Even if I use replot(), no use at all!!!


Please can anybody help to explain and give me a solution how will QWT update the plot after a plot object has been created??


Best Regards
JIA