PDA

View Full Version : How to access QwtPlotMarkers out of the itemList()?



freeman_w
25th October 2012, 16:00
Hi there!

I am trying to make some markers of a plot disappear. I am using the itemList() function to get the plotitems:



foreach (QwtPlotItem* item, itemList())
{
if (item->rtti() == QwtPlotItem::Rtti_PlotMarker)
{
//if (item->lineStyle() == QwtPlotMarker::NoLine) // doesn't work because item is of type QwtPlotItem and not QwtPlotMarker
item->setVisible(false);
}
}


I need to leave some line-markers visible and hide the "QwtPlotMarker::NoLine"-ones.
How do i access the QwtPlotMarker out of the "QwtPlotItem* item"??
Is there a way to achieve that?

Thanks in advance...

Uwe
26th October 2012, 08:49
How do i access the QwtPlotMarker out of the "QwtPlotItem* item"??
That's more a C++ than a Qwt question: simply use a cast.

Uwe