Finding QwtPlot child item to detach it
Hello!
I want to attach a QwtPlotCurve into a QwtPlot and later be able to dettach it. One obvious way to do this is to create the QwtPlotCurve as a global pointer and than just call it lather when desired, but I would like to avoid using a global pointer in this situation since such methodology would force me to have a unknown multitude of global pointers.
So rather what I would like to do is to create a local pointer to a QwtPlotCurve object, configure it, attach to the QwtPlot and when desired find that child object from the QwtPlot and ask it to be dettached and deleted.
How could I do this?
Thanks,
Momergil
Re: Finding QwtPlot child item to detach it
Re: Finding QwtPlot child item to detach it
Quote:
Originally Posted by
Uwe
Yeah, I did find theese functions, but I wasn't able to use them. First, the detachItems() is not suitable because as far as I understood, I can't say which of the items I want to detach; and I don't want to detach them all.
news:
OK, I managed to use the itemList function this way:
Code:
graphCandle->itemList().at(0)->detach();
//This way wouldn't work:
graphCandle->itemList()[0]
My last question would be how do I identify which is the object I want; for now I'm using the title.
Thanks Uwe!