QCustomPlot Discussion and Comments

Update Title using pushbuttonReturn to overview

I saw in another thread where you say to keep a pointer to the title but do not know how to do that.
I am initially setting the title by
ui->customPlot->plotLayout()->insertRow();
ui->customPlot->plotLayout()->addElement(0,0, new QCPPlotTitle(customPlot,lstr));

I want to update the curves on my graph with a new value entered into a text box and want that value to be in the title when it recalcs after clicking a push button.
Tried just restating the above and after replot gives me a new title above the old.
I am fairly new to this and my c++ skills are limited. So any help will be appreciated.

Ok this is fun stuff, found the answer to my question.
In the mainwindow.h file put in
public:
QCPPlotTitle *title;
that is apparently what is meant by keeping a pointer to title.

Then in mainwindow.cpp put in
ui->customPlot->plotLayout()->addElement(0,0, title = new QCPPlotTitle(customPlot,lstr));

forgot to mention before that lstr is a QString.
Now when i click a pushbutton I can change the title with just
title->setText("howdy");
ui->customPlot->replot();

Maybe their will be some other newbie this will help.
The examples from QT is what helped me to find the answer along with the other post on Title.
Thanks to all.