PDA

View Full Version : Finding QwtPlot child item to detach it



Momergil
15th January 2013, 21:51
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

Uwe
16th January 2013, 07:16
http://qwt.sourceforge.net/class_qwt_plot_dict.html#a0979adc53ad5ecf5e4a93aa9 b5a4df38

Uwe

Momergil
16th January 2013, 19:01
http://qwt.sourceforge.net/class_qwt_plot_dict.html#a0979adc53ad5ecf5e4a93aa9 b5a4df38

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:



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!