hi
is there any QwtPlotCurve::function to know is a curve attached or not?
for example there are curve1, curve2,...,curve100 and some of these curves are attached. i need if curve20 was attached now it is be detached
hi
is there any QwtPlotCurve::function to know is a curve attached or not?
for example there are curve1, curve2,...,curve100 and some of these curves are attached. i need if curve20 was attached now it is be detached
Hello,
I didn't find any "QwtPlotCurve::isAttached()" method in the documentation. However, if you want to check if a curve is attached to a specific QwtPlot, you can get the list of all attached QwtPlotItems by calling QwtPlot::intemList() (or more specifically: QwtPlotDict::itemList(). Note that QwtPlot is derived from QwtPlotDict). Then check if your curve is contained in this list.
Best regards
ars
Alex22 (20th December 2015)
Hello,
here's an update to my previous post (didn't rember it yesterday). From Qwt documentation of QwtPlotItem:
So simply check if curve->plot() is null or not.QwtPlot * plot () const
Return attached plot.
Best regards
ars
Alex22 (21st December 2015)
Use signal void QwtPlot::itemAttached (QwtPlotItem *plotItem, bool on) and reimplement for each curve int QwtPlotCurve::rtti () const with Rtti_PlotUserItem + 1, + 2 ... + 100
Qt Code:
{ public: { m_value = value; } virtual int rtti () const { return m_value; } private: };To copy to clipboard, switch view to plain text mode
Bookmarks